@urbiport/js 0.0.11 → 0.0.13

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.
Files changed (229) hide show
  1. package/README.md +39 -39
  2. package/dist/components/Bot.d.ts +8 -4
  3. package/dist/components/Bot.d.ts.map +1 -1
  4. package/dist/components/Button.d.ts +0 -1
  5. package/dist/components/Button.d.ts.map +1 -1
  6. package/dist/components/{SendButton.d.ts → ButtonSubmit.d.ts} +3 -4
  7. package/dist/components/ButtonSubmit.d.ts.map +1 -0
  8. package/dist/components/{InputChatBlock.d.ts → ChatInputFooter.d.ts} +4 -5
  9. package/dist/components/ChatInputFooter.d.ts.map +1 -0
  10. package/dist/components/ConversationContainer/ConversationContainer.d.ts +7 -2
  11. package/dist/components/ConversationContainer/ConversationContainer.d.ts.map +1 -1
  12. package/dist/components/ConversationContainer/ConversationContainerBody.d.ts +14 -0
  13. package/dist/components/ConversationContainer/ConversationContainerBody.d.ts.map +1 -0
  14. package/dist/components/ConversationContainer/ConversationContainerFooter.d.ts +17 -0
  15. package/dist/components/ConversationContainer/ConversationContainerFooter.d.ts.map +1 -0
  16. package/dist/components/ConversationContainer/{ChatChunk.d.ts → ConversationMessageChunk.d.ts} +5 -4
  17. package/dist/components/ConversationContainer/ConversationMessageChunk.d.ts.map +1 -0
  18. package/dist/components/ConversationContainer/ConversationPopupBlockedToast.d.ts +7 -0
  19. package/dist/components/ConversationContainer/ConversationPopupBlockedToast.d.ts.map +1 -0
  20. package/dist/components/ConversationContainer/ConversationProgressBar.d.ts +6 -0
  21. package/dist/components/ConversationContainer/ConversationProgressBar.d.ts.map +1 -0
  22. package/dist/components/ConversationContainer/HostAvatar.d.ts +8 -0
  23. package/dist/components/ConversationContainer/HostAvatar.d.ts.map +1 -0
  24. package/dist/components/ConversationContainer/InputAnswer.d.ts +18 -0
  25. package/dist/components/ConversationContainer/InputAnswer.d.ts.map +1 -0
  26. package/dist/components/ConversationContainer/helpers.d.ts +6 -0
  27. package/dist/components/ConversationContainer/helpers.d.ts.map +1 -0
  28. package/dist/components/FooterEndConversation.d.ts +2 -0
  29. package/dist/components/FooterEndConversation.d.ts.map +1 -0
  30. package/dist/components/FooterLiteBadge.d.ts +6 -0
  31. package/dist/components/FooterLiteBadge.d.ts.map +1 -0
  32. package/dist/components/InputAnswerContext.d.ts +46 -0
  33. package/dist/components/InputAnswerContext.d.ts.map +1 -0
  34. package/dist/components/InputFormLayout.d.ts +19 -0
  35. package/dist/components/InputFormLayout.d.ts.map +1 -0
  36. package/dist/components/Spinner.d.ts.map +1 -1
  37. package/dist/components/avatars/AvatarPlaceholder.d.ts +7 -0
  38. package/dist/components/avatars/AvatarPlaceholder.d.ts.map +1 -0
  39. package/dist/components/bubbles/HostBubble.d.ts +1 -1
  40. package/dist/components/bubbles/HostBubble.d.ts.map +1 -1
  41. package/dist/components/bubbles/HostBubbleStreaming.d.ts +8 -0
  42. package/dist/components/bubbles/HostBubbleStreaming.d.ts.map +1 -0
  43. package/dist/components/icons/LogoIcon.d.ts +2 -0
  44. package/dist/components/icons/LogoIcon.d.ts.map +1 -0
  45. package/dist/components/icons/MicrophoneIcon.d.ts.map +1 -1
  46. package/dist/components/icons/SendIcon.d.ts.map +1 -1
  47. package/dist/{features/blocks/inputs/fileUpload/components/SelectedFile.d.ts → components/inputs/FileAttached.d.ts} +2 -2
  48. package/dist/components/inputs/FileAttached.d.ts.map +1 -0
  49. package/dist/components/inputs/{ShortTextInput.d.ts → Input.d.ts} +2 -2
  50. package/dist/components/inputs/Input.d.ts.map +1 -0
  51. package/dist/components/inputs/Textarea.d.ts +2 -1
  52. package/dist/components/inputs/Textarea.d.ts.map +1 -1
  53. package/dist/features/blocks/bubbles/audio/components/AudioBubble.d.ts +1 -1
  54. package/dist/features/blocks/bubbles/audio/components/AudioBubble.d.ts.map +1 -1
  55. package/dist/features/blocks/bubbles/embed/components/EmbedBubble.d.ts +1 -2
  56. package/dist/features/blocks/bubbles/embed/components/EmbedBubble.d.ts.map +1 -1
  57. package/dist/features/blocks/bubbles/image/components/ImageBubble.d.ts +1 -3
  58. package/dist/features/blocks/bubbles/image/components/ImageBubble.d.ts.map +1 -1
  59. package/dist/features/blocks/bubbles/textBubble/components/TextBubble.d.ts +1 -2
  60. package/dist/features/blocks/bubbles/textBubble/components/TextBubble.d.ts.map +1 -1
  61. package/dist/features/blocks/bubbles/video/components/VideoBubble.d.ts +1 -2
  62. package/dist/features/blocks/bubbles/video/components/VideoBubble.d.ts.map +1 -1
  63. package/dist/features/blocks/inputs/buttons/components/Buttons.d.ts +4 -2
  64. package/dist/features/blocks/inputs/buttons/components/Buttons.d.ts.map +1 -1
  65. package/dist/{components/inputs/SearchInput.d.ts → features/blocks/inputs/buttons/components/ButtonsSearch.d.ts} +2 -2
  66. package/dist/features/blocks/inputs/buttons/components/ButtonsSearch.d.ts.map +1 -0
  67. package/dist/features/blocks/inputs/buttons/index.d.ts +2 -0
  68. package/dist/features/blocks/inputs/buttons/index.d.ts.map +1 -0
  69. package/dist/features/blocks/inputs/date/components/DateForm.d.ts +1 -1
  70. package/dist/features/blocks/inputs/date/components/DateForm.d.ts.map +1 -1
  71. package/dist/features/blocks/inputs/email/components/EmailInput.d.ts +3 -1
  72. package/dist/features/blocks/inputs/email/components/EmailInput.d.ts.map +1 -1
  73. package/dist/features/blocks/inputs/fileUpload/components/FileUploadForm.d.ts +1 -1
  74. package/dist/features/blocks/inputs/fileUpload/components/FileUploadForm.d.ts.map +1 -1
  75. package/dist/features/blocks/inputs/fileUpload/{helpers → utils}/sanitizeSelectedFiles.d.ts +2 -4
  76. package/dist/features/blocks/inputs/fileUpload/utils/sanitizeSelectedFiles.d.ts.map +1 -0
  77. package/dist/features/blocks/inputs/fileUpload/utils/uploadFiles.d.ts.map +1 -0
  78. package/dist/features/blocks/inputs/number/components/NumberInput.d.ts +1 -1
  79. package/dist/features/blocks/inputs/number/components/NumberInput.d.ts.map +1 -1
  80. package/dist/features/blocks/inputs/number/utils/numberInputHelper.d.ts.map +1 -0
  81. package/dist/features/blocks/inputs/payment/components/PaymentForm.d.ts +1 -1
  82. package/dist/features/blocks/inputs/payment/components/PaymentForm.d.ts.map +1 -1
  83. package/dist/features/blocks/inputs/payment/components/StripePaymentForm.d.ts +1 -1
  84. package/dist/features/blocks/inputs/payment/components/StripePaymentForm.d.ts.map +1 -1
  85. package/dist/features/blocks/inputs/payment/{helpers → utils}/paymentInProgressStorage.d.ts +2 -2
  86. package/dist/features/blocks/inputs/payment/utils/paymentInProgressStorage.d.ts.map +1 -0
  87. package/dist/features/blocks/inputs/phone/components/PhoneInput.d.ts +3 -1
  88. package/dist/features/blocks/inputs/phone/components/PhoneInput.d.ts.map +1 -1
  89. package/dist/features/blocks/inputs/rating/components/RatingForm.d.ts +1 -1
  90. package/dist/features/blocks/inputs/rating/components/RatingForm.d.ts.map +1 -1
  91. package/dist/features/blocks/inputs/{textInput → text}/components/TextInput.d.ts +3 -1
  92. package/dist/features/blocks/inputs/text/components/TextInput.d.ts.map +1 -0
  93. package/dist/features/blocks/inputs/{textInput → text}/components/VoiceRecorder.d.ts +2 -2
  94. package/dist/features/blocks/inputs/text/components/VoiceRecorder.d.ts.map +1 -0
  95. package/dist/features/blocks/inputs/text/components/VolumeProcessor.d.ts.map +1 -0
  96. package/dist/features/blocks/inputs/text/index.d.ts.map +1 -0
  97. package/dist/features/blocks/inputs/url/components/UrlInput.d.ts +3 -1
  98. package/dist/features/blocks/inputs/url/components/UrlInput.d.ts.map +1 -1
  99. package/dist/features/blocks/integrations/chatwoot/utils/executeChatwoot.d.ts +1 -1
  100. package/dist/features/blocks/integrations/chatwoot/utils/executeChatwoot.d.ts.map +1 -1
  101. package/dist/features/blocks/integrations/pixel/executePixel.d.ts +1 -1
  102. package/dist/features/blocks/integrations/pixel/executePixel.d.ts.map +1 -1
  103. package/dist/features/blocks/integrations/webhook/executeWebhook.d.ts +1 -1
  104. package/dist/features/blocks/integrations/webhook/executeWebhook.d.ts.map +1 -1
  105. package/dist/features/blocks/logic/redirect/utils/executeRedirect.d.ts +1 -1
  106. package/dist/features/blocks/logic/redirect/utils/executeRedirect.d.ts.map +1 -1
  107. package/dist/features/blocks/logic/script/executeScript.d.ts +1 -1
  108. package/dist/features/blocks/logic/script/executeScript.d.ts.map +1 -1
  109. package/dist/features/blocks/logic/variable/executeVariable.d.ts +6 -0
  110. package/dist/features/blocks/logic/variable/executeVariable.d.ts.map +1 -0
  111. package/dist/features/bubble/components/Bubble.d.ts +1 -0
  112. package/dist/features/bubble/components/Bubble.d.ts.map +1 -1
  113. package/dist/features/bubble/components/BubbleButton.d.ts.map +1 -1
  114. package/dist/features/bubble/components/{PreviewMessage.d.ts → BubbleMessage.d.ts} +2 -2
  115. package/dist/features/bubble/components/BubbleMessage.d.ts.map +1 -0
  116. package/dist/features/commands/types.d.ts +1 -1
  117. package/dist/features/commands/types.d.ts.map +1 -1
  118. package/dist/features/popup/components/Popup.d.ts +1 -0
  119. package/dist/features/popup/components/Popup.d.ts.map +1 -1
  120. package/dist/features/standard/components/Standard.d.ts +1 -0
  121. package/dist/features/standard/components/Standard.d.ts.map +1 -1
  122. package/dist/features/streaming/streamChat.d.ts.map +1 -0
  123. package/dist/hooks/useMessageListener.d.ts +11 -0
  124. package/dist/hooks/useMessageListener.d.ts.map +1 -0
  125. package/dist/index.d.ts +1 -0
  126. package/dist/index.d.ts.map +1 -1
  127. package/dist/index.js +26 -1
  128. package/dist/lib/gtm.d.ts +0 -1
  129. package/dist/lib/gtm.d.ts.map +1 -1
  130. package/dist/lib/pixel.d.ts +1 -1
  131. package/dist/lib/pixel.d.ts.map +1 -1
  132. package/dist/queries/continueChatQuery.d.ts +97 -223
  133. package/dist/queries/continueChatQuery.d.ts.map +1 -1
  134. package/dist/queries/saveClientLogsQuery.d.ts +1 -1
  135. package/dist/queries/saveClientLogsQuery.d.ts.map +1 -1
  136. package/dist/queries/startChatQuery.d.ts +193 -308
  137. package/dist/queries/startChatQuery.d.ts.map +1 -1
  138. package/dist/types.d.ts +6 -3
  139. package/dist/types.d.ts.map +1 -1
  140. package/dist/utils/botContainerSignal.d.ts +1 -1
  141. package/dist/utils/botContainerSignal.d.ts.map +1 -1
  142. package/dist/utils/executeClientSideActions.d.ts +1 -1
  143. package/dist/utils/executeClientSideActions.d.ts.map +1 -1
  144. package/dist/utils/guessApiHost.d.ts.map +1 -1
  145. package/dist/utils/injectFont.d.ts +2 -2
  146. package/dist/utils/injectFont.d.ts.map +1 -1
  147. package/dist/utils/injectStartProps.d.ts +1 -1
  148. package/dist/utils/injectStartProps.d.ts.map +1 -1
  149. package/dist/utils/setCssVariablesValue.d.ts +2 -2
  150. package/dist/utils/setCssVariablesValue.d.ts.map +1 -1
  151. package/dist/utils/storage.d.ts +197 -313
  152. package/dist/utils/storage.d.ts.map +1 -1
  153. package/dist/web.d.ts +1 -16
  154. package/dist/web.d.ts.map +1 -1
  155. package/dist/web.js +30 -7
  156. package/dist/window.d.ts +6 -6
  157. package/dist/window.d.ts.map +1 -1
  158. package/package.json +25 -20
  159. package/.turbo/turbo-build.log +0 -11
  160. package/LICENSE +0 -669
  161. package/dist/components/ConversationContainer/AvatarSideContainer.d.ts +0 -8
  162. package/dist/components/ConversationContainer/AvatarSideContainer.d.ts.map +0 -1
  163. package/dist/components/ConversationContainer/ChatChunk.d.ts.map +0 -1
  164. package/dist/components/ConversationContainer/LoadingChunk.d.ts +0 -7
  165. package/dist/components/ConversationContainer/LoadingChunk.d.ts.map +0 -1
  166. package/dist/components/ConversationContainer/PopupBlockedToast.d.ts +0 -7
  167. package/dist/components/ConversationContainer/PopupBlockedToast.d.ts.map +0 -1
  168. package/dist/components/InputChatBlock.d.ts.map +0 -1
  169. package/dist/components/LiteBadge.d.ts +0 -6
  170. package/dist/components/LiteBadge.d.ts.map +0 -1
  171. package/dist/components/ProgressBar.d.ts +0 -6
  172. package/dist/components/ProgressBar.d.ts.map +0 -1
  173. package/dist/components/SendButton.d.ts.map +0 -1
  174. package/dist/components/avatars/DefaultAvatar.d.ts +0 -2
  175. package/dist/components/avatars/DefaultAvatar.d.ts.map +0 -1
  176. package/dist/components/bubbles/LoadingBubble.d.ts +0 -2
  177. package/dist/components/bubbles/LoadingBubble.d.ts.map +0 -1
  178. package/dist/components/bubbles/StreamingBubble.d.ts +0 -8
  179. package/dist/components/bubbles/StreamingBubble.d.ts.map +0 -1
  180. package/dist/components/icons/CameraIcon.d.ts +0 -3
  181. package/dist/components/icons/CameraIcon.d.ts.map +0 -1
  182. package/dist/components/icons/PlusIcon.d.ts +0 -3
  183. package/dist/components/icons/PlusIcon.d.ts.map +0 -1
  184. package/dist/components/icons/TypebotLogo.d.ts +0 -2
  185. package/dist/components/icons/TypebotLogo.d.ts.map +0 -1
  186. package/dist/components/index.d.ts +0 -4
  187. package/dist/components/index.d.ts.map +0 -1
  188. package/dist/components/inputs/SearchInput.d.ts.map +0 -1
  189. package/dist/components/inputs/ShortTextInput.d.ts.map +0 -1
  190. package/dist/components/inputs/index.d.ts +0 -3
  191. package/dist/components/inputs/index.d.ts.map +0 -1
  192. package/dist/features/blocks/bubbles/embed/components/CustomEmbedBubble.d.ts +0 -11
  193. package/dist/features/blocks/bubbles/embed/components/CustomEmbedBubble.d.ts.map +0 -1
  194. package/dist/features/blocks/bubbles/textBubble/helpers/convertRichTextToPlainText.d.ts +0 -3
  195. package/dist/features/blocks/bubbles/textBubble/helpers/convertRichTextToPlainText.d.ts.map +0 -1
  196. package/dist/features/blocks/inputs/buttons/components/Checkbox.d.ts +0 -7
  197. package/dist/features/blocks/inputs/buttons/components/Checkbox.d.ts.map +0 -1
  198. package/dist/features/blocks/inputs/buttons/components/MultipleChoicesForm.d.ts +0 -10
  199. package/dist/features/blocks/inputs/buttons/components/MultipleChoicesForm.d.ts.map +0 -1
  200. package/dist/features/blocks/inputs/fileUpload/components/SelectedFile.d.ts.map +0 -1
  201. package/dist/features/blocks/inputs/fileUpload/helpers/sanitizeSelectedFiles.d.ts.map +0 -1
  202. package/dist/features/blocks/inputs/fileUpload/helpers/uploadFiles.d.ts.map +0 -1
  203. package/dist/features/blocks/inputs/number/numberInputHelper.d.ts.map +0 -1
  204. package/dist/features/blocks/inputs/payment/helpers/paymentInProgressStorage.d.ts.map +0 -1
  205. package/dist/features/blocks/inputs/pictureChoice/MultiplePictureChoice.d.ts +0 -11
  206. package/dist/features/blocks/inputs/pictureChoice/MultiplePictureChoice.d.ts.map +0 -1
  207. package/dist/features/blocks/inputs/pictureChoice/SinglePictureChoice.d.ts +0 -11
  208. package/dist/features/blocks/inputs/pictureChoice/SinglePictureChoice.d.ts.map +0 -1
  209. package/dist/features/blocks/inputs/textInput/components/TextInput.d.ts.map +0 -1
  210. package/dist/features/blocks/inputs/textInput/components/VoiceRecorder.d.ts.map +0 -1
  211. package/dist/features/blocks/inputs/textInput/components/VolumeProcessor.d.ts.map +0 -1
  212. package/dist/features/blocks/inputs/textInput/index.d.ts.map +0 -1
  213. package/dist/features/blocks/integrations/googleAnalytics/index.d.ts +0 -2
  214. package/dist/features/blocks/integrations/googleAnalytics/index.d.ts.map +0 -1
  215. package/dist/features/blocks/integrations/googleAnalytics/utils/executeGoogleAnalytics.d.ts +0 -3
  216. package/dist/features/blocks/integrations/googleAnalytics/utils/executeGoogleAnalytics.d.ts.map +0 -1
  217. package/dist/features/blocks/integrations/googleAnalytics/utils/index.d.ts +0 -2
  218. package/dist/features/blocks/integrations/googleAnalytics/utils/index.d.ts.map +0 -1
  219. package/dist/features/blocks/integrations/openai/streamChat.d.ts.map +0 -1
  220. package/dist/features/blocks/logic/setVariable/executeSetVariable.d.ts +0 -6
  221. package/dist/features/blocks/logic/setVariable/executeSetVariable.d.ts.map +0 -1
  222. package/dist/features/bubble/components/PreviewMessage.d.ts.map +0 -1
  223. package/dist/lib/gtag.d.ts +0 -4
  224. package/dist/lib/gtag.d.ts.map +0 -1
  225. /package/dist/features/blocks/inputs/fileUpload/{helpers → utils}/uploadFiles.d.ts +0 -0
  226. /package/dist/features/blocks/inputs/number/{numberInputHelper.d.ts → utils/numberInputHelper.d.ts} +0 -0
  227. /package/dist/features/blocks/inputs/{textInput → text}/components/VolumeProcessor.d.ts +0 -0
  228. /package/dist/features/blocks/inputs/{textInput → text}/index.d.ts +0 -0
  229. /package/dist/features/{blocks/integrations/openai → streaming}/streamChat.d.ts +0 -0
package/dist/web.js CHANGED
@@ -1,14 +1,37 @@
1
1
  // v0.0.11
2
- function e(e){return Object.keys(e).reduce(((t,n)=>{const r=e[n];var i;return t[n]=Object.assign({},r),o(r.value)&&(i=r.value,"[object Function]"!==Object.prototype.toString.call(i))&&!Array.isArray(r.value)&&(t[n].value=Object.assign({},r.value)),Array.isArray(r.value)&&(t[n].value=r.value.slice(0)),t}),{})}function t(e){if(e)try{return JSON.parse(e)}catch(t){return e}}function n(e,t,n,o){if(null==n||!1===n)return e.removeAttribute(t);let r=o?JSON.stringify(n):n;e.__updating[t]=!0,"true"===r&&(r=""),e.setAttribute(t,r),Promise.resolve().then((()=>delete e.__updating[t]))}function o(e){return null!=e&&("object"==typeof e||"function"==typeof e)}let r;function i(o,i){const a=Object.keys(i);return class extends o{static get observedAttributes(){return a.map((e=>i[e].attribute))}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=function(o,r){const i=e(r);return Object.keys(r).forEach((e=>{const r=i[e],a=o.getAttribute(r.attribute),s=o[e];null!=a&&(r.value=r.parse?t(a):a),null!=s&&(r.value=Array.isArray(s)?s.slice(0):s),r.reflect&&n(o,r.attribute,r.value,!!r.parse),Object.defineProperty(o,e,{get:()=>r.value,set(t){const o=r.value;r.value=t,r.reflect&&n(this,r.attribute,r.value,!!r.parse);for(let n=0,r=this.__propertyChangedCallbacks.length;n<r;n++)this.__propertyChangedCallbacks[n](e,t,o)},enumerable:!0,configurable:!0})})),i}(this,i);const o=function(e){return Object.keys(e).reduce(((t,n)=>(t[n]=e[n].value,t)),{})}(this.props),a=this.Component,s=r;try{r=this,this.__initialized=!0,"function"==typeof(l=a)&&0===l.toString().indexOf("class")?new a(o,{element:this}):a(o,{element:this})}finally{r=s}var l}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let e=null;for(;e=this.__releaseCallbacks.pop();)e(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(e,n,o){if(this.__initialized&&!this.__updating[e]&&(e=this.lookupProp(e))in i){if(null==o&&!this[e])return;this[e]=i[e].parse?t(o):o}}lookupProp(e){if(i)return a.find((t=>e===t||e===i[t].attribute))}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(e){this.__releaseCallbacks.push(e)}addPropertyChangedCallback(e){this.__propertyChangedCallbacks.push(e)}}}function a(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:a,customElements:s=window.customElements}=n;return n=>{if(!e)throw new Error("tag is required to register a Component");let l=s.get(e);return l?(l.prototype.Component=n,l):(l=i(r,function(e){return e?Object.keys(e).reduce(((t,n)=>{const r=e[n];return t[n]=o(r)&&"value"in r?r:{value:r},t[n].attribute||(t[n].attribute=n.replace(/\.?([A-Z]+)/g,((e,t)=>"-"+t.toLowerCase())).replace("_","-").replace(/^-/,"")),t[n].parse="parse"in t[n]?t[n].parse:"string"!=typeof t[n].value,t}),{}):{}}(t)),l.prototype.Component=n,l.prototype.registeredTag=e,s.define(e,l,a),l)}}const s={context:void 0,registry:void 0},l=Symbol("solid-proxy"),c=Symbol("solid-track"),d=Symbol("solid-dev-component"),u={equals:(e,t)=>e===t};let p=F;const g=1,h=2,f={owned:null,cleanups:null,context:null,owner:null};var m=null;let b=null,y=null,v=null,w=null,x=0;function k(e,t){const n=y,o=m,r=0===e.length,i=r?f:{owned:null,cleanups:null,context:null,owner:void 0===t?o:t},a=r?e:()=>e((()=>C((()=>V(i)))));m=i,y=null;try{return B(a,!0)}finally{y=n,m=o}}function _(e,t){const n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},u,t):u).equals||void 0};return[N.bind(n),e=>("function"==typeof e&&(e=e(n.value)),L(n,e))]}function T(e,t,n){D(M(e,t,!1,g))}function S(e,t,n){p=j;const o=M(e,t,!1,g);n&&n.render||(o.user=!0),w?w.push(o):D(o)}function E(e,t,n){n=n?Object.assign({},u,n):u;const o=M(e,t,!0,0);return o.observers=null,o.observerSlots=null,o.comparator=n.equals||void 0,D(o),N.bind(o)}function C(e){if(null===y)return e();const t=y;y=null;try{return e()}finally{y=t}}function P(e){S((()=>C(e)))}function I(e){return null===m||(null===m.cleanups?m.cleanups=[e]:m.cleanups.push(e)),e}function O(){return y}function A(){return m}function $(e){let t;return void 0!==(t=W(m,e.id))?t:e.defaultValue}function R(e){const t=E(e),n=E((()=>q(t())));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function N(){if(this.sources&&this.state)if(this.state===g)D(this);else{const e=v;v=null,B((()=>z(this)),!1),v=e}if(y){const e=this.observers?this.observers.length:0;y.sources?(y.sources.push(this),y.sourceSlots.push(e)):(y.sources=[this],y.sourceSlots=[e]),this.observers?(this.observers.push(y),this.observerSlots.push(y.sources.length-1)):(this.observers=[y],this.observerSlots=[y.sources.length-1])}return this.value}function L(e,t,n){let o=e.value;return e.comparator&&e.comparator(o,t)||(e.value=t,e.observers&&e.observers.length&&B((()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],o=b&&b.running;o&&b.disposed.has(n),(o?n.tState:n.state)||(n.pure?v.push(n):w.push(n),n.observers&&H(n)),o||(n.state=g)}if(v.length>1e6)throw v=[],new Error}),!1)),t}function D(e){if(!e.fn)return;V(e);const t=m,n=y,o=x;y=m=e,function(e,t,n){let o;try{o=e.fn(t)}catch(t){return e.pure&&(e.state=g,e.owned&&e.owned.forEach(V),e.owned=null),e.updatedAt=n+1,G(t)}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?L(e,o):e.value=o,e.updatedAt=n)}(e,e.value,o),y=n,m=t}function M(e,t,n,o=g,r){const i={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:null,pure:n};return null===m||m!==f&&(m.owned?m.owned.push(i):m.owned=[i]),i}function U(e){if(0===e.state)return;if(e.state===h)return z(e);if(e.suspense&&C(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<x);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if((e=t[n]).state===g)D(e);else if(e.state===h){const n=v;v=null,B((()=>z(e,t[0])),!1),v=n}}function B(e,t){if(v)return e();let n=!1;t||(v=[]),w?n=!0:w=[],x++;try{const t=e();return function(e){v&&(F(v),v=null);if(e)return;const t=w;w=null,t.length&&B((()=>p(t)),!1)}(n),t}catch(e){n||(w=null),v=null,G(e)}}function F(e){for(let t=0;t<e.length;t++)U(e[t])}function j(e){let t,n=0;for(t=0;t<e.length;t++){const o=e[t];o.user?e[n++]=o:U(o)}for(t=0;t<n;t++)U(e[t])}function z(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const o=e.sources[n];if(o.sources){const e=o.state;e===g?o!==t&&(!o.updatedAt||o.updatedAt<x)&&U(o):e===h&&z(o,t)}}}function H(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=h,n.pure?v.push(n):w.push(n),n.observers&&H(n))}}function V(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),o=t.observers;if(o&&o.length){const e=o.pop(),r=t.observerSlots.pop();n<o.length&&(e.sourceSlots[r]=n,o[n]=e,t.observerSlots[n]=r)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)V(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function G(e,t=m){const n=function(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}(e);throw n}function W(e,t){return e?e.context&&void 0!==e.context[t]?e.context[t]:W(e.owner,t):void 0}function q(e){if("function"==typeof e&&!e.length)return q(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const o=q(e[n]);Array.isArray(o)?t.push.apply(t,o):t.push(o)}return t}return e}function K(e,t){return function(t){let n;return T((()=>n=C((()=>(m.context={[e]:t.value},R((()=>t.children)))))),void 0),n}}const Y=Symbol("fallback");function X(e){for(let t=0;t<e.length;t++)e[t]()}function Z(e,t){return C((()=>e(t||{})))}function J(){return!0}const Q={get:(e,t,n)=>t===l?n:e.get(t),has:(e,t)=>t===l||e.has(t),set:J,deleteProperty:J,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:J,deleteProperty:J}),ownKeys:e=>e.keys()};function ee(e){return(e="function"==typeof e?e():e)?e:{}}function te(){for(let e=0,t=this.length;e<t;++e){const t=this[e]();if(void 0!==t)return t}}function ne(...e){let t=!1;for(let n=0;n<e.length;n++){const o=e[n];t=t||!!o&&l in o,e[n]="function"==typeof o?(t=!0,E(o)):o}if(t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const o=ee(e[n])[t];if(void 0!==o)return o}},has(t){for(let n=e.length-1;n>=0;n--)if(t in ee(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(ee(e[n])));return[...new Set(t)]}},Q);const n={},o={},r=new Set;for(let t=e.length-1;t>=0;t--){const i=e[t];if(!i)continue;const a=Object.getOwnPropertyNames(i);for(let e=0,t=a.length;e<t;e++){const t=a[e];if("__proto__"===t||"constructor"===t)continue;const s=Object.getOwnPropertyDescriptor(i,t);if(r.has(t)){const e=o[t];e?s.get?e.push(s.get.bind(i)):void 0!==s.value&&e.push((()=>s.value)):void 0===n[t]&&(n[t]=s.value)}else s.get?(r.add(t),Object.defineProperty(n,t,{enumerable:!0,configurable:!0,get:te.bind(o[t]=[s.get.bind(i)])})):(void 0!==s.value&&r.add(t),n[t]=s.value)}}return n}function oe(e,...t){if(l in e){const n=new Set(t.length>1?t.flat():t[0]),o=t.map((t=>new Proxy({get:n=>t.includes(n)?e[n]:void 0,has:n=>t.includes(n)&&n in e,keys:()=>t.filter((t=>t in e))},Q)));return o.push(new Proxy({get:t=>n.has(t)?void 0:e[t],has:t=>!n.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!n.has(e)))},Q)),o}const n={},o=t.map((()=>({})));for(const r of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,r),a=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let s=!1,l=0;for(const e of t)e.includes(r)&&(s=!0,a?o[l][r]=i.value:Object.defineProperty(o[l],r,i)),++l;s||(a?n[r]=i.value:Object.defineProperty(n,r,i))}return[...o,n]}let re=0;function ie(){const e=s.context;return e?`${e.id}${e.count++}`:"cl-"+re++}const ae=e=>`Stale read from <${e}>.`;function se(e){const t="fallback"in e&&{fallback:()=>e.fallback};return E(function(e,t,n={}){let o=[],r=[],i=[],a=0,s=t.length>1?[]:null;return I((()=>X(i))),()=>{let l,d,u=e()||[];return u[c],C((()=>{let e,t,c,g,h,f,m,b,y,v=u.length;if(0===v)0!==a&&(X(i),i=[],o=[],r=[],a=0,s&&(s=[])),n.fallback&&(o=[Y],r[0]=k((e=>(i[0]=e,n.fallback()))),a=1);else if(0===a){for(r=new Array(v),d=0;d<v;d++)o[d]=u[d],r[d]=k(p);a=v}else{for(c=new Array(v),g=new Array(v),s&&(h=new Array(v)),f=0,m=Math.min(a,v);f<m&&o[f]===u[f];f++);for(m=a-1,b=v-1;m>=f&&b>=f&&o[m]===u[b];m--,b--)c[b]=r[m],g[b]=i[m],s&&(h[b]=s[m]);for(e=new Map,t=new Array(b+1),d=b;d>=f;d--)y=u[d],l=e.get(y),t[d]=void 0===l?-1:l,e.set(y,d);for(l=f;l<=m;l++)y=o[l],d=e.get(y),void 0!==d&&-1!==d?(c[d]=r[l],g[d]=i[l],s&&(h[d]=s[l]),d=t[d],e.set(y,d)):i[l]();for(d=f;d<v;d++)d in c?(r[d]=c[d],i[d]=g[d],s&&(s[d]=h[d],s[d](d))):r[d]=k(p);r=r.slice(0,a=v),o=u.slice(0)}return r}));function p(e){if(i[d]=e,s){const[e,n]=_(d);return s[d]=n,t(u[d],e)}return t(u[d])}}}((()=>e.each),e.children,t||void 0))}function le(e){const t=e.keyed,n=E((()=>e.when),void 0,{equals:(e,n)=>t?e===n:!e==!n});return E((()=>{const o=n();if(o){const r=e.children;return"function"==typeof r&&r.length>0?C((()=>r(t?o:()=>{if(!C(n))throw ae("Show");return e.when}))):r}return e.fallback}),void 0,void 0)}function ce(e){let t=!1;const n=R((()=>e.children)),o=E((()=>{let e=n();Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++){const o=e[n].when;if(o)return t=!!e[n].keyed,[n,o,e[n]]}return[-1]}),void 0,{equals:(e,n)=>e[0]===n[0]&&(t?e[1]===n[1]:!e[1]==!n[1])&&e[2]===n[2]});return E((()=>{const[n,r,i]=o();if(n<0)return e.fallback;const a=i.children;return"function"==typeof a&&a.length>0?C((()=>a(t?r:()=>{if(C(o)[0]!==n)throw ae("Match");return i.when}))):a}),void 0,void 0)}function de(e){return e}const ue=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),pe=new Set(["innerHTML","textContent","innerText","children"]),ge=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),he=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});const fe=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),me=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),be={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};const ye="_$DX_DELEGATE";function ve(e,t,n){let o;const r=()=>{const t=document.createElement("template");return t.innerHTML=e,n?t.content.firstChild.firstChild:t.content.firstChild},i=t?()=>C((()=>document.importNode(o||(o=r()),!0))):()=>(o||(o=r())).cloneNode(!0);return i.cloneNode=i,i}function we(e,t=window.document){const n=t[ye]||(t[ye]=new Set);for(let o=0,r=e.length;o<r;o++){const r=e[o];n.has(r)||(n.add(r),t.addEventListener(r,Pe))}}function xe(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function ke(e,t){null==t?e.removeAttribute("class"):e.className=t}function _e(e,t={},n,o){const r={};return o||T((()=>r.children=Ie(e,t.children,r.children))),T((()=>t.ref&&t.ref(e))),T((()=>function(e,t,n,o,r={},i=!1){t||(t={});for(const o in r)if(!(o in t)){if("children"===o)continue;r[o]=Ce(e,o,null,r[o],n,i)}for(const a in t){if("children"===a){o||Ie(e,t.children);continue}const s=t[a];r[a]=Ce(e,a,s,r[a],n,i)}}(e,t,n,!0,r,!0))),r}function Te(e,t,n){return C((()=>e(t,n)))}function Se(e,t,n,o){if(void 0===n||o||(o=[]),"function"!=typeof t)return Ie(e,t,o,n);T((o=>Ie(e,t(),o,n)),o)}function Ee(e,t,n){const o=t.trim().split(/\s+/);for(let t=0,r=o.length;t<r;t++)e.classList.toggle(o[t],n)}function Ce(e,t,n,o,r,i){let a,s,l,c,d;if("style"===t)return function(e,t,n){if(!t)return n?xe(e,"style"):t;const o=e.style;if("string"==typeof t)return o.cssText=t;let r,i;for(i in"string"==typeof n&&(o.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&o.removeProperty(i),delete n[i];for(i in t)r=t[i],r!==n[i]&&(o.setProperty(i,r),n[i]=r);return n}(e,n,o);if("classList"===t)return function(e,t,n={}){const o=Object.keys(t||{}),r=Object.keys(n);let i,a;for(i=0,a=r.length;i<a;i++){const o=r[i];o&&"undefined"!==o&&!t[o]&&(Ee(e,o,!1),delete n[o])}for(i=0,a=o.length;i<a;i++){const r=o[i],a=!!t[r];r&&"undefined"!==r&&n[r]!==a&&a&&(Ee(e,r,!0),n[r]=a)}return n}(e,n,o);if(n===o)return o;if("ref"===t)i||n(e);else if("on:"===t.slice(0,3)){const r=t.slice(3);o&&e.removeEventListener(r,o),n&&e.addEventListener(r,n)}else if("oncapture:"===t.slice(0,10)){const r=t.slice(10);o&&e.removeEventListener(r,o,!0),n&&e.addEventListener(r,n,!0)}else if("on"===t.slice(0,2)){const r=t.slice(2).toLowerCase(),i=fe.has(r);if(!i&&o){const t=Array.isArray(o)?o[0]:o;e.removeEventListener(r,t)}(i||n)&&(!function(e,t,n,o){if(o)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=t=>o.call(e,n[1],t))}else e.addEventListener(t,n)}(e,r,n,i),i&&we([r]))}else if("attr:"===t.slice(0,5))xe(e,t.slice(5),n);else if((d="prop:"===t.slice(0,5))||(l=pe.has(t))||!r&&((c=function(e,t){const n=he[e];return"object"==typeof n?n[t]?n.$:void 0:n}(t,e.tagName))||(s=ue.has(t)))||(a=e.nodeName.includes("-")))d&&(t=t.slice(5),s=!0),"class"===t||"className"===t?ke(e,n):!a||s||l?e[c||t]=n:e[(u=t,u.toLowerCase().replace(/-([a-z])/g,((e,t)=>t.toUpperCase())))]=n;else{const o=r&&t.indexOf(":")>-1&&be[t.split(":")[0]];o?function(e,t,n,o){null==o?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,o)}(e,o,t,n):xe(e,ge[t]||t,n)}var u;return n}function Pe(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>n||document});n;){const o=n[t];if(o&&!n.disabled){const r=n[`${t}Data`];if(void 0!==r?o.call(n,r,e):o.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Ie(e,t,n,o,r){for(;"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,a=void 0!==o;if(e=a&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i)if("number"===i&&(t=t.toString()),a){let r=n[0];r&&3===r.nodeType?r.data=t:r=document.createTextNode(t),n=$e(e,n,o,r)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t;else if(null==t||"boolean"===i)n=$e(e,n,o);else{if("function"===i)return T((()=>{let r=t();for(;"function"==typeof r;)r=r();n=Ie(e,r,n,o)})),()=>n;if(Array.isArray(t)){const i=[],s=n&&Array.isArray(n);if(Oe(i,t,n,r))return T((()=>n=Ie(e,i,n,o,!0))),()=>n;if(0===i.length){if(n=$e(e,n,o),a)return n}else s?0===n.length?Ae(e,i,o):function(e,t,n){let o=n.length,r=t.length,i=o,a=0,s=0,l=t[r-1].nextSibling,c=null;for(;a<r||s<i;)if(t[a]!==n[s]){for(;t[r-1]===n[i-1];)r--,i--;if(r===a){const t=i<o?s?n[s-1].nextSibling:n[i-s]:l;for(;s<i;)e.insertBefore(n[s++],t)}else if(i===s)for(;a<r;)c&&c.has(t[a])||t[a].remove(),a++;else if(t[a]===n[i-1]&&n[s]===t[r-1]){const o=t[--r].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--i],o),t[r]=n[i]}else{if(!c){c=new Map;let e=s;for(;e<i;)c.set(n[e],e++)}const o=c.get(t[a]);if(null!=o)if(s<o&&o<i){let l,d=a,u=1;for(;++d<r&&d<i&&null!=(l=c.get(t[d]))&&l===o+u;)u++;if(u>o-s){const r=t[a];for(;s<o;)e.insertBefore(n[s++],r)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}else a++,s++}(e,n,i):(n&&$e(e),Ae(e,i));n=i}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=$e(e,n,o,t);$e(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}else console.warn("Unrecognized value. Skipped inserting",t)}return n}function Oe(e,t,n,o){let r=!1;for(let i=0,a=t.length;i<a;i++){let a,s=t[i],l=n&&n[i];if(null==s||!0===s||!1===s);else if("object"==(a=typeof s)&&s.nodeType)e.push(s);else if(Array.isArray(s))r=Oe(e,s,l)||r;else if("function"===a)if(o){for(;"function"==typeof s;)s=s();r=Oe(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||r}else e.push(s),r=!0;else{const t=String(s);l&&3===l.nodeType&&l.data===t?e.push(l):e.push(document.createTextNode(t))}}return r}function Ae(e,t,n=null){for(let o=0,r=t.length;o<r;o++)e.insertBefore(t[o],n)}function $e(e,t,n,o){if(void 0===n)return e.textContent="";const r=o||document.createTextNode("");if(t.length){let o=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(r!==a){const t=a.parentNode===e;o||i?t&&a.remove():t?e.replaceChild(r,a):e.insertBefore(r,n)}else o=!0}}else e.insertBefore(r,n);return[r]}function Re(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function Ne(e){const{useShadow:t}=e,n=document.createTextNode(""),o=A();let r;return S((()=>{r||(r=function(e,t){const n=m,o=y;m=e,y=null;try{return B(t,!0)}catch(e){G(e)}finally{m=n,y=o}}(o,(()=>E((()=>e.children)))));const i=e.mount||document.body;if(i instanceof HTMLHeadElement){const[e,t]=_(!1),n=()=>t(!0);k((t=>Se(i,(()=>e()?t():r()),null))),I(n)}else{const o=Re(e.isSVG?"g":"div",e.isSVG),a=t&&o.attachShadow?o.attachShadow({mode:"open"}):o;Object.defineProperty(o,"_$host",{get:()=>n.parentNode,configurable:!0}),Se(a,r),i.appendChild(o),e.ref&&e.ref(o),I((()=>i.removeChild(o)))}}),void 0,{render:!!!s.context}),n}function Le(e){const[t,n]=oe(e,["component"]),o=E((()=>t.component));return E((()=>{const e=o();switch(typeof e){case"function":return Object.assign(e,{[d]:!0}),C((()=>e(n)));case"string":const t=me.has(e),o=Re(e,t);return _e(o,n,t),o}}))}function De(e){return(t,n)=>{const{element:o}=n;return k((r=>{const i=function(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const[r,i]=_(e[t[o]]);Object.defineProperty(n,t[o],{get:r,set(e){i((()=>e))}})}return n}(t);o.addPropertyChangedCallback(((e,t)=>i[e]=t)),o.addReleaseCallback((()=>{o.renderRoot.textContent="",r()}));const a=e(i,n);return Se(o.renderRoot,a)}),function(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&(!t.assignedSlot||!t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}(o))}}function Me(e,t,n){return 2===arguments.length&&(n=t,t={}),a(e,t)(De(n))}const Ue={typebot:void 0,onNewInputBlock:void 0,onAnswer:void 0,onEnd:void 0,onInit:void 0,onNewLogs:void 0,isPreview:void 0,startFrom:void 0,prefilledVariables:void 0,apiHost:void 0,resultId:void 0,sessionId:void 0},Be={...Ue,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},Fe={...Ue,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,autoShowDelay:void 0};var je='/*! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-right-2{right:-8px}.-top-2{top:-8px}.bottom-5{bottom:20px}.left-0{left:0}.left-5{left:20px}.right-0{right:0}.right-2{right:8px}.right-5{right:20px}.top-0{top:0}.top-2{top:8px}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.m-2{margin:8px}.m-auto{margin:auto}.mx-4{margin-left:16px;margin-right:16px}.my-2{margin-bottom:8px;margin-top:8px}.-mr-1{margin-right:-4px}.-mt-1{margin-top:-4px}.ml-2{margin-left:8px}.mt-1{margin-top:4px}.mt-4{margin-top:16px}.\\!block{display:block!important}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-10{height:40px}.h-2{height:8px}.h-2\\.5{height:10px}.h-3{height:12px}.h-4{height:16px}.h-5{height:20px}.h-6{height:24px}.h-8{height:32px}.h-9{height:36px}.h-\\[56px\\]{height:56px}.h-\\[58px\\]{height:58px}.h-\\[80vh\\]{height:80vh}.h-full{height:100%}.h-screen{height:100vh}.max-h-80{max-height:320px}.max-h-\\[464px\\]{max-height:464px}.min-h-full{min-height:100%}.w-10{width:40px}.w-2{width:8px}.w-3{width:12px}.w-4{width:16px}.w-5{width:20px}.w-6{width:24px}.w-8{width:32px}.w-\\[35px\\]{width:35px}.w-\\[58px\\]{width:58px}.w-\\[60\\%\\]{width:60%}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\\[250px\\]{min-width:250px}.max-w-\\[256px\\]{max-width:256px}.max-w-\\[350px\\]{max-width:350px}.max-w-\\[90\\%\\]{max-width:90%}.max-w-full{max-width:100%}.max-w-lg{max-width:512px}.max-w-xs{max-width:320px}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink-0{flex-shrink:0}.-rotate-180{--tw-rotate:-180deg}.-rotate-180,.rotate-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate:0deg}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.scale-0,.scale-100{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in .3s ease-out}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-6{gap:24px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.scroll-smooth{scroll-behavior:smooth}.text-ellipsis{text-overflow:ellipsis}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:6px}.border{border-width:1px}.border-2{border-width:2px}.border-dashed{border-style:dashed}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}.bg-\\[rgba\\(0\\2c 0\\2c 0\\2c 0\\.5\\)\\]{background-color:rgba(0,0,0,.5)}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-black\\/20{background-color:rgba(0,0,0,.2)}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(96 165 250/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-green-400{--tw-bg-opacity:1;background-color:rgb(74 222 128/var(--tw-bg-opacity))}.bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity))}.bg-pink-400{--tw-bg-opacity:1;background-color:rgb(244 114 182/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:0.5}.fill-transparent{fill:transparent}.stroke-2{stroke-width:2}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.p-\\[1px\\]{padding:1px}.px-2{padding-left:8px;padding-right:8px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-8{padding-left:32px;padding-right:32px}.px-\\[15px\\]{padding-left:15px;padding-right:15px}.py-1{padding-bottom:4px;padding-top:4px}.py-2{padding-bottom:8px;padding-top:8px}.py-4{padding-bottom:16px;padding-top:16px}.py-6{padding-bottom:24px;padding-top:24px}.py-\\[7px\\]{padding-bottom:7px;padding-top:7px}.pb-0{padding-bottom:0}.pl-2{padding-left:8px}.pl-4{padding-left:16px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pr-4{padding-right:16px}.pt-10{padding-top:40px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-2xl{font-size:24px;line-height:32px}.text-4xl{font-size:36px;line-height:40px}.text-base{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.text-xs{font-size:12px;line-height:16px}.font-bold{font-weight:700}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.blur{--tw-blur:blur(8px)}.blur,.brightness-150{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-150{--tw-brightness:brightness(1.5)}.brightness-200{--tw-brightness:brightness(2)}.brightness-200,.brightness-95{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-95{--tw-brightness:brightness(.95)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.scrollable-container::-webkit-scrollbar{display:none}.scrollable-container{-ms-overflow-style:none;scrollbar-width:none}.text-fade-in{transition:opacity .4s ease-in .2s}.bubble-typing{transition:width .4s ease-out,height .4s ease-out}.bubble1,.bubble2,.bubble3{background-color:var(--typebot-host-bubble-color);opacity:.5}.bubble1,.bubble2{animation:chatBubbles 1s ease-in-out infinite}.bubble2{animation-delay:.3s}.bubble3{animation:chatBubbles 1s ease-in-out infinite;animation-delay:.5s}@keyframes chatBubbles{0%{transform:translateY(2.5)}50%{transform:translateY(-2.5px)}to{transform:translateY(0)}}button,input,textarea{font-weight:300}a{text-decoration:underline}ol,ul{margin-inline-end:0;margin-inline-start:0;padding-inline-start:40px}ol{list-style-type:decimal}ul{list-style-type:disc}li:not(:last-child){margin-bottom:8px}pre{word-wrap:break-word;max-height:100%;max-width:100%;overflow:auto;overflow-wrap:break-word;white-space:pre-wrap}.slate-bold{font-weight:700}.slate-italic{font-style:oblique}.slate-underline{text-decoration:underline}.text-input::-moz-placeholder{color:var(--typebot-input-placeholder-color)!important;opacity:1!important}.text-input::placeholder{color:var(--typebot-input-placeholder-color)!important;opacity:1!important}.typebot-container{background-color:var(--typebot-container-bg-color);background-image:var(--typebot-container-bg-image);background-position:50%;background-size:cover;container-type:inline-size;font-family:var(--typebot-container-font-family),-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}.typebot-chat-view{-webkit-backdrop-filter:blur(var(--typebot-chat-container-blur));backdrop-filter:blur(var(--typebot-chat-container-blur));background-color:rgba(var(--typebot-chat-container-bg-rgb),var(--typebot-chat-container-opacity));border-color:rgba(var(--typebot-chat-container-border-rgb),var(--typebot-chat-container-border-opacity));border-width:var(--typebot-chat-container-border-width);box-shadow:var(--typebot-chat-container-box-shadow);color:rgb(var(--typebot-chat-container-color));max-width:var(--typebot-chat-container-max-width);min-height:100%;padding-left:20px;padding-right:20px}@container (min-width: 480px){.typebot-chat-view{border-radius:var(--typebot-chat-container-border-radius);max-height:var(--typebot-chat-container-max-height);min-height:var(--typebot-chat-container-max-height)}}.typebot-button{-webkit-backdrop-filter:blur(var(--typebot-button-blur));backdrop-filter:blur(var(--typebot-button-blur));background-color:rgba(var(--typebot-button-bg-rgb),var(--typebot-button-opacity));border-color:rgba(var(--typebot-button-border-rgb),var(--typebot-button-border-opacity));border-radius:var(--typebot-button-border-radius);border-width:var(--typebot-button-border-width);box-shadow:var(--typebot-button-box-shadow);color:var(--typebot-button-color);transition:all .3s ease}.typebot-selectable{background-color:rgba(var(--typebot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.08));border-color:rgba(var(--typebot-button-border-rgb),calc(var(--selectable-alpha-ratio)*.25));border-radius:var(--typebot-button-border-radius);border-width:var(--typebot-button-border-width);color:rgb(var(--typebot-chat-container-color));transition:all .3s ease}.typebot-selectable:hover{background-color:rgba(var(--typebot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.12));border-color:rgba(var(--typebot-button-border-rgb),calc(var(--selectable-alpha-ratio)*.3))}.typebot-selectable.selected{background-color:rgba(var(--typebot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.18));border-color:rgba(var(--typebot-button-border-rgb),calc(var(--selectable-alpha-ratio)*.35))}.typebot-checkbox{background-color:rgba(var(--typebot-checkbox-bg-rgb));border:1px solid rgba(var(--typebot-button-bg-rgb),var(--typebot-button-opacity));border-radius:var(--typebot-button-border-radius);border-radius:2px;color:var(--typebot-button-color);padding:1px;transition:all .3s ease}.typebot-checkbox.checked{background-color:rgb(var(--typebot-button-bg-rgb))}.typebot-host-bubble{color:var(--typebot-host-bubble-color)}.typebot-host-bubble>.bubble-typing{-webkit-backdrop-filter:blur(var(--typebot-host-bubble-blur));backdrop-filter:blur(var(--typebot-host-bubble-blur));background-color:rgba(var(--typebot-host-bubble-bg-rgb),var(--typebot-host-bubble-opacity));border-color:rgba(var(--typebot-host-bubble-border-rgb),var(--typebot-host-bubble-border-opacity));border-radius:var(--typebot-host-bubble-border-radius);border-width:var(--typebot-host-bubble-border-width);box-shadow:var(--typebot-host-bubble-box-shadow)}.typebot-host-bubble iframe,.typebot-host-bubble img,.typebot-host-bubble video{border-radius:6px}.typebot-guest-bubble{-webkit-backdrop-filter:blur(var(--typebot-guest-bubble-blur));backdrop-filter:blur(var(--typebot-guest-bubble-blur));background-color:rgba(var(--typebot-guest-bubble-bg-rgb),var(--typebot-guest-bubble-opacity));border-color:rgba(var(--typebot-guest-bubble-border-rgb),var(--typebot-guest-bubble-border-opacity));border-width:var(--typebot-guest-bubble-border-width);box-shadow:var(--typebot-guest-bubble-box-shadow);color:var(--typebot-guest-bubble-color)}.typebot-guest-bubble,.typebot-guest-bubble-image-attachment{border-radius:var(--typebot-guest-bubble-border-radius)}.typebot-input{-webkit-backdrop-filter:blur(var(--typebot-input-blur));backdrop-filter:blur(var(--typebot-input-blur));background-color:rgba(var(--typebot-input-bg-rgb),var(--typebot-input-opacity));border-color:rgba(var(--typebot-input-border-rgb),var(--typebot-input-border-opacity));border-radius:var(--typebot-input-border-radius);border-width:var(--typebot-input-border-width);box-shadow:var(--typebot-input-box-shadow);transition:filter .1s ease}.typebot-input,.typebot-input-error-message{color:var(--typebot-input-color)}.typebot-input-form .typebot-button{box-shadow:var(--typebot-input-box-shadow)}.typebot-button>.send-icon{fill:var(--typebot-button-color)}.ping span{background-color:rgb(var(--typebot-button-bg-rgb))}.rating-icon-container svg{stroke:rgb(var(--typebot-button-bg-rgb));fill:var(--typebot-host-bubble-bg-color);height:42px;transition:fill .1s ease-out;width:42px}.rating-icon-container.selected svg{fill:rgb(var(--typebot-button-bg-rgb))}.rating-icon-container:hover svg{filter:brightness(.9)}.rating-icon-container:active svg{filter:brightness(.75)}.upload-progress-bar{border-radius:var(--typebot-input-border-radius)}.total-files-indicator,.upload-progress-bar{background-color:rgb(var(--typebot-button-bg-rgb))}.total-files-indicator{color:var(--typebot-button-color);font-size:10px}.typebot-upload-input{border-radius:var(--typebot-input-border-radius);transition:border-color .1s ease-out}.typebot-upload-input.dragging-over{border-color:rgb(var(--typebot-button-bg-rgb))}.secondary-button{background-color:var(--typebot-host-bubble-bg-color);border-radius:var(--typebot-button-border-radius);color:var(--typebot-host-bubble-color)}.typebot-country-select{border-radius:var(--typebot-button-border-radius);color:var(--typebot-input-color)}.typebot-country-select,.typebot-date-input{background-color:var(--typebot-input-bg-color)}.typebot-date-input{color:var(--typebot-input-color);color-scheme:light}.typebot-date-input,.typebot-popup-blocked-toast{border-radius:var(--typebot-input-border-radius)}.typebot-picture-button{background-color:rgb(var(--typebot-button-bg-rgb));border-radius:var(--typebot-button-border-radius);color:var(--typebot-button-color);transition:all .3s ease;width:236px}.typebot-picture-button>img,.typebot-selectable-picture>img{border-radius:var(--typebot-button-border-radius) var(--typebot-button-border-radius) 0 0;height:100%;max-height:200px;min-width:200px;-o-object-fit:cover;object-fit:cover;width:100%}.typebot-picture-button.has-svg>img,.typebot-selectable-picture.has-svg>img{max-height:128px;-o-object-fit:contain;object-fit:contain;padding:1rem}.typebot-selectable-picture{background-color:rgba(var(--typebot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.08));border:1px solid rgba(var(--typebot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.25));border-radius:var(--typebot-button-border-radius);color:rgb(var(--typebot-chat-container-color));transition:all .3s ease;width:236px}.typebot-selectable-picture:hover{background-color:rgba(var(--typebot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.12));border-color:rgba(var(--typebot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.3))}.typebot-selectable-picture.selected{background-color:rgba(var(--typebot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.18));border-color:rgba(var(--typebot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.35))}select option{background-color:var(--typebot-input-bg-color);color:var(--typebot-input-color)}.typebot-progress-bar-container{background-color:rgba(var(--typebot-progress-bar-bg-rgb),calc(var(--selectable-alpha-ratio)*.12));bottom:var(--typebot-progress-bar-bottom);height:var(--typebot-progress-bar-height);left:0;position:var(--typebot-progress-bar-position);top:var(--typebot-progress-bar-top);width:100%;z-index:42424242}.typebot-progress-bar-container>.typebot-progress-bar{background-color:var(--typebot-progress-bar-color);height:100%;position:absolute;transition:width .25s ease}.typebot-recorder .left-gradient{background-image:linear-gradient(to right,rgba(var(--typebot-input-bg-rgb),1),rgba(var(--typebot-input-bg-rgb),0))}.typebot-recorder .right-gradient{background-image:linear-gradient(to left,rgba(var(--typebot-input-bg-rgb),1),rgba(var(--typebot-input-bg-rgb),0))}.typebot-recorder button{background-color:rgba(var(--typebot-button-bg-rgb),.3);color:rgba(var(--typebot-button-bg-rgb))}@keyframes fadeInFromTop{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOutFromTop{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes fadeInFromBottom{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOutFromBottom{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}[data-scope=menu][data-part=content]{-webkit-backdrop-filter:blur(var(--typebot-input-blur));backdrop-filter:blur(var(--typebot-input-blur));border-color:rgba(var(--typebot-input-border-rgb),var(--typebot-input-border-opacity));border-width:var(--typebot-input-border-width);box-shadow:var(--typebot-input-box-shadow);color:var(--typebot-input-color)}[data-scope=menu][data-part=content],[data-scope=menu][data-part=item]{background-color:rgba(var(--typebot-input-bg-rgb),var(--typebot-input-opacity));border-radius:var(--typebot-input-border-radius)}[data-scope=menu][data-part=item]{cursor:pointer}[data-scope=menu][data-part=content][data-state=open]{animation:fadeInFromTop .15s ease-out forwards}[data-scope=menu][data-part=content][data-state=closed]{animation:fadeOutFromTop 50ms ease-out forwards}[data-scope=toast][data-part=group]{width:100%}[data-scope=toast][data-part=root]{background-color:rgba(var(--typebot-input-bg-rgb),var(--typebot-input-opacity));border-radius:var(--typebot-chat-container-border-radius);box-shadow:var(--typebot-input-box-shadow);color:var(--typebot-input-color);display:flex;flex-direction:column;gap:4px;max-width:60vw;padding:16px 32px 16px 16px}[data-scope=toast][data-part=title]{font-weight:600}[data-scope=toast][data-part=description]{font-size:14px;line-height:20px}[data-scope=toast][data-part=root][data-state=open]{animation:fadeInFromBottom .15s ease-out forwards}[data-scope=toast][data-part=root][data-state=closed]{animation:fadeOutFromBottom 50ms ease-out forwards}[data-scope=progress][data-part=root]{height:100%;width:100%}[data-scope=progress][data-part=circle]{--size:40px;--thickness:4px;--radius:18px;--circomference:113.09724px}[data-scope=progress][data-part=circle-range]{stroke:#fff;--transition-prop:stroke-dasharray,stroke,stroke-dashoffset;--transition-duration:0.2s;transition-duration:.2s;transition-property:stroke-dasharray,stroke,stroke-dashoffset}[data-scope=progress][data-part=circle-track]{stroke:rgba(0,0,0,.5)}.hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:brightness-90:hover{--tw-brightness:brightness(.9)}.hover\\:brightness-90:hover,.hover\\:brightness-95:hover{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-95:hover{--tw-brightness:brightness(.95)}.hover\\:backdrop-brightness-95:hover{--tw-backdrop-brightness:brightness(.95);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.active\\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:brightness-75:active{--tw-brightness:brightness(.75)}.active\\:brightness-75:active,.active\\:brightness-90:active{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.active\\:brightness-90:active{--tw-brightness:brightness(.9)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:brightness-100:disabled{--tw-brightness:brightness(1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:backdrop-brightness-90[data-state=open]{--tw-backdrop-brightness:brightness(.9);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}@media (min-width:640px){.sm\\:right-5{right:20px}.sm\\:my-8{margin-bottom:32px;margin-top:32px}.sm\\:p-0{padding:0}.sm\\:opacity-0{opacity:0}}';const ze=async e=>{let t;try{const n="string"==typeof e?e:e.url;t=await fetch(n,{method:"string"==typeof e?"GET":e.method,mode:"cors",headers:"string"!=typeof e&&He(e.body)?{"Content-Type":"application/json"}:void 0,body:"string"!=typeof e&&He(e.body)?JSON.stringify(e.body):void 0});const o=await t.json();if(!t.ok)throw"error"in o?o.error:o;return{data:o,response:t}}catch(e){return console.error(e),{error:e,response:t}}},He=e=>null!=e,Ve=e=>null==e,Ge=e=>null==e||""===e,We=e=>null!=e&&""!==e,qe=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg"),Ke=e=>{e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((e,t,n,o)=>t+t+n+n+o+o));const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:[0,0,0]},Ye=e=>(([e,t,n])=>(299*e+587*t+114*n)/1e3>155)(Ke(e));function Xe(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Xe(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function Ze(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=Xe(e))&&(o&&(o+=" "),o+=t);return o}const Je=ve('<svg part="button-icon" viewBox="0 0 24 24"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z">'),Qe=ve('<img part="button-icon" alt="Bubble button icon">'),et=ve('<span part="button-icon">'),tt=ve('<svg part="button-icon" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M18.601 8.39897C18.269 8.06702 17.7309 8.06702 17.3989 8.39897L12 13.7979L6.60099 8.39897C6.26904 8.06702 5.73086 8.06702 5.39891 8.39897C5.06696 8.73091 5.06696 9.2691 5.39891 9.60105L11.3989 15.601C11.7309 15.933 12.269 15.933 12.601 15.601L18.601 9.60105C18.9329 9.2691 18.9329 8.73091 18.601 8.39897Z">'),nt=ve('<img part="button-icon" alt="Bubble button close icon">'),ot=ve('<button part="button" aria-label="Open chatbot">'),rt="#0042DA",it="#27272A",at="#fff",st=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),lt=e=>(()=>{const t=ot();return t.$$click=()=>e.toggleBot(),t.style.setProperty("z-index","42424242"),Se(t,Z(le,{get when(){return Ve(e.customIconSrc)},keyed:!0,get children(){const t=Je();return T((n=>{const o=e.iconColor??(Ye(e.backgroundColor??rt)?it:at),r=Ze("stroke-2 fill-transparent absolute duration-200 transition w-[60%]",e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100");return o!==n._v$&&(null!=(n._v$=o)?t.style.setProperty("stroke",o):t.style.removeProperty("stroke")),r!==n._v$2&&xe(t,"class",n._v$2=r),n}),{_v$:void 0,_v$2:void 0}),t}}),null),Se(t,Z(le,{get when(){return E((()=>!!e.customIconSrc))()&&st(e.customIconSrc)},get children(){const t=Qe();return T((n=>{const o=e.customIconSrc,r=Ze("duration-200 transition",e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100",qe(e.customIconSrc)?"w-[60%]":"w-full h-full",qe(e.customIconSrc)?"":"object-cover rounded-full");return o!==n._v$3&&xe(t,"src",n._v$3=o),r!==n._v$4&&ke(t,n._v$4=r),n}),{_v$3:void 0,_v$4:void 0}),t}}),null),Se(t,Z(le,{get when(){return E((()=>!!e.customIconSrc))()&&!st(e.customIconSrc)},get children(){const t=et();return t.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),Se(t,(()=>e.customIconSrc)),T((()=>ke(t,Ze("text-4xl duration-200 transition",e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100")))),t}}),null),Se(t,Z(le,{get when(){return Ve(e.customCloseIconSrc)},get children(){const t=tt();return T((n=>{const o=e.iconColor??(Ye(e.backgroundColor??rt)?it:at),r=Ze("absolute duration-200 transition w-[60%]",e.isBotOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0");return o!==n._v$5&&(null!=(n._v$5=o)?t.style.setProperty("fill",o):t.style.removeProperty("fill")),r!==n._v$6&&xe(t,"class",n._v$6=r),n}),{_v$5:void 0,_v$6:void 0}),t}}),null),Se(t,Z(le,{get when(){return E((()=>!!e.customCloseIconSrc))()&&st(e.customCloseIconSrc)},get children(){const t=nt();return T((n=>{const o=e.customCloseIconSrc,r=Ze("absolute duration-200 transition",e.isBotOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0",qe(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",qe(e.customCloseIconSrc)?"":"object-cover rounded-full");return o!==n._v$7&&xe(t,"src",n._v$7=o),r!==n._v$8&&ke(t,n._v$8=r),n}),{_v$7:void 0,_v$8:void 0}),t}}),null),Se(t,Z(le,{get when(){return E((()=>!!e.customCloseIconSrc))()&&!st(e.customCloseIconSrc)},get children(){const t=et();return t.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),Se(t,(()=>e.customCloseIconSrc)),T((()=>ke(t,Ze("absolute text-4xl duration-200 transition",e.isBotOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0")))),t}}),null),T((n=>{const o=Ze("fixed bottom-5 shadow-md rounded-full hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in","left"===e.placement?" left-5":" right-5"),r=e.backgroundColor??rt,i=e.buttonSize,a=e.buttonSize;return o!==n._v$9&&ke(t,n._v$9=o),r!==n._v$10&&(null!=(n._v$10=r)?t.style.setProperty("background-color",r):t.style.removeProperty("background-color")),i!==n._v$11&&(null!=(n._v$11=i)?t.style.setProperty("width",i):t.style.removeProperty("width")),a!==n._v$12&&(null!=(n._v$12=a)?t.style.setProperty("height",a):t.style.removeProperty("height")),n}),{_v$9:void 0,_v$10:void 0,_v$11:void 0,_v$12:void 0}),t})();we(["click"]);const ct=ve('<div part="preview-message"><p>'),dt=ve('<img class="rounded-full w-8 h-8 object-cover" alt="Bot avatar" elementtiming="Bot avatar" fetchpriority="high">'),ut=ve('<button part="preview-message-close-button" aria-label="Close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18">'),pt="#F7F8FF",gt="#303235",ht=e=>{const[t,n]=_(!1),[o,r]=_({x:0,y:0}),i=e=>{r({x:e.touches[0].clientX,y:e.touches[0].clientY})},a=t=>{const n=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY;(Math.abs(n-o().x)>10||i-o().y>10)&&e.onCloseClick(),r({x:0,y:0})};return(()=>{const o=ct(),r=o.firstChild;return o.$$touchend=a,o.$$touchstart=i,o.addEventListener("mouseleave",(()=>n(!1))),o.addEventListener("mouseenter",(()=>n(!0))),o.$$click=()=>e.onClick(),o.style.setProperty("z-index","42424242"),Se(o,Z(ft,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),r),Se(o,Z(le,{get when(){return e.avatarUrl},keyed:!0,children:e=>(()=>{const t=dt();return xe(t,"src",e),t})()}),r),Se(r,(()=>e.message)),T((t=>{const n="fixed max-w-[256px] rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4"+("left"===e.placement?" left-5":" right-5"),r=e.previewMessageTheme?.backgroundColor??pt,i=e.previewMessageTheme?.textColor??gt,a=`calc(${e.buttonSize} + 32px)`;return n!==t._v$&&ke(o,t._v$=n),r!==t._v$2&&(null!=(t._v$2=r)?o.style.setProperty("background-color",r):o.style.removeProperty("background-color")),i!==t._v$3&&(null!=(t._v$3=i)?o.style.setProperty("color",i):o.style.removeProperty("color")),a!==t._v$4&&(null!=(t._v$4=a)?o.style.setProperty("bottom",a):o.style.removeProperty("bottom")),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),o})()},ft=e=>(()=>{const t=ut();return t.$$click=t=>(t.stopPropagation(),e.onClick()),T((n=>{const o="absolute -top-2 -right-2 rounded-full w-6 h-6 p-1 hover:brightness-95 active:brightness-90 transition-all border "+(e.isHovered?"opacity-100":"opacity-0"),r=e.previewMessageTheme?.closeButtonBackgroundColor??pt,i=e.previewMessageTheme?.closeButtonIconColor??gt;return o!==n._v$5&&ke(t,n._v$5=o),r!==n._v$6&&(null!=(n._v$6=r)?t.style.setProperty("background-color",r):t.style.removeProperty("background-color")),i!==n._v$7&&(null!=(n._v$7=i)?t.style.setProperty("color",i):t.style.removeProperty("color")),n}),{_v$5:void 0,_v$6:void 0,_v$7:void 0}),t})();we(["click","touchstart","touchend"]);const mt=ve('<svg viewBox="0 0 800 800" width="16"><rect width="800" height="800" rx="80" fill="#0042DA"></rect><rect x="650" y="293" width="85.4704" height="384.617" rx="20" transform="rotate(90 650 293)" fill="#FF8E20"></rect><path fill-rule="evenodd" clip-rule="evenodd" d="M192.735 378.47C216.337 378.47 235.47 359.337 235.47 335.735C235.47 312.133 216.337 293 192.735 293C169.133 293 150 312.133 150 335.735C150 359.337 169.133 378.47 192.735 378.47Z" fill="#FF8E20"></path><rect x="150" y="506.677" width="85.4704" height="384.617" rx="20" transform="rotate(-90 150 506.677)" fill="white"></rect><path fill-rule="evenodd" clip-rule="evenodd" d="M607.265 421.206C583.663 421.206 564.53 440.34 564.53 463.942C564.53 487.544 583.663 506.677 607.265 506.677C630.867 506.677 650 487.544 650 463.942C650 440.34 630.867 421.206 607.265 421.206Z" fill="white">'),bt=()=>mt(),yt=ve('<a href="https://quick.bot/?utm_source=litebadge" target="_blank" rel="noopener noreferrer" class="lite-badge" id="lite-badge"><span>Made with Typebot'),vt=e=>{let t,n;const o=n=>{n.forEach((n=>{n.removedNodes.forEach((n=>{"id"in n&&t&&"lite-badge"==n.id&&(console.log("Sorry, you can't remove the brand 😅"),e.botContainer?.append(t))}))}))};return P((()=>{document&&e.botContainer&&(n=new MutationObserver(o),n.observe(e.botContainer,{subtree:!1,childList:!0}))})),I((()=>{n&&n.disconnect()})),(()=>{const e=yt(),n=e.firstChild;return"function"==typeof t?Te(t,e):t=e,Se(e,Z(bt,{}),n),e})()},wt=(e,t)=>"undefined"!=typeof window?window.__ENV?window.__ENV[e]??t:void 0:"undefined"!=typeof process?process.env[e]??t:void 0,xt=({ignoreChatApiUrl:e}={ignoreChatApiUrl:!1})=>{const t=wt("NEXT_PUBLIC_CHAT_API_URL"),n=wt("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!n||n.some((e=>e===window.location.href))))return t;const o=wt("NEXT_PUBLIC_VIEWER_URL")?.split(","),r=o?.find((e=>window.location.href.startsWith(e)));return r??o?.[0]??"https://quick.bot"},kt=()=>sessionStorage.getItem("typebotPaymentInProgress"),_t=()=>{sessionStorage.removeItem("typebotPaymentInProgress")};class Tt extends Error{constructor(e,t,n){const o=`${e.status||0===e.status?e.status:""} ${e.statusText||""}`.trim();super(`Request failed with ${o?`status code ${o}`:"an unknown error"}`),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=e,this.request=t,this.options=n}}class St extends Error{constructor(e){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=e}}const Et=e=>null!==e&&"object"==typeof e,Ct=(...e)=>{for(const t of e)if((!Et(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return It({},...e)},Pt=(e={},t={})=>{const n=new globalThis.Headers(e),o=t instanceof globalThis.Headers,r=new globalThis.Headers(t);for(const[e,t]of r.entries())o&&"undefined"===t||void 0===t?n.delete(e):n.set(e,t);return n},It=(...e)=>{let t={},n={};for(const o of e)if(Array.isArray(o))Array.isArray(t)||(t=[]),t=[...t,...o];else if(Et(o)){for(let[e,n]of Object.entries(o))Et(n)&&e in t&&(n=It(t[e],n)),t={...t,[e]:n};Et(o.headers)&&(n=Pt(n,o.headers),t.headers=n)}return t},Ot=(()=>{let e=!1,t=!1;const n="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.Request;return n&&o&&(t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")),e&&!t})(),At="function"==typeof globalThis.AbortController,$t="function"==typeof globalThis.ReadableStream,Rt="function"==typeof globalThis.FormData,Nt=["get","post","put","patch","head","delete"],Lt={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Dt=2147483647,Mt=Symbol("stop"),Ut={json:!0,parseJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},Bt={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},Ft=e=>Nt.includes(e)?e.toUpperCase():e,jt=[413,429,503],zt={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:jt,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Ht=(e={})=>{if("number"==typeof e)return{...zt,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...zt,...e,afterStatusCodes:jt}};class Vt{static create(e,t){const n=new Vt(e,t),o=async()=>{if("number"==typeof n._options.timeout&&n._options.timeout>Dt)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await n._fetch();for(const t of n._options.hooks.afterResponse){const o=await t(n.request,n._options,n._decorateResponse(e.clone()));o instanceof globalThis.Response&&(e=o)}if(n._decorateResponse(e),!e.ok&&n._options.throwHttpErrors){let t=new Tt(e,n.request,n._options);for(const e of n._options.hooks.beforeError)t=await e(t);throw t}if(n._options.onDownloadProgress){if("function"!=typeof n._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!$t)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(e.clone(),n._options.onDownloadProgress)}return e},r=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(o):o();for(const[e,o]of Object.entries(Lt))r[e]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||o);const i=(await r).clone();if("json"===e){if(204===i.status)return"";if(0===(await i.clone().arrayBuffer()).byteLength)return"";if(t.parseJson)return t.parseJson(await i.text())}return i[e]()};return r}constructor(e,t={}){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=e;const n=this._input instanceof Request&&"credentials"in Request.prototype?this._input.credentials:void 0;if(this._options={...n&&{credentials:n},...t,headers:Pt(this._input.headers,t.headers),hooks:It({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},t.hooks),method:Ft(t.method??this._input.method),prefixUrl:String(t.prefixUrl||""),retry:Ht(t.retry),throwHttpErrors:!1!==t.throwHttpErrors,timeout:t.timeout??1e4,fetch:t.fetch??globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(At){if(this.abortController=new globalThis.AbortController,this._options.signal){const e=this._options.signal;this._options.signal.addEventListener("abort",(()=>{this.abortController.abort(e.reason)}))}this._options.signal=this.abortController.signal}if(Ot&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const e="?"+("string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),t=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,e);!(Rt&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(t,{...this.request}),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(e instanceof St)){if(e instanceof Tt){if(!this._options.retry.statusCodes.includes(e.response.status))return 0;const t=e.response.headers.get("Retry-After");if(t&&this._options.retry.afterStatusCodes.includes(e.response.status)){let e=Number(t);return Number.isNaN(e)?e=Date.parse(t)-Date.now():e*=1e3,void 0!==this._options.retry.maxRetryAfter&&e>this._options.retry.maxRetryAfter?0:e}if(413===e.response.status)return 0}const t=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,t)}return 0}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(t){const n=Math.min(this._calculateRetryDelay(t),Dt);if(0!==n&&this._retryCount>0){await async function(e,{signal:t}){return new Promise(((n,o)=>{function r(){clearTimeout(i),o(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",r,{once:!0}));const i=setTimeout((()=>{t?.removeEventListener("abort",r),n()}),e)}))}(n,{signal:this._options.signal});for(const e of this._options.hooks.beforeRetry){if(await e({request:this.request,options:this._options,error:t,retryCount:this._retryCount})===Mt)return}return this._retry(e)}throw t}}async _fetch(){for(const e of this._options.hooks.beforeRequest){const t=await e(this.request,this._options);if(t instanceof Request){this.request=t;break}if(t instanceof Response)return t}const e=((e,t)=>{const n={};for(const o in t)o in Bt||o in Ut||o in e||(n[o]=t[o]);return n})(this.request,this._options);return!1===this._options.timeout?this._options.fetch(this.request.clone(),e):async function(e,t,n,o){return new Promise(((r,i)=>{const a=setTimeout((()=>{n&&n.abort(),i(new St(e))}),o.timeout);o.fetch(e,t).then(r).catch(i).then((()=>{clearTimeout(a)}))}))}(this.request.clone(),e,this.abortController,this._options)}_stream(e,t){const n=Number(e.headers.get("content-length"))||0;let o=0;return 204===e.status?(t&&t({percent:1,totalBytes:n,transferredBytes:o},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(r){const i=e.body.getReader();t&&t({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array),await async function e(){const{done:a,value:s}=await i.read();if(a)r.close();else{if(t){o+=s.byteLength;t({percent:0===n?0:o/n,transferredBytes:o,totalBytes:n},s)}r.enqueue(s),await e()}}()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}}
3
- /*! MIT License © Sindre Sorhus */const Gt=e=>{const t=(t,n)=>Vt.create(t,Ct(e,n));for(const n of Nt)t[n]=(t,o)=>Vt.create(t,Ct(e,o,{method:n}));return t.create=e=>Gt(Ct(e)),t.extend=t=>Gt(Ct(e,t)),t.stop=Mt,t};var Wt=Gt();class qt extends Error{constructor(e){super("This bot can only be executed on "+e)}}const[Kt,Yt]=_(),Xt=ve('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="19px" color="white"><path d="M476.59 227.05l-.16-.07L49.35 49.84A23.56 23.56 0 0027.14 52 24.65 24.65 0 0016 72.59v113.29a24 24 0 0019.52 23.57l232.93 43.07a4 4 0 010 7.86L35.53 303.45A24 24 0 0016 327v113.31A23.57 23.57 0 0026.59 460a23.94 23.94 0 0013.22 4 24.55 24.55 0 009.52-1.93L476.4 285.94l.19-.09a32 32 0 000-58.8z">'),Zt=e=>(()=>{const t=Xt();return _e(t,e,!0,!0),t})(),Jt=ve('<svg><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),Qt=e=>(()=>{const t=Jt();return _e(t,ne(e,{get class(){return"animate-spin h-6 w-6 "+e.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t})(),en=ve("<button>"),tn=e=>{const t=R((()=>e.children)),[n,o]=oe(e,["disabled","class"]);return(()=>{const r=en();return _e(r,ne(o,{get disabled(){return e.isDisabled||e.isLoading},get class(){return"py-2 px-4 font-semibold focus:outline-none filter hover:brightness-90 active:brightness-75 disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 flex justify-center"+("secondary"===e.variant?" secondary-button":" typebot-button")+" "+n.class}}),!1,!0),Se(r,Z(le,{get when(){return!e.isLoading},get fallback(){return Z(Qt,{})},get children(){return t()}})),r})()},nn=e=>{const[t,n]=oe(e,["disableIcon"]),o=Kt()&&!t.disableIcon||!e.children||"string"==typeof e.children&&Ge(e.children);return Z(tn,ne({type:"submit"},n,{get class(){return Ze("flex items-center",e.class)},"aria-label":o?"Send":void 0,get children(){return Z(ce,{get children(){return[Z(de,{when:o,get children(){return Z(Zt,{get class(){return"send-icon flex w-6 h-6 "+(t.disableIcon?"hidden":"")}})}}),Z(de,{when:!o,get children(){return e.children}})]}})}}))},on=ve('<div class="flex items-center gap-1"><div class="w-2 h-2 rounded-full bubble1"></div><div class="w-2 h-2 rounded-full bubble2"></div><div class="w-2 h-2 rounded-full bubble3">'),rn=()=>on(),an=ve('<input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input" type="text">'),sn=e=>{const[t,n]=oe(e,["ref","onInput"]);return(()=>{const o=an();o.$$input=e=>t.onInput(e.currentTarget.value);const r=e.ref;return"function"==typeof r?Te(r,o):e.ref=o,o.style.setProperty("font-size","16px"),_e(o,n,!1,!1),o})()};we(["input"]);const ln=ve('<textarea class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input" rows="6" data-testid="textarea" required>'),cn=e=>{const[t,n]=oe(e,["ref","onInput"]);return(()=>{const e=ln();e.$$input=e=>t.onInput(e.currentTarget.value);const o=t.ref;return"function"==typeof o?Te(o,e):t.ref=e,e.style.setProperty("font-size","16px"),_e(e,ne({get autofocus(){return!Kt()}},n),!1,!1),e})()};we(["input"]);const dn=!0,un=ve('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start typebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><audio controls>');let pn;const gn=e=>{let t,n,o=!1;const[r,i]=_(!!e.onTransitionEnd);return P((()=>{pn=setTimeout((()=>{o||(o=!0,i(!1),setTimeout((()=>e.onTransitionEnd?.(t)),400))}),100)})),I((()=>{pn&&clearTimeout(pn)})),(()=>{const o=un(),i=o.firstChild.firstChild.firstChild,a=i.nextSibling;"function"==typeof t?Te(t,o):t=o,Se(i,(()=>{const e=E((()=>!!r()));return()=>e()&&Z(rn,{})})());return"function"==typeof n?Te(n,a):n=a,T((t=>{const n=Ze("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),s=r()?"64px":"100%",l=r()?"32px":"100%",c=e.content?.url,d=!!e.onTransitionEnd&&(e.content?.isAutoplayEnabled??dn),u="z-10 text-fade-in "+(r()?"opacity-0":"opacity-100 m-2"),p=r()?Kt()?"32px":"36px":"revert";return n!==t._v$&&ke(o,t._v$=n),s!==t._v$2&&(null!=(t._v$2=s)?i.style.setProperty("width",s):i.style.removeProperty("width")),l!==t._v$3&&(null!=(t._v$3=l)?i.style.setProperty("height",l):i.style.removeProperty("height")),c!==t._v$4&&xe(a,"src",t._v$4=c),d!==t._v$5&&(a.autoplay=t._v$5=d),u!==t._v$6&&ke(a,t._v$6=u),p!==t._v$7&&(null!=(t._v$7=p)?a.style.setProperty("height",p):a.style.removeProperty("height")),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0}),o})()},hn=400,fn=ve('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start typebot-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><iframe id="embed-bubble-content" class="w-full h-full ">');let mn;const bn=e=>{let t;const[n,o]=_(!!e.onTransitionEnd),r=t=>{e.content?.waitForEvent?.isEnabled&&We(t.data.name)&&t.data.name===e.content?.waitForEvent.name&&(e.onCompleted?.(e.content.waitForEvent.saveDataInVariableId&&t.data.data?{type:"text",value:t.data.data}:void 0),window.removeEventListener("message",r))};return P((()=>{mn=setTimeout((()=>{o(!1),e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",r),setTimeout((()=>{e.onTransitionEnd?.(t)}),400)}),2e3)})),I((()=>{mn&&clearTimeout(mn),window.removeEventListener("message",r)})),(()=>{const o=fn(),r=o.firstChild.firstChild.firstChild,i=r.nextSibling,a=i.firstChild;return"function"==typeof t?Te(t,o):t=o,Se(r,(()=>{const e=E((()=>!!n()));return()=>e()&&Z(rn,{})})()),T((t=>{const s=Ze("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),l=n()?"64px":"100%",c=n()?"32px":"100%",d=Ze("p-4 z-20 text-fade-in w-full",n()?"opacity-0":"opacity-100 p-4"),u=n()?Kt()?"32px":"36px":`${e.content?.height??hn}px`,p=e.content?.url;return s!==t._v$&&ke(o,t._v$=s),l!==t._v$2&&(null!=(t._v$2=l)?r.style.setProperty("width",l):r.style.removeProperty("width")),c!==t._v$3&&(null!=(t._v$3=c)?r.style.setProperty("height",c):r.style.removeProperty("height")),d!==t._v$4&&ke(i,t._v$4=d),u!==t._v$5&&(null!=(t._v$5=u)?i.style.setProperty("height",u):i.style.removeProperty("height")),p!==t._v$6&&xe(a,"src",t._v$6=p),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0}),o})()},yn=e=>"string"==typeof e?e:e instanceof Error?e.name+": "+e.message:JSON.stringify(e),vn=Object.getPrototypeOf((async function(){})).constructor,wn=async({content:e,args:t})=>{try{const n=vn(...t.map((e=>e.id)),xn(e));await n(...t.map((e=>e.value)))}catch(e){return{logs:[{status:"error",description:"Script block failed to execute",details:yn(e)}]}}},xn=e=>e.replace(/<script>/g,"").replace(/<\/script>/g,""),kn=async({args:e,content:t})=>{try{const n=vn(...Object.keys(e),t);await n(...Object.keys(e).map((t=>e[t])))}catch(e){console.warn("Script threw an error:",e)}},[_n,Tn]=_("100%"),Sn=ve('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start typebot-host-bubble w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 "></div><div><div class="w-full overflow-y-auto">');let En;const Cn=e=>{let t;const[n,o]=_(!!e.onTransitionEnd);let r;return P((()=>{kn({args:{...e.content.initFunction.args,typebotElement:r},content:e.content.initFunction.content}),e.content.waitForEventFunction&&kn({args:{...e.content.waitForEventFunction.args,continueFlow:t=>e.onCompleted(t?{type:"text",value:t}:void 0)},content:e.content.waitForEventFunction.content}),En=setTimeout((()=>{o(!1),setTimeout((()=>e.onTransitionEnd?.(t)),400)}),2e3)})),I((()=>{En&&clearTimeout(En)})),(()=>{const o=Sn(),i=o.firstChild.firstChild.firstChild,a=i.nextSibling,s=a.firstChild;"function"==typeof t?Te(t,o):t=o,Se(i,(()=>{const e=E((()=>!!n()));return()=>e()&&Z(rn,{})})());return"function"==typeof r?Te(r,s):r=s,T((t=>{const r=Ze("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),l=n()?"64px":"100%",c=n()?"32px":"100%",d=Ze("p-2 z-20 text-fade-in w-full",n()?"opacity-0":"opacity-100"),u=n()?Kt()?"32px":"36px":void 0,p=`calc(${_n()} - 100px)`;return r!==t._v$&&ke(o,t._v$=r),l!==t._v$2&&(null!=(t._v$2=l)?i.style.setProperty("width",l):i.style.removeProperty("width")),c!==t._v$3&&(null!=(t._v$3=c)?i.style.setProperty("height",c):i.style.removeProperty("height")),d!==t._v$4&&ke(a,t._v$4=d),u!==t._v$5&&(null!=(t._v$5=u)?a.style.setProperty("height",u):a.style.removeProperty("height")),p!==t._v$6&&(null!=(t._v$6=p)?s.style.setProperty("max-height",p):s.style.removeProperty("max-height")),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0}),o})()},Pn={alt:"Bubble image"},In=ve('<img elementtiming="Bubble image" fetchpriority="high">'),On=ve('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start typebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">'),An=ve('<a target="_blank">'),$n=ve("<figure>");let Rn;const Nn=e=>{let t,n;const[o,r]=_(!!e.onTransitionEnd),i=()=>{o()&&(r(!1),setTimeout((()=>{e.onTransitionEnd?.(t)}),400))};P((()=>{n&&(Rn=setTimeout(i,5e3),n.onload=()=>{clearTimeout(Rn),i()})})),I((()=>{Rn&&clearTimeout(Rn)}));const a=(()=>{const t=In();return"function"==typeof n?Te(n,t):n=t,t.style.setProperty("max-height","512px"),T((n=>{const r=e.content?.url,i=e.content?.clickLink?.alt??Pn.alt,a=Ze(o()?"opacity-0":"opacity-100",e.onTransitionEnd?"text-fade-in":void 0,e.content?.url?.endsWith(".svg")?"w-full":void 0),s=o()?"32px":"auto";return r!==n._v$&&xe(t,"src",n._v$=r),i!==n._v$2&&xe(t,"alt",n._v$2=i),a!==n._v$3&&ke(t,n._v$3=a),s!==n._v$4&&(null!=(n._v$4=s)?t.style.setProperty("height",s):t.style.removeProperty("height")),n}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t})();return(()=>{const n=On(),r=n.firstChild.firstChild,i=r.firstChild;return"function"==typeof t?Te(t,n):t=n,Se(i,(()=>{const e=E((()=>!!o()));return()=>e()?Z(rn,{}):null})()),Se(r,(()=>{const t=E((()=>!!e.content?.clickLink));return()=>t()?(()=>{const t=An();return Se(t,a),T((n=>{const r=e.content.clickLink.url,i=Ze("z-10",o()?"h-8":"p-4");return r!==n._v$8&&xe(t,"href",n._v$8=r),i!==n._v$9&&ke(t,n._v$9=i),n}),{_v$8:void 0,_v$9:void 0}),t})():(()=>{const e=$n();return Se(e,a),T((()=>ke(e,Ze("z-10",!o()&&"p-4",o()?Kt()?"h-8":"h-9":"")))),e})()})(),null),T((t=>{const r=Ze("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),a=o()?"64px":"100%",s=o()?"32px":"100%";return r!==t._v$5&&ke(n,t._v$5=r),a!==t._v$6&&(null!=(t._v$6=a)?i.style.setProperty("width",a):i.style.removeProperty("width")),s!==t._v$7&&(null!=(t._v$7=s)?i.style.setProperty("height",s):i.style.removeProperty("height")),t}),{_v$5:void 0,_v$6:void 0,_v$7:void 0}),n})()},Ln=ve("<br>"),Dn=ve("<span>"),Mn=e=>(()=>{const t=Dn();return Se(t,(()=>e.text),null),Se(t,Z(le,{get when(){return E((()=>!!e.isUniqueChild))()&&Ge(e.text)},get children(){return Ln()}}),null),T((()=>ke(t,((e,t,n)=>{let o="";return e&&(o+="slate-bold"),t&&(o+=" slate-italic"),n&&(o+=" slate-underline"),o})(e.bold,e.italic,e.underline)))),t})(),Un=ve('<a target="_blank" rel="noopener noreferrer">'),Bn=ve("<ol>"),Fn=ve("<ul>"),jn=ve("<li>"),zn=ve("<span>"),Hn=ve("<div>"),Vn=e=>Z(ce,{get children(){return[Z(de,{get when(){return He(e.element.text)},get children(){return Z(Mn,ne((()=>e.element),{get isUniqueChild(){return e.isUniqueChild??!1}}))}}),Z(de,{when:!0,get children(){return Z(ce,{get children(){return[Z(de,{get when(){return"a"===e.element.type},get children(){const t=Un();return Se(t,Z(se,{get each(){return e.element.children},children:t=>Z(Vn,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),T((()=>xe(t,"href",e.element.url))),t}}),Z(de,{get when(){return"ol"===e.element.type},get children(){const t=Bn();return Se(t,Z(se,{get each(){return e.element.children},children:t=>Z(Vn,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),t}}),Z(de,{get when(){return"ul"===e.element.type},get children(){const t=Fn();return Se(t,Z(se,{get each(){return e.element.children},children:t=>Z(Vn,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),t}}),Z(de,{get when(){return"li"===e.element.type},get children(){const t=jn();return Se(t,Z(se,{get each(){return e.element.children},children:t=>Z(Vn,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),t}}),Z(de,{when:!0,get children(){return Z(Gn,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??!1},get children(){return Z(se,{get each(){return e.element.children},children:t=>Z(Vn,{element:t,get isUniqueChild(){return 1===e.element.children?.length},get insideInlineVariable(){return"inline-variable"===e.element.type}})})}})}})]}})}})]}}),Gn=e=>Z(ce,{get children(){return[Z(de,{get when(){return"inline-variable"===e.element.type||e.insideInlineVariable},get children(){const t=zn();return Se(t,(()=>e.children)),T((()=>xe(t,"data-element-type",e.element.type))),t}}),Z(de,{when:!0,get children(){const t=Hn();return Se(t,(()=>e.children)),T((()=>xe(t,"data-element-type",e.element.type))),t}})]}}),Wn=e=>e.map((e=>e.text??Wn(e.children))).join(""),qn={isInputPrefillEnabled:!1,isHideQueryParamsEnabled:!0,isNewResultOnRefreshEnabled:!0,rememberUser:{isEnabled:!1,storage:"session"},isBrandingEnabled:!1,isTypingEmulationEnabled:!0},Kn={enabled:!0,speed:400,maxDelay:3,delayBetweenBubbles:0,isDisabledOnFirstMessage:!0},Yn=ve('<div><div class="flex w-full items-center"><div class="flex relative items-start typebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing " data-testid="host-bubble"></div><div>');let Xn;const Zn=e=>{let t;const[n,o]=_(!!e.onTransitionEnd),r=()=>{n()&&(o(!1),setTimeout((()=>{e.onTransitionEnd?.(t)}),400))};return P((()=>{if(!n)return;const t=e.content?.richText?Wn(e.content.richText):"",o=!1===e.typingEmulation?.enabled||e.isTypingSkipped?0:(({bubbleContent:e,typingSettings:t})=>{let n=e.match(/(\w+)/g)?.length??0;0===n&&(n=e.length);const{enabled:o,speed:r,maxDelay:i}={enabled:t?.enabled??Kn.enabled,speed:t?.speed??Kn.speed,maxDelay:t?.maxDelay??Kn.maxDelay};let a=o?n/r*6e4:0;return a>1e3*i&&(a=1e3*i),a})({bubbleContent:t,typingSettings:e.typingEmulation});Xn=setTimeout(r,o)})),I((()=>{Xn&&clearTimeout(Xn)})),(()=>{const o=Yn(),r=o.firstChild.firstChild.firstChild,i=r.nextSibling;return"function"==typeof t?Te(t,o):t=o,Se(r,(()=>{const e=E((()=>!!n()));return()=>e()&&Z(rn,{})})()),Se(i,Z(se,{get each(){return e.content?.richText},children:e=>Z(Vn,{element:e})})),T((t=>{const a=Ze("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),s=n()?"64px":"100%",l=n()?"32px":"100%",c=Ze("overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative text-ellipsis",n()?"opacity-0":"opacity-100"),d=n()?Kt()?"16px":"20px":"100%";return a!==t._v$&&ke(o,t._v$=a),s!==t._v$2&&(null!=(t._v$2=s)?r.style.setProperty("width",s):r.style.removeProperty("width")),l!==t._v$3&&(null!=(t._v$3=l)?r.style.setProperty("height",l):r.style.removeProperty("height")),c!==t._v$4&&ke(i,t._v$4=c),d!==t._v$5&&(null!=(t._v$5=d)?i.style.setProperty("height",d):i.style.removeProperty("height")),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0}),o})()};let Jn=function(e){return e.URL="url",e.YOUTUBE="youtube",e.VIMEO="vimeo",e.TIKTOK="tiktok",e.GUMLET="gumlet",e}({});const Qn=[Jn.YOUTUBE,Jn.VIMEO,Jn.TIKTOK,Jn.GUMLET],eo=400,to="100%",no=!0,oo=!0,ro={[Jn.VIMEO]:"https://player.vimeo.com/video",[Jn.YOUTUBE]:"https://www.youtube.com/embed",[Jn.TIKTOK]:"https://www.tiktok.com/embed/v2",[Jn.GUMLET]:"https://play.gumlet.io/embed"},io=ve("<video>"),ao=ve('<div><iframe class="w-full h-full" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>'),so=ve('<div><div class="flex w-full items-center"><div class="flex relative z-10 items-start typebot-host-bubble overflow-hidden w-full max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing z-10 ">');let lo;const co=e=>{let t;const[n,o]=_(!!e.onTransitionEnd);return P((()=>{const r=e.content?.type&&Qn.includes(e.content?.type)?2e3:100;lo=setTimeout((()=>{n()&&(o(!1),setTimeout((()=>{e.onTransitionEnd?.(t)}),400))}),r)})),I((()=>{lo&&clearTimeout(lo)})),(()=>{const o=so(),r=o.firstChild.firstChild,i=r.firstChild;return"function"==typeof t?Te(t,o):t=o,Se(i,(()=>{const e=E((()=>!!n()));return()=>e()&&Z(rn,{})})()),Se(r,Z(ce,{get children(){return[Z(de,{get when(){return e.content?.type&&e.content.type===Jn.URL},get children(){const t=io();return T((o=>{const r=!!e.onTransitionEnd&&(e.content?.isAutoplayEnabled??oo),i=e.content?.url,a=e.content?.areControlsDisplayed??no,s="p-4 focus:outline-none w-full z-10 text-fade-in rounded-md "+(n()?"opacity-0":"opacity-100"),l=n()?Kt()?"32px":"36px":"auto",c=e.content?.aspectRatio,d=e.content?.maxWidth??to;return r!==o._v$&&(t.autoplay=o._v$=r),i!==o._v$2&&xe(t,"src",o._v$2=i),a!==o._v$3&&(t.controls=o._v$3=a),s!==o._v$4&&ke(t,o._v$4=s),l!==o._v$5&&(null!=(o._v$5=l)?t.style.setProperty("height",l):t.style.removeProperty("height")),c!==o._v$6&&(null!=(o._v$6=c)?t.style.setProperty("aspect-ratio",c):t.style.removeProperty("aspect-ratio")),d!==o._v$7&&(null!=(o._v$7=d)?t.style.setProperty("max-width",d):t.style.removeProperty("max-width")),o}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0}),t}}),Z(de,{get when(){return E((()=>!!e.content?.type))()&&Qn.includes(e.content.type)},get children(){const t=ao(),o=t.firstChild;return T((r=>{const i=Ze("p-4 z-10 text-fade-in w-full",n()?"opacity-0":"opacity-100 p-4"),a=n()?Kt()?"32px":"36px":e.content?.aspectRatio?void 0:`${e.content?.height??eo}px`,s=e.content?.aspectRatio,l=e.content?.maxWidth??to,c=`${ro[e.content?.type]}/${e.content?.id??""}${e.content?.queryParamsStr??""}`;return i!==r._v$8&&ke(t,r._v$8=i),a!==r._v$9&&(null!=(r._v$9=a)?t.style.setProperty("height",a):t.style.removeProperty("height")),s!==r._v$10&&(null!=(r._v$10=s)?t.style.setProperty("aspect-ratio",s):t.style.removeProperty("aspect-ratio")),l!==r._v$11&&(null!=(r._v$11=l)?t.style.setProperty("max-width",l):t.style.removeProperty("max-width")),c!==r._v$12&&xe(o,"src",r._v$12=c),r}),{_v$8:void 0,_v$9:void 0,_v$10:void 0,_v$11:void 0,_v$12:void 0}),t}})]}}),null),T((t=>{const r=Ze("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),a=n()?"64px":"100%",s=n()?"32px":"100%",l=e.content?.maxWidth??to;return r!==t._v$13&&ke(o,t._v$13=r),a!==t._v$14&&(null!=(t._v$14=a)?i.style.setProperty("width",a):i.style.removeProperty("width")),s!==t._v$15&&(null!=(t._v$15=s)?i.style.setProperty("height",s):i.style.removeProperty("height")),l!==t._v$16&&(null!=(t._v$16=l)?i.style.setProperty("max-width",l):i.style.removeProperty("max-width")),t}),{_v$13:void 0,_v$14:void 0,_v$15:void 0,_v$16:void 0}),o})()};let uo=function(e){return e.TEXT="text",e.IMAGE="image",e.VIDEO="video",e.EMBED="embed",e.AUDIO="audio",e}({});const po=e=>Z(ce,{get children(){return[Z(de,{get when(){return e.message.type===uo.TEXT},get children(){return Z(Zn,{get content(){return e.message.content},get isTypingSkipped(){return e.isTypingSkipped},get typingEmulation(){return e.typingEmulation},get onTransitionEnd(){return e.onTransitionEnd}})}}),Z(de,{get when(){return e.message.type===uo.IMAGE},get children(){return Z(Nn,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),Z(de,{get when(){return e.message.type===uo.VIDEO},get children(){return Z(co,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),Z(de,{get when(){return e.message.type===uo.EMBED},get children(){return Z(bn,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),Z(de,{get when(){return"custom-embed"===e.message.type},get children(){return Z(Cn,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),Z(de,{get when(){return e.message.type===uo.AUDIO},get children(){return Z(gn,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}})]}}),go=ve('<figure data-testid="default-avatar"><svg width="75" height="75" viewBox="0 0 75 75" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="mask0" x="0" y="0" mask-type="alpha"><circle cx="37.5" cy="37.5" r="37.5" fill="#0042DA"></circle></mask><g mask="url(#mask0)"><rect x="-30" y="-43" width="131" height="154" fill="#0042DA"></rect><rect x="2.50413" y="120.333" width="81.5597" height="86.4577" rx="2.5" transform="rotate(-52.6423 2.50413 120.333)" stroke="#FED23D" stroke-width="5"></rect><circle cx="76.5" cy="-1.5" r="29" stroke="#FF8E20" stroke-width="5"></circle><path d="M-49.8224 22L-15.5 -40.7879L18.8224 22H-49.8224Z" stroke="#F7F8FF" stroke-width="5">'),ho=()=>(()=>{const e=go(),t=e.firstChild;return T((n=>{const o="flex justify-center items-center rounded-full text-white relative flex-shrink-0 "+(Kt()?"w-6 h-6 text-sm":"w-10 h-10 text-xl"),r="absolute top-0 left-0 "+(Kt()?" w-6 h-6 text-sm":"w-full h-full text-xl");return o!==n._v$&&ke(e,n._v$=o),r!==n._v$2&&xe(t,"class",n._v$2=r),n}),{_v$:void 0,_v$2:void 0}),e})(),fo=ve('<figure><img alt="Bot avatar" class="rounded-full object-cover w-full h-full" elementtiming="Bot avatar" fetchpriority="high">'),mo=e=>{const[t,n]=_(e.initialAvatarSrc);return S((()=>{!t()?.startsWith("{{")&&t()||!e.initialAvatarSrc?.startsWith("http")||n(e.initialAvatarSrc)})),Z(le,{get when(){return We(t())},keyed:!0,get fallback(){return Z(ho,{})},get children(){const e=fo(),n=e.firstChild;return T((o=>{const r="flex justify-center items-center rounded-full text-white relative animate-fade-in flex-shrink-0 "+(Kt()?"w-6 h-6 text-sm":"w-10 h-10 text-xl"),i=t();return r!==o._v$&&ke(e,o._v$=r),i!==o._v$2&&xe(n,"src",o._v$2=i),o}),{_v$:void 0,_v$2:void 0}),e}})},bo=Symbol(),yo=Object.getPrototypeOf,vo=new WeakMap,wo=e=>(e=>e&&(vo.has(e)?vo.get(e):yo(e)===Object.prototype||yo(e)===Array.prototype))(e)&&e[bo]||null,xo=(e,t=!0)=>{vo.set(e,t)};function ko(e,t){const n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;return n?(n[e]||(n[e]=t()),n[e]):t()}var _o=e=>"object"==typeof e&&null!==e,To=ko("__zag__proxyStateMap",(()=>new WeakMap)),So=ko("__zag__refSet",(()=>new WeakSet)),[Eo]=((e=Object.is,t=(e,t)=>new Proxy(e,t),n=e=>_o(e)&&!So.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer),o=e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}},r=new WeakMap,i=(e,t,n=o)=>{const i=r.get(e);if(i?.[0]===t)return i[1];const a=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return xo(a,!0),r.set(e,[t,a]),Reflect.ownKeys(e).forEach((t=>{const o=Reflect.get(e,t);So.has(o)?(xo(o,!1),a[t]=o):o instanceof Promise?Object.defineProperty(a,t,{get:()=>n(o)}):To.has(o)?a[t]=Io(o,n):a[t]=o})),Object.freeze(a)},a=new WeakMap,s=[1,1],l=o=>{if(!_o(o))throw new Error("object required");const r=a.get(o);if(r)return r;let l=s[0];const c=new Set,d=(e,t=++s[0])=>{l!==t&&(l=t,c.forEach((n=>n(e,t))))};let u=s[1];const p=e=>(t,n)=>{const o=[...t];o[1]=[e,...o[1]],d(o,n)},g=new Map,h=e=>{const t=g.get(e);t&&(g.delete(e),t[1]?.())},f=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),m=t(f,{deleteProperty(e,t){const n=Reflect.get(e,t);h(t);const o=Reflect.deleteProperty(e,t);return o&&d(["delete",[t],n]),o},set(t,o,r,i){const s=Reflect.has(t,o),l=Reflect.get(t,o,i);if(s&&(e(l,r)||a.has(r)&&e(l,a.get(r))))return!0;h(o),_o(r)&&(r=wo(r)||r);let u=r;if(Object.getOwnPropertyDescriptor(t,o)?.set);else if(r instanceof Promise)r.then((e=>{Object.assign(r,{status:"fulfilled",value:e}),d(["resolve",[o],e])})).catch((e=>{Object.assign(r,{status:"rejected",reason:e}),d(["reject",[o],e])}));else{!To.has(r)&&n(r)&&(u=Co(r));const e=!So.has(u)&&To.get(u);e&&((e,t)=>{if(c.size){const n=t[3](p(e));g.set(e,[t,n])}else g.set(e,[t])})(o,e)}return Reflect.set(t,o,u,i),d(["set",[o],r,l]),!0}});a.set(o,m);const b=[f,(e=++s[1])=>(u===e||c.size||(u=e,g.forEach((([t])=>{const n=t[1](e);n>l&&(l=n)}))),l),i,e=>{c.add(e),1===c.size&&g.forEach((([e,t],n)=>{const o=e[3](p(n));g.set(n,[e,o])}));return()=>{c.delete(e),0===c.size&&g.forEach((([e,t],n)=>{t&&(t(),g.set(n,[e]))}))}}];return To.set(m,b),Reflect.ownKeys(o).forEach((e=>{const t=Object.getOwnPropertyDescriptor(o,e);t.get||t.set?Object.defineProperty(f,e,t):m[e]=o[e]})),m})=>[l,To,So,e,t,n,o,r,i,a,s])();function Co(e={}){return Eo(e)}function Po(e,t,n){const o=To.get(e);let r;const i=[],a=o[3];let s=!1;const l=a((e=>{i.push(e),n?t(i.splice(0)):r||(r=Promise.resolve().then((()=>{r=void 0,s&&t(i.splice(0))})))}));return s=!0,()=>{s=!1,l()}}function Io(e,t){const n=To.get(e),[o,r,i]=n;return i(o,r(),t)}function Oo(e){return So.add(e),e}function Ao(e,t){Object.keys(t).forEach((o=>{if(Object.getOwnPropertyDescriptor(e,o))throw new Error("object property already defined");const r=t[o],{get:i,set:a}="function"==typeof r?{get:r}:r,s={get:()=>i(Io(n))};a&&(s.set=e=>a(n,e)),Object.defineProperty(e,o,s)}));const n=Co(e);return n}function $o(e,t,n){"object"==typeof n.value&&(n.value=Ro(n.value)),n.enumerable&&!n.get&&!n.set&&n.configurable&&n.writable&&"__proto__"!==t?e[t]=n.value:Object.defineProperty(e,t,n)}function Ro(e){if("object"!=typeof e)return e;var t,n,o,r=0,i=Object.prototype.toString.call(e);if("[object Object]"===i?o=Object.create(e.__proto__||null):"[object Array]"===i?o=Array(e.length):"[object Set]"===i?(o=new Set,e.forEach((function(e){o.add(Ro(e))}))):"[object Map]"===i?(o=new Map,e.forEach((function(e,t){o.set(Ro(t),Ro(e))}))):"[object Date]"===i?o=new Date(+e):"[object RegExp]"===i?o=new RegExp(e.source,e.flags):"[object DataView]"===i?o=new e.constructor(Ro(e.buffer)):"[object ArrayBuffer]"===i?o=e.slice(0):"Array]"===i.slice(-6)&&(o=new e.constructor(e)),o){for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)$o(o,n[r],Object.getOwnPropertyDescriptor(e,n[r]));for(r=0,n=Object.getOwnPropertyNames(e);r<n.length;r++)Object.hasOwnProperty.call(o,t=n[r])&&o[t]===e[t]||$o(o,t,Object.getOwnPropertyDescriptor(e,t))}return o||e}var No=Object.defineProperty,Lo=(e,t,n)=>((e,t,n)=>t in e?No(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);var Do=(e,...t)=>("function"==typeof e?e(...t):e)??void 0,Mo=()=>{},Uo=(...e)=>(...t)=>{e.forEach((function(e){e?.(...t)}))},Bo=(()=>{let e=0;return()=>(e++,e.toString(36))})(),Fo=e=>Array.isArray(e),jo=e=>!(null==e||"object"!=typeof e||Fo(e)),zo=e=>"string"==typeof e,Ho=e=>"function"==typeof e;function Vo(e){if(!Go(e)||void 0===e)return e;const t=Reflect.ownKeys(e).filter((e=>"string"==typeof e)),n={};for(const o of t){const t=e[o];void 0!==t&&(n[o]=Vo(t))}return n}var Go=e=>e&&"object"==typeof e&&e.constructor===Object;function Wo(...e){1===e.length?e[0]:e[1],2!==e.length||e[0]}function qo(...e){1===e.length?e[0]:e[1],2!==e.length||e[0]}function Ko(e,...t){for(const n of t){const t=Vo(n);for(const o in t)jo(n[o])?(e[o]||(e[o]={}),Ko(e[o],n[o])):e[o]=n[o]}return e}function Yo(e){return Ro(e)}function Xo(e){return zo(e)?{type:e}:e}function Zo(e){return e?Fo(e)?e.slice():[e]:[]}function Jo(e){return jo(e)&&null!=e.predicate}var Qo=()=>!0;function er(e,t,n,o){return r=>zo(r)?!!e[r]?.(t,n,o):Ho(r)?r(t,n,o):r.predicate(e)(t,n,o)}var tr={or:function(...e){return{predicate:t=>(n,o,r)=>e.map(er(t,n,o,r)).some(Boolean)}},and:function(...e){return{predicate:t=>(n,o,r)=>e.map(er(t,n,o,r)).every(Boolean)}},not:function(e){return{predicate:t=>(n,o,r)=>!er(t,n,o,r)(e)}},stateIn:function(...e){return(t,n,o)=>o.state.matches(...e)}};function nr(e,t){return e=e??Qo,(n,o,r)=>{if(zo(e)){const i=t[e];return Ho(i)?i(n,o,r):i}return Jo(e)?e.predicate(t)(n,o,r):e?.(n,o,r)}}function or(e,t){return(n,o,r)=>Jo(e)?e.predicate(t)(n,o,r):e}function rr(e,t){return(n,o)=>{if("number"==typeof(r=e)&&!Number.isNaN(r))return e;var r;if(Ho(e))return e(n,o);if(zo(e)){const r=Number.parseFloat(e);if(!Number.isNaN(r))return r;if(t){const r=t?.[e];return qo(null==r,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),Ho(r)?r(n,o):r}}}}function ir(e){return zo(e)?{target:e}:e}var ar=class{constructor(e,t){Lo(this,"status","Not Started"),Lo(this,"state"),Lo(this,"initialState"),Lo(this,"initialContext"),Lo(this,"id"),Lo(this,"type","machine"),Lo(this,"activityEvents",new Map),Lo(this,"delayedEvents",new Map),Lo(this,"stateListeners",new Set),Lo(this,"doneListeners",new Set),Lo(this,"contextWatchers",new Set),Lo(this,"removeStateListener",Mo),Lo(this,"parent"),Lo(this,"children",new Map),Lo(this,"guardMap"),Lo(this,"actionMap"),Lo(this,"delayMap"),Lo(this,"activityMap"),Lo(this,"sync"),Lo(this,"options"),Lo(this,"config"),Lo(this,"_created",(()=>{const e=Xo("machine.created");this.executeActions(this.config?.created,e)})),Lo(this,"start",(e=>{if(this.state.value="",this.state.tags=[],"Running"===this.status)return this;this.status="Running",this.removeStateListener=Po(this.state,(()=>{this.stateListeners.forEach((e=>{e(this.stateSnapshot)}))}),this.sync),this.setupContextWatchers(),this.executeActivities(Xo("machine.start"),Zo(this.config.activities),"machine.start"),this.executeActions(this.config.entry,Xo("machine.start"));const t=Xo("machine.init"),n=jo(e)?e.value:e,o=jo(e)?e.context:void 0;o&&this.setContext(o);const r={target:n??this.config.initial},i=this.getNextStateInfo(r,t);return this.initialState=i,this.performStateChangeEffects(this.state.value,i,t),this})),Lo(this,"setupContextWatchers",(()=>{const{watch:e}=this.config;if(!e)return;let t=Io(this.state.context);const n=Po(this.state.context,(()=>{const n=Io(this.state.context);for(const[o,r]of Object.entries(e)){(this.options.compareFns?.[o]??Object.is)(t[o],n[o])||this.executeActions(r,this.state.event)}t=n}));this.contextWatchers.add(n)})),Lo(this,"stop",(()=>{if("Stopped"!==this.status)return this.performExitEffects(this.state.value,Xo("machine.stop")),this.executeActions(this.config.exit,Xo("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this})),Lo(this,"stopStateListeners",(()=>{this.removeStateListener(),this.stateListeners.clear()})),Lo(this,"stopContextWatchers",(()=>{this.contextWatchers.forEach((e=>e())),this.contextWatchers.clear()})),Lo(this,"stopDelayedEvents",(()=>{this.delayedEvents.forEach((e=>{e.forEach((e=>e()))})),this.delayedEvents.clear()})),Lo(this,"stopActivities",(e=>{e?(this.activityEvents.get(e)?.forEach((e=>e())),this.activityEvents.get(e)?.clear(),this.activityEvents.delete(e)):(this.activityEvents.forEach((e=>{e.forEach((e=>e())),e.clear()})),this.activityEvents.clear())})),Lo(this,"sendChild",((e,t)=>{const n=Xo(e),o=Do(t,this.contextSnapshot),r=this.children.get(o);r||qo(`[@zag-js/core] Cannot send '${n.type}' event to unknown child`),r.send(n)})),Lo(this,"stopChild",(e=>{this.children.has(e)||qo(`[@zag-js/core > stop-child] Cannot stop unknown child ${e}`),this.children.get(e).stop(),this.children.delete(e)})),Lo(this,"removeChild",(e=>{this.children.delete(e)})),Lo(this,"stopChildren",(()=>{this.children.forEach((e=>e.stop())),this.children.clear()})),Lo(this,"setParent",(e=>{this.parent=e})),Lo(this,"spawn",((e,t)=>{const n=Do(e);return t&&(n.id=t),n.type="machine.actor",n.setParent(this),this.children.set(n.id,n),n.onDone((()=>{this.removeChild(n.id)})).start(),Oo(n)})),Lo(this,"stopActivity",(e=>{if(!this.state.value)return;const t=this.activityEvents.get(this.state.value);t?.get(e)?.(),t?.delete(e)})),Lo(this,"addActivityCleanup",((e,t,n)=>{e&&(this.activityEvents.has(e)?this.activityEvents.get(e)?.set(t,n):this.activityEvents.set(e,new Map([[t,n]])))})),Lo(this,"setState",(e=>{this.state.previousValue=this.state.value,this.state.value=e;const t=this.getStateNode(e);null==e?function(e){for(;e.length>0;)e.pop()}(this.state.tags):this.state.tags=Zo(t?.tags)})),Lo(this,"setContext",(e=>{e&&Ko(this.state.context,Vo(e))})),Lo(this,"setOptions",(e=>{const t=Vo(e);this.actionMap={...this.actionMap,...t.actions},this.delayMap={...this.delayMap,...t.delays},this.activityMap={...this.activityMap,...t.activities},this.guardMap={...this.guardMap,...t.guards}})),Lo(this,"getStateNode",(e=>{if(e)return this.config.states?.[e]})),Lo(this,"getNextStateInfo",((e,t)=>{const n=this.determineTransition(e,t),o=!n?.target,r=n?.target??this.state.value,i=this.state.value!==r,a=this.getStateNode(r),s={reenter:!o&&!i&&!n?.internal,transition:n,stateNode:a,target:r,changed:i};return this.log("NextState:",`[${t.type}]`,this.state.value,"----\x3e",s.target),s})),Lo(this,"getAfterActions",((e,t)=>{let n;return{entry:()=>{n=globalThis.setTimeout((()=>{const t=this.getNextStateInfo(e,this.state.event);this.performStateChangeEffects(this.state.value,t,this.state.event)}),t)},exit:()=>{globalThis.clearTimeout(n)}}})),Lo(this,"getDelayedEventActions",(e=>{const t=this.getStateNode(e),n=this.state.event;if(!t||!t.after)return;const o=[],r=[];if(Fo(t.after)){const e=this.determineTransition(t.after,n);if(!e)return;if(i=e,a="delay",!Object.prototype.hasOwnProperty.call(i,a))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(e)}`);const s=rr(e.delay,this.delayMap)(this.contextSnapshot,n),l=this.getAfterActions(e,s);return o.push(l.entry),r.push(l.exit),{entries:o,exits:r}}var i,a;if(jo(t.after))for(const e in t.after){const i=t.after[e],a=rr(e,this.delayMap)(this.contextSnapshot,n),s=this.getAfterActions(i,a);o.push(s.entry),r.push(s.exit)}return{entries:o,exits:r}})),Lo(this,"executeActions",((e,t)=>{const n=or(e,this.guardMap)(this.contextSnapshot,t,this.guardMeta);for(const e of Zo(n)){const n=zo(e)?this.actionMap?.[e]:e;Wo(zo(e)&&!n,`[@zag-js/core > execute-actions] No implementation found for action: \`${e}\``),n?.(this.state.context,t,this.meta)}})),Lo(this,"executeActivities",((e,t,n)=>{for(const o of t){const t=zo(o)?this.activityMap?.[o]:o;if(!t){Wo(`[@zag-js/core > execute-activity] No implementation found for activity: \`${o}\``);continue}const r=t(this.state.context,e,this.meta);if(r){const e=zo(o)?o:o.name||Bo();this.addActivityCleanup(n??this.state.value,e,r)}}})),Lo(this,"createEveryActivities",((e,t)=>{if(e)if(Fo(e)){const n=Zo(e).find((e=>{const t=rr(e.delay,this.delayMap)(this.contextSnapshot,this.state.event);return nr(e.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??null!=t}));if(!n)return;const o=rr(n.delay,this.delayMap)(this.contextSnapshot,this.state.event);t((()=>{const e=globalThis.setInterval((()=>{this.executeActions(n.actions,this.state.event)}),o);return()=>{globalThis.clearInterval(e)}}))}else for(const n in e){const o=e?.[n],r=rr(n,this.delayMap)(this.contextSnapshot,this.state.event);t((()=>{const e=globalThis.setInterval((()=>{this.executeActions(o,this.state.event)}),r);return()=>{globalThis.clearInterval(e)}}))}})),Lo(this,"setEvent",(e=>{this.state.previousEvent=this.state.event,this.state.event=Oo(Xo(e))})),Lo(this,"performExitEffects",((e,t)=>{const n=this.state.value;if(""===n)return;const o=e?this.getStateNode(e):void 0;this.stopActivities(n);const r=Zo(or(o?.exit,this.guardMap)(this.contextSnapshot,t,this.guardMeta)),i=this.delayedEvents.get(n);i&&r.push(...i),this.executeActions(r,t)})),Lo(this,"performEntryEffects",((e,t)=>{const n=this.getStateNode(e),o=Zo(n?.activities);this.createEveryActivities(n?.every,(e=>{o.unshift(e)})),o.length>0&&this.executeActivities(t,o);const r=Zo(or(n?.entry,this.guardMap)(this.contextSnapshot,t,this.guardMeta)),i=this.getDelayedEventActions(e);n?.after&&i&&(this.delayedEvents.set(e,i?.exits),r.push(...i.entries)),this.executeActions(r,t),"final"===n?.type&&(this.state.done=!0,this.doneListeners.forEach((e=>{e(this.stateSnapshot)})),this.stop())})),Lo(this,"performTransitionEffects",((e,t)=>{const n=this.determineTransition(e,t);this.executeActions(n?.actions,t)})),Lo(this,"performStateChangeEffects",((e,t,n)=>{this.setEvent(n);const o=t.changed||t.reenter;o&&this.performExitEffects(e,n),this.performTransitionEffects(t.transition,n),this.setState(t.target),o&&this.performEntryEffects(t.target,n)})),Lo(this,"determineTransition",((e,t)=>{const n=(o=e,r=this.guardMap,(e,t,n)=>Zo(o).map(ir).find((o=>nr(o.guard,r)(e,t,n)??o.target??o.actions)));var o,r;return n?.(this.contextSnapshot,t,this.guardMeta)})),Lo(this,"sendParent",(e=>{this.parent||qo("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const t=Xo(e);this.parent?.send(t)})),Lo(this,"log",((...e)=>{})),Lo(this,"send",(e=>{const t=Xo(e);this.transition(this.state.value,t)})),Lo(this,"transition",((e,t)=>{const n=zo(e)?this.getStateNode(e):e?.stateNode,o=Xo(t);if(!n&&!this.config.on){return void Wo("Stopped"===this.status?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${e}, \`event\`: ${o.type}`)}const r=n?.on?.[o.type]??this.config.on?.[o.type],i=this.getNextStateInfo(r,o);return this.performStateChangeEffects(this.state.value,i,o),i.stateNode})),Lo(this,"subscribe",(e=>(this.stateListeners.add(e),"Running"===this.status&&e(this.stateSnapshot),()=>{this.stateListeners.delete(e)}))),Lo(this,"onDone",(e=>(this.doneListeners.add(e),this))),Lo(this,"onTransition",(e=>(this.stateListeners.add(e),"Running"===this.status&&e(this.stateSnapshot),this))),this.config=Yo(e),this.options=Yo(t??{}),this.id=this.config.id??`machine-${Bo()}`,this.guardMap=this.options?.guards??{},this.actionMap=this.options?.actions??{},this.delayMap=this.options?.delays??{},this.activityMap=this.options?.activities??{},this.sync=this.options?.sync??!1,this.state=function(e){const t=e.computed??{},n=e.context??{},o=e.initial?e.states?.[e.initial]?.tags:[];return Co({value:e.initial??"",previousValue:"",event:{},previousEvent:{},context:Ao(n,t),done:!1,tags:o??[],hasTag(e){return this.tags.includes(e)},matches(...e){return e.includes(this.value)},can(e){return this.nextEvents.includes(e)},get nextEvents(){const t=e.states?.[this.value]?.on??{},n=e?.on??{};return Object.keys({...t,...n})},get changed(){return!("machine.init"===this.event.value||!this.previousValue)&&this.value!==this.previousValue}})}(this.config),this.initialContext=Io(this.state.context)}get stateSnapshot(){return Io(this.state)}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){return e.initialState?.target??""}}}get meta(){return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:this.initialState?.target??"",getState:()=>this.stateSnapshot,getAction:e=>this.actionMap[e],getGuard:e=>this.guardMap[e]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}},sr=(e,t)=>new ar(e,t),lr=(...e)=>e.map((e=>e?.trim?.())).filter(Boolean).join(" "),cr=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,dr=e=>{const t={};let n;for(;n=cr.exec(e);)t[n[1]]=n[2];return t},ur=(e,t)=>{if(zo(e)){if(zo(t))return`${e};${t}`;e=dr(e)}else zo(t)&&(t=dr(t));return Object.assign({},e??{},t??{})};function pr(...e){let t={};for(let n of e){for(let e in t)e.startsWith("on")&&"function"==typeof t[e]&&"function"==typeof n[e]?t[e]=Uo(n[e],t[e]):t[e]="className"!==e&&"class"!==e?"style"!==e?void 0!==n[e]?n[e]:t[e]:ur(t[e],n[e]):lr(t[e],n[e]);for(let e in n)void 0===t[e]&&(t[e]=n[e])}return t}var gr=()=>e=>Array.from(new Set(e));const hr=Symbol("store-raw"),fr=Symbol("store-node");function mr(e){let t=e[l];if(!t&&(Object.defineProperty(e,l,{value:t=new Proxy(e,_r)}),!Array.isArray(e))){const n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let r=0,i=n.length;r<i;r++){const i=n[r];o[i].get&&Object.defineProperty(e,i,{enumerable:o[i].enumerable,get:o[i].get.bind(t)})}}return t}function br(e){let t;return null!=e&&"object"==typeof e&&(e[l]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function yr(e,t=new Set){let n,o,r,i;if(n=null!=e&&e[hr])return n;if(!br(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,i=e.length;n<i;n++)r=e[n],(o=yr(r,t))!==r&&(e[n]=o)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const n=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let s=0,l=n.length;s<l;s++)i=n[s],a[i].get||(r=e[i],(o=yr(r,t))!==r&&(e[i]=o))}return e}function vr(e){let t=e[fr];return t||Object.defineProperty(e,fr,{value:t=Object.create(null)}),t}function wr(e,t,n){return e[t]||(e[t]=kr(n))}function xr(e){if(O()){const t=vr(e);(t._||(t._=kr()))()}}function kr(e){const[t,n]=_(e,{equals:!1,internal:!0});return t.$=n,t}const _r={get(e,t,n){if(t===hr)return e;if(t===l)return n;if(t===c)return xr(e),n;const o=vr(e),r=o[t];let i=r?r():e[t];if(t===fr||"__proto__"===t)return i;if(!r){const n=Object.getOwnPropertyDescriptor(e,t);!O()||"function"==typeof i&&!e.hasOwnProperty(t)||n&&n.get||(i=wr(o,t,i)())}return br(i)?mr(i):i},has(e,t){return t===hr||t===l||t===c||t===fr||"__proto__"===t||(this.get(e,t,e),t in e)},set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){return xr(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return n&&!n.get&&n.configurable&&t!==l&&t!==fr?(delete n.value,delete n.writable,n.get=()=>e[l][t],n):n}};function Tr(e,t,n,o=!1){if(!o&&e[t]===n)return;const r=e[t],i=e.length;void 0===n?delete e[t]:e[t]=n;let a,s=vr(e);if((a=wr(s,t,r))&&a.$((()=>n)),Array.isArray(e)&&e.length!==i){for(let t=e.length;t<i;t++)(a=s[t])&&a.$();(a=wr(s,"length",i))&&a.$(e.length)}(a=s._)&&a.$()}function Sr(e,t){const n=Object.keys(t);for(let o=0;o<n.length;o+=1){const r=n[o];Tr(e,r,t[r])}}function Er(e,t,n=[]){let o,r=e;if(t.length>1){o=t.shift();const i=typeof o,a=Array.isArray(e);if(Array.isArray(o)){for(let r=0;r<o.length;r++)Er(e,[o[r]].concat(t),n);return}if(a&&"function"===i){for(let r=0;r<e.length;r++)o(e[r],r)&&Er(e,[r].concat(t),n);return}if(a&&"object"===i){const{from:r=0,to:i=e.length-1,by:a=1}=o;for(let o=r;o<=i;o+=a)Er(e,[o].concat(t),n);return}if(t.length>1)return void Er(e[o],t,[o].concat(n));r=e[o],n=[o].concat(n)}let i=t[0];"function"==typeof i&&(i=i(r,n),i===r)||void 0===o&&null==i||(i=yr(i),void 0===o||br(r)&&br(i)&&!Array.isArray(i)?Sr(r,i):Tr(e,o,i))}function Cr(...[e,t]){const n=yr(e||{}),o=Array.isArray(n);return[mr(n),function(...e){B((()=>{o&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=yr(t),Array.isArray(t)){if(e===t)return;let n=0,o=t.length;for(;n<o;n++){const o=t[n];e[n]!==o&&Tr(e,n,o)}Tr(e,"length",o)}else Sr(e,t)}(n,e[0]):Er(n,e)}),!1)}]}const Pr=Symbol("store-root");function Ir(e,t,n,o,r){const i=t[n];if(e===i)return;if(n!==Pr&&(!br(e)||!br(i)||r&&e[r]!==i[r]))return void Tr(t,n,e);if(Array.isArray(e)){if(e.length&&i.length&&(!o||r&&e[0]&&null!=e[0][r])){let t,n,a,s,l,c,d,u;for(a=0,s=Math.min(i.length,e.length);a<s&&(i[a]===e[a]||r&&i[a]&&e[a]&&i[a][r]===e[a][r]);a++)Ir(e[a],i,a,o,r);const p=new Array(e.length),g=new Map;for(s=i.length-1,l=e.length-1;s>=a&&l>=a&&(i[s]===e[l]||r&&i[a]&&e[a]&&i[s][r]===e[l][r]);s--,l--)p[l]=i[s];if(a>l||a>s){for(n=a;n<=l;n++)Tr(i,n,e[n]);for(;n<e.length;n++)Tr(i,n,p[n]),Ir(e[n],i,n,o,r);return void(i.length>e.length&&Tr(i,"length",e.length))}for(d=new Array(l+1),n=l;n>=a;n--)c=e[n],u=r&&c?c[r]:c,t=g.get(u),d[n]=void 0===t?-1:t,g.set(u,n);for(t=a;t<=s;t++)c=i[t],u=r&&c?c[r]:c,n=g.get(u),void 0!==n&&-1!==n&&(p[n]=i[t],n=d[n],g.set(u,n));for(n=a;n<e.length;n++)n in p?(Tr(i,n,p[n]),Ir(e[n],i,n,o,r)):Tr(i,n,e[n])}else for(let t=0,n=e.length;t<n;t++)Ir(e[t],i,t,o,r);return void(i.length>e.length&&Tr(i,"length",e.length))}const a=Object.keys(e);for(let t=0,n=a.length;t<n;t++)Ir(e[a[t]],i,a[t],o,r);const s=Object.keys(i);for(let t=0,n=s.length;t<n;t++)void 0===e[s[t]]&&Tr(i,s[t],void 0)}function Or(e,t={}){const{merge:n,key:o="id"}=t,r=yr(e);return e=>{if(!br(e)||!br(r))return r;const t=Ir(r,{[Pr]:e},Pr,n,o);return void 0===t?e:t}}function Ar(...e){const t={};for(let n=0;n<e.length;n++){let o=e[n];if("function"==typeof o&&(o=o()),o){const n=Object.getOwnPropertyDescriptors(o);for(const o in n)o in t||Object.defineProperty(t,o,{enumerable:!0,get(){let t={};if("style"===o||"class"===o||"className"===o||o.startsWith("on")){for(let n=0;n<e.length;n++){let r=e[n];"function"==typeof r&&(r=r()),t=pr(t,{[o]:(r||{})[o]})}return t[o]}for(let t=e.length-1;t>=0;t--){let n,r=e[t];if("function"==typeof r&&(r=r()),n=(r||{})[o],void 0!==n)return n}}})}}return t}var $r=e=>!(null==e||"object"!=typeof e||(e=>Array.isArray(e))(e)),Rr=e=>"string"==typeof e,Nr={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},Lr=e=>e.startsWith("--")?e:function(e){if(jr.hasOwnProperty(e))return jr[e];var t=e.replace(Br,zr);return jr[e]=Fr.test(t)?"-"+t:t}(e);var Dr,Mr=(Dr=e=>{const t={};for(const o in e){const r=e[o];"readOnly"===o&&!1===r||("style"===o&&$r(r)?t.style=Ur(r):"children"!==o?t[(n=o,n in Nr?Nr[n]:n)]=r:Rr(r)&&(t.textContent=r))}var n;return t},new Proxy({},{get:()=>Dr}));function Ur(e){let t={};for(const o in e){const r=e[o];!Rr(r)&&("number"!=typeof(n=r)||Number.isNaN(n))||(t[Lr(o)]=r)}var n;return t}var Br=/[A-Z]/g,Fr=/^ms-/,jr={};function zr(e){return"-"+e.toLowerCase()}function Hr(e,t){const{actions:n,context:o}=t??{},[r,i]=Cr(e.getState());return P((()=>{const t=e.subscribe((e=>{i(Or(e))}));I((()=>{t()}))})),S((()=>{const t="function"==typeof o?o():o;e.setContext(t)})),S((()=>{e.setOptions({actions:n})})),r}function Vr(e,t){const n=function(e,t){const{state:n,context:o}=t??{},r=(()=>{const t="function"==typeof e?e():e,n="function"==typeof o?o():o;return n&&t.setContext(n),t._created(),t})();return P((()=>{r.start(n),I((()=>{r.stop()}))})),r}(e,t);return[Hr(n,t),n.send,n]}var Gr=(e,t=[])=>({parts:(...n)=>{if(qr(t))return Gr(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Gr(e,[...t,...n]),rename:e=>Gr(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce(((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${Wr(e)}"][data-part="${Wr(n)}"]`,`& [data-scope="${Wr(e)}"][data-part="${Wr(n)}"]`].join(", "),attrs:{"data-scope":Wr(e),"data-part":Wr(n)}}})),{})}),Wr=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),qr=e=>0===e.length,Kr=e=>e?"":void 0,Yr=e=>"object"==typeof e&&e?.nodeType===Node.ELEMENT_NODE&&"string"==typeof e?.nodeName,Xr=e=>e.nodeType===Node.DOCUMENT_NODE;function Zr(e,t){return!(!e||!t)&&(!(!Yr(e)||!Yr(t))&&(e===t||e.contains(t)))}function Jr(e){return Xr(e)?e:(e=>null!=e&&e===e.window)(e)?e.document:e?.ownerDocument??document}function Qr(e){return(e=>e&&(e=>void 0!==e.nodeType)(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e)(e)?Qr(e.host):Xr(e)?e.defaultView??window:Yr(e)?e.ownerDocument?.defaultView??window:window}var ei=()=>"undefined"!=typeof document;var ti=e=>ei()&&e.test(function(){const e=navigator.userAgentData;return e?.platform??navigator.platform}()),ni=()=>{return e=/firefox\//i,ei()&&e.test(navigator.userAgent);var e};function oi(e){const t=function(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}(e);return t?.[0]??e.target}function ri(e){const t=e.currentTarget;if(!t)return!1;const n=ti(/mac|iphone|ipad|ipod/i);if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const o=t.localName;return"a"===o||("button"===o&&"submit"===t.type||"input"===o&&"submit"===t.type)}function ii(e){const t=e.currentTarget;if(!t)return!1;const n=t.localName;return!!e.altKey&&("a"===n||("button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type))}var ai=e=>e.id;function si(e,t,n=ai){const o=function(e,t,n=ai){return e.find((e=>n(e)===t))}(e,t,n);return o?e.indexOf(o):-1}function li(e,t,n,o=ai){const r=n?si(e,n,o):-1;let i=n?((e,t)=>e.map(((n,o)=>e[(Math.max(t,0)+o)%e.length])))(e,r):e;return 1===t.length&&(i=i.filter((e=>o(e)!==n))),i.find((e=>{return n=(e=>(e.dataset.valuetext??e.textContent??"").split("").map((e=>{const t=e.charCodeAt(0);return t>0&&t<128?e:t>=128&&t<=255?`/x${t.toString(16)}`.replace("/","\\"):""})).join("").trim())(e),o=t,n.trim().toLowerCase().startsWith(o.toLowerCase());var n,o}))}function ci(e,t){const{state:n,activeId:o,key:r,timeout:i=350,itemToId:a}=t,s=n.keysSoFar+r,l=s.length>1&&Array.from(s).every((e=>e===s[0]))?s[0]:s;const c=li(e.slice(),l,o,a);function d(){clearTimeout(n.timer),n.timer=-1}return function e(t){n.keysSoFar=t,d(),""!==t&&(n.timer=+setTimeout((()=>{e(""),d()}),i))}(s),c}var di=Object.assign(ci,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:function(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}});var ui=e=>"object"==typeof e&&null!==e&&1===e.nodeType;var pi="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function gi(e){return!(!e||e.closest("[inert]"))&&(e.matches(pi)&&(!!ui(t=e)&&(t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0)));var t}function hi(e,t){if(!e)return[];const n=Array.from(e.querySelectorAll(pi)),o=n.filter(fi);return t&&fi(e)&&o.unshift(e),o.forEach(((e,t)=>{if((e=>ui(e)&&"IFRAME"===e.tagName)(e)&&e.contentDocument){const n=hi(e.contentDocument.body);o.splice(t,1,...n)}})),!o.length&&t?n:o}function fi(e){return null!=e&&e.tabIndex>0||gi(e)&&!(parseInt(e.getAttribute("tabindex")||"0",10)<0)}function mi(e){const{root:t,getInitialEl:n,filter:o,enabled:r=!0}=e;if(!r)return;let i=null;if(i||(i="function"==typeof n?n():n),i||(i=t?.querySelector("[data-autofocus],[autofocus]")),!i){const e=hi(t);i=o?e.filter(o)[0]:e[0]}return i||t||void 0}function bi(e){const t=e.currentTarget;if(!t)return!1;const[n,o]=function(e,t){const n=hi(e,t);return[n[0]||null,n[n.length-1]||null]}(t),r=t.ownerDocument||document;return(r.activeElement!==n||!e.shiftKey)&&(!(r.activeElement===o&&!e.shiftKey)&&!(!n&&!o))}function yi(e){if(null==e||!Yr(e))return!1;try{return e instanceof Qr(e).HTMLInputElement&&null!=e.selectionStart||/(textarea|select)/.test(e.localName)||e.isContentEditable}catch{return!1}}var vi=/auto|scroll|overlay|hidden|clip/;function wi(e){const t=globalThis.requestAnimationFrame(e);return()=>{globalThis.cancelAnimationFrame(t)}}function xi(e,t){const{defer:n}=t,o=n?wi:e=>e(),r=[];return r.push(o((()=>{const n="function"==typeof e?e():e;r.push(function(e,t){if(!e)return;const{attributes:n,callback:o}=t,r=new(e.ownerDocument.defaultView||window).MutationObserver((e=>{for(const t of e)"attributes"===t.type&&t.attributeName&&n.includes(t.attributeName)&&o(t)}));return r.observe(e,{attributes:!0,attributeFilter:n}),()=>r.disconnect()}(n,t))}))),()=>{r.forEach((e=>e?.()))}}function ki(e,t){return Array.from(e?.querySelectorAll(t)??[])}function _i(e){const t={getRootNode:e=>e.getRootNode?.()??document,getDoc:e=>Jr(t.getRootNode(e)),getWin:e=>t.getDoc(e).defaultView??window,getActiveElement:e=>t.getDoc(e).activeElement,isActiveElement:(e,n)=>n===t.getActiveElement(e),getById:(e,n)=>t.getRootNode(e).getElementById(n),setValue:(e,t)=>{if(null==e||null==t)return;const n=t.toString();e.value!==n&&(e.value=t.toString())}};return{...t,...e}}function Ti(e,t){const{rootEl:n,...o}=t||{};e&&n&&function(e){const t=Qr(e),{overflow:n,overflowX:o,overflowY:r,display:i}=t.getComputedStyle(e);return vi.test(n+r+o)&&!["inline","contents"].includes(i)}(n)&&function(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}(n)&&e.scrollIntoView(o)}var Si=new WeakMap;function Ei(e,t){if(!e)return()=>{};return function(e,t,n){Si.has(e)||Si.set(e,new Map);const o=Si.get(e),r=o.get(t);if(!r)return o.set(t,n()),()=>{o.get(t)?.(),o.delete(t)};const i=n(),a=()=>{i(),r(),o.delete(t)};return o.set(t,a),()=>{o.get(t)===a&&(i(),o.set(t,r))}}(e,"style",(()=>{const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}))}var Ci=1e3/60;function Pi(e,t){const n=[];return e?.forEach((e=>{const o=function(e,t){const n=e();if(Yr(n)&&n.isConnected)return t(n),()=>{};{const n=setInterval((()=>{const o=e();Yr(o)&&o.isConnected&&(t(o),clearInterval(n))}),Ci);return()=>clearInterval(n)}}(e,t);n.push(o)})),()=>{n.forEach((e=>e()))}}var Ii=e=>"Array"===e?.constructor.name,Oi=(e,t)=>{if(Object.is(e,t))return!0;if(null==e&&null!=t||null!=e&&null==t)return!1;if("function"==typeof e?.isEqual&&"function"==typeof t?.isEqual)return e.isEqual(t);if("function"==typeof e&&"function"==typeof t)return e.toString()===t.toString();if(Ii(e)&&Ii(t))return Array.from(e).toString()===Array.from(t).toString();if("object"!=typeof e||"object"!=typeof t)return!1;const n=Object.keys(t??Object.create(null)),o=n.length;for(let t=0;t<o;t++){if(!Reflect.has(e,n[t]))return!1}for(let r=0;r<o;r++){const o=n[r];if(!Oi(e[o],t[o]))return!1}return!0},Ai=(e,...t)=>("function"==typeof e?e(...t):e)??void 0,$i=()=>{},Ri=(...e)=>(...t)=>{e.forEach((function(e){e?.(...t)}))},Ni=(()=>{let e=0;return()=>(e++,e.toString(36))})(),Li=e=>"number"==typeof e&&!Number.isNaN(e),Di=e=>"function"==typeof e;function Mi(e){if(!Ui(e)||void 0===e)return e;const t=Reflect.ownKeys(e).filter((e=>"string"==typeof e)),n={};for(const o of t){const t=e[o];void 0!==t&&(n[o]=Mi(t))}return n}var Ui=e=>e&&"object"==typeof e&&e.constructor===Object;function Bi(...e){1===e.length?e[0]:e[1],2!==e.length||e[0]}var Fi=(e,t,n,o)=>{const r="function"==typeof e?e():e;return r?.addEventListener(t,n,o),()=>{r?.removeEventListener(t,n,o)}};var ji=e=>0===e.button,zi=e=>2===e.button||ti(/^Mac/)&&e.ctrlKey&&0===e.button;function Hi(e){if(!function(e){return e?.matches("a[href]")??!1}(e))return;const t=()=>e.click();ni()?function(e,t,n){const o=(e=>{const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})((()=>{e.removeEventListener(t,r,!0),n()})),r=()=>{o(),n()};e.addEventListener(t,r,{once:!0,capture:!0})}(e,"keyup",t):queueMicrotask(t)}function Vi(e,t,n){if(!e)return;const o=new(e.ownerDocument.defaultView||window).CustomEvent(t,n);return e.dispatchEvent(o)}var Gi={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Wi={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function qi(e,t={}){const{dir:n="ltr",orientation:o="horizontal"}=t;let{key:r}=e;r=Gi[r]??r;return"rtl"===n&&"horizontal"===o&&r in Wi&&(r=Wi[r]),r}function Ki(e,t="client"){return(e=>"touches"in e&&e.touches.length>0)(e)?function(e,t="client"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}(e,t):function(e,t="client"){return{x:e[`${t}X`],y:e[`${t}Y`]}}(e,t)}const Yi=Math.min,Xi=Math.max,Zi=Math.round,Ji=Math.floor,Qi=e=>({x:e,y:e}),ea={left:"right",right:"left",bottom:"top",top:"bottom"},ta={start:"end",end:"start"};function na(e,t,n){return Xi(e,Yi(t,n))}function oa(e,t){return"function"==typeof e?e(t):e}function ra(e){return e.split("-")[0]}function ia(e){return e.split("-")[1]}function aa(e){return"x"===e?"y":"x"}function sa(e){return"y"===e?"height":"width"}function la(e){return["top","bottom"].includes(ra(e))?"y":"x"}function ca(e){return aa(la(e))}function da(e){return e.replace(/start|end/g,(e=>ta[e]))}function ua(e){return e.replace(/left|right|bottom|top/g,(e=>ea[e]))}function pa(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function ga(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function ha(e,t,n){let{reference:o,floating:r}=e;const i=la(t),a=ca(t),s=sa(a),l=ra(t),c="y"===i,d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,p=o[s]/2-r[s]/2;let g;switch(l){case"top":g={x:d,y:o.y-r.height};break;case"bottom":g={x:d,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:u};break;case"left":g={x:o.x-r.width,y:u};break;default:g={x:o.x,y:o.y}}switch(ia(t)){case"start":g[a]-=p*(n&&c?-1:1);break;case"end":g[a]+=p*(n&&c?-1:1)}return g}async function fa(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:g=0}=oa(t,e),h=pa(g),f=s[p?"floating"===u?"reference":"floating":u],m=ga(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(f)))||n?f:f.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),b="floating"===u?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),v=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=ga(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:y,strategy:l}):b);return{top:(m.top-w.top+h.top)/v.y,bottom:(w.bottom-m.bottom+h.bottom)/v.y,left:(m.left-w.left+h.left)/v.x,right:(w.right-m.right+h.right)/v.x}}function ma(){return"undefined"!=typeof window}function ba(e){return wa(e)?(e.nodeName||"").toLowerCase():"#document"}function ya(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function va(e){var t;return null==(t=(wa(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function wa(e){return!!ma()&&(e instanceof Node||e instanceof ya(e).Node)}function xa(e){return!!ma()&&(e instanceof Element||e instanceof ya(e).Element)}function ka(e){return!!ma()&&(e instanceof HTMLElement||e instanceof ya(e).HTMLElement)}function _a(e){return!(!ma()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ya(e).ShadowRoot)}function Ta(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Oa(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Sa(e){return["table","td","th"].includes(ba(e))}function Ea(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Ca(e){const t=Pa(),n=xa(e)?Oa(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Pa(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Ia(e){return["html","body","#document"].includes(ba(e))}function Oa(e){return ya(e).getComputedStyle(e)}function Aa(e){return xa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $a(e){if("html"===ba(e))return e;const t=e.assignedSlot||e.parentNode||_a(e)&&e.host||va(e);return _a(t)?t.host:t}function Ra(e){const t=$a(e);return Ia(t)?e.ownerDocument?e.ownerDocument.body:e.body:ka(t)&&Ta(t)?t:Ra(t)}function Na(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Ra(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),a=ya(r);if(i){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}
2
+ import e from"extend";import"lodash.mapvalues";import t from"direction";import n from"lodash/debounce";import r from"lodash/throttle";import"escape-html";function o(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function i(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];var o;return t[n]=Object.assign({},r),l(r.value)&&(o=r.value,"[object Function]"!==Object.prototype.toString.call(o))&&!Array.isArray(r.value)&&(t[n].value=Object.assign({},r.value)),Array.isArray(r.value)&&(t[n].value=r.value.slice(0)),t},{})}function a(e){if(e)try{return JSON.parse(e)}catch(t){return e}}function s(e,t,n,r){if(null==n||!1===n)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,"true"===o&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function l(e){return null!=e&&("object"==typeof e||"function"==typeof e)}let u;function c(e,t){const n=Object.keys(t);return class extends e{static get observedAttributes(){return n.map(e=>t[e].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={};for(let e of n)this[e]=void 0}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=function(e,t){const n=i(t);return Object.keys(t).forEach(t=>{const r=n[t],o=e.getAttribute(r.attribute),i=e[t];null!=o&&(r.value=r.parse?a(o):o),null!=i&&(r.value=Array.isArray(i)?i.slice(0):i),r.reflect&&s(e,r.attribute,r.value,!!r.parse),Object.defineProperty(e,t,{get:()=>r.value,set(e){const n=r.value;r.value=e,r.reflect&&s(this,r.attribute,r.value,!!r.parse);for(let r=0,o=this.__propertyChangedCallbacks.length;r<o;r++)this.__propertyChangedCallbacks[r](t,e,n)},enumerable:!0,configurable:!0})}),n}(this,t);const e=function(e){return Object.keys(e).reduce((t,n)=>(t[n]=e[n].value,t),{})}(this.props),n=this.Component,r=u;try{u=this,this.__initialized=!0,!function(e){return"function"==typeof e&&0===e.toString().indexOf("class")}(n)?n(e,{element:this}):new n(e,{element:this})}finally{u=r}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let e=null;for(;e=this.__releaseCallbacks.pop();)e(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(e,n,r){if(this.__initialized&&!this.__updating[e]&&(e=this.lookupProp(e))in t){if(null==r&&!this[e])return;this[e]=t[e].parse?a(r):r}}lookupProp(e){if(t)return n.find(n=>e===n||e===t[n].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(e){this.__releaseCallbacks.push(e)}addPropertyChangedCallback(e){this.__propertyChangedCallbacks.push(e)}}}function d(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:o,customElements:i=window.customElements}=n;return n=>{if(!e)throw new Error("tag is required to register a Component");let a=i.get(e);return a?(a.prototype.Component=n,a):(a=c(r,function(e){return e?Object.keys(e).reduce((t,n)=>{const r=e[n];return t[n]=l(r)&&"value"in r?r:{value:r},t[n].attribute||(t[n].attribute=n.replace(/\.?([A-Z]+)/g,(e,t)=>"-"+t.toLowerCase()).replace("_","-").replace(/^-/,"")),t[n].parse="parse"in t[n]?t[n].parse:"string"!=typeof t[n].value,t},{}):{}}(t)),a.prototype.Component=n,a.prototype.registeredTag=e,i.define(e,a,o),a)}}const p={context:void 0},f=Symbol("solid-proxy"),h=Symbol("solid-track"),g=Symbol("solid-dev-component"),m={equals:(e,t)=>e===t};let v=K;const y=1,b=2,w={owned:null,cleanups:null,context:null,owner:null};var E=null;let _=null,x=null,k=null,C=null,S=0;const[T,D]=O(!1);function A(e,t){const n=x,r=E,o=0===e.length,i=o?w:{owned:null,cleanups:null,context:null,owner:void 0===t?r:t},a=o?e:()=>e(()=>R(()=>Q(i)));E=i,x=null;try{return G(a,!0)}finally{x=n,E=r}}function O(e,t){const n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},m,t):m).equals||void 0};return[z.bind(n),e=>("function"==typeof e&&(e=e(n.value)),H(n,e))]}function P(e,t,n){V(W(e,t,!1,y))}function I(e,t,n){v=Y;const r=W(e,t,!1,y);n&&n.render||(r.user=!0),C?C.push(r):V(r)}function N(e,t,n){n=n?Object.assign({},m,n):m;const r=W(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,V(r),z.bind(r)}function R(e){if(null===x)return e();const t=x;x=null;try{return e()}finally{x=t}}function B(e){I(()=>R(e))}function F(e){return null===E||(null===E.cleanups?E.cleanups=[e]:E.cleanups.push(e)),e}function L(){return x}function M(){return E}function U(e,t){const n=Symbol("context");return{id:n,Provider:ne(n),defaultValue:e}}function j(e){let t;return void 0!==(t=ee(E,e.id))?t:e.defaultValue}function $(e){const t=N(e),n=N(()=>te(t()));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function z(){if(this.sources&&this.state)if(this.state===y)V(this);else{const e=k;k=null,G(()=>Z(this),!1),k=e}if(x){const e=this.observers?this.observers.length:0;x.sources?(x.sources.push(this),x.sourceSlots.push(e)):(x.sources=[this],x.sourceSlots=[e]),this.observers?(this.observers.push(x),this.observerSlots.push(x.sources.length-1)):(this.observers=[x],this.observerSlots=[x.sources.length-1])}return this.value}function H(e,t,n){let r=e.value;return e.comparator&&e.comparator(r,t)||(e.value=t,e.observers&&e.observers.length&&G(()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],r=_&&_.running;r&&_.disposed.has(n),(r?n.tState:n.state)||(n.pure?k.push(n):C.push(n),n.observers&&X(n)),r||(n.state=y)}if(k.length>1e6)throw k=[],new Error},!1)),t}function V(e){if(!e.fn)return;Q(e);const t=E,n=x,r=S;x=E=e,function(e,t,n){let r;try{r=e.fn(t)}catch(t){return e.pure&&(e.state=y,e.owned&&e.owned.forEach(Q),e.owned=null),e.updatedAt=n+1,J(t)}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?H(e,r):e.value=r,e.updatedAt=n)}(e,e.value,r),x=n,E=t}function W(e,t,n,r=y,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:E,context:null,pure:n};return null===E||E!==w&&(E.owned?E.owned.push(i):E.owned=[i]),i}function q(e){if(0===e.state)return;if(e.state===b)return Z(e);if(e.suspense&&R(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<S);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if((e=t[n]).state===y)V(e);else if(e.state===b){const n=k;k=null,G(()=>Z(e,t[0]),!1),k=n}}function G(e,t){if(k)return e();let n=!1;t||(k=[]),C?n=!0:C=[],S++;try{const t=e();return function(e){k&&(K(k),k=null);if(e)return;const t=C;C=null,t.length&&G(()=>v(t),!1)}(n),t}catch(e){n||(C=null),k=null,J(e)}}function K(e){for(let t=0;t<e.length;t++)q(e[t])}function Y(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:q(r)}for(t=0;t<n;t++)q(e[t])}function Z(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const e=r.state;e===y?r!==t&&(!r.updatedAt||r.updatedAt<S)&&q(r):e===b&&Z(r,t)}}}function X(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=b,n.pure?k.push(n):C.push(n),n.observers&&X(n))}}function Q(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Q(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function J(e,t=E){const n=function(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}(e);throw n}function ee(e,t){return e?e.context&&void 0!==e.context[t]?e.context[t]:ee(e.owner,t):void 0}function te(e){if("function"==typeof e&&!e.length)return te(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=te(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function ne(e,t){return function(t){let n;return P(()=>n=R(()=>(E.context={[e]:t.value},$(()=>t.children))),void 0),n}}const re=Symbol("fallback");function oe(e){for(let t=0;t<e.length;t++)e[t]()}function ie(e,t){return R(()=>e(t||{}))}function ae(){return!0}const se={get:(e,t,n)=>t===f?n:e.get(t),has:(e,t)=>t===f||e.has(t),set:ae,deleteProperty:ae,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:ae,deleteProperty:ae}),ownKeys:e=>e.keys()};function le(e){return(e="function"==typeof e?e():e)?e:{}}function ue(){for(let e=0,t=this.length;e<t;++e){const t=this[e]();if(void 0!==t)return t}}function ce(...e){let t=!1;for(let n=0;n<e.length;n++){const r=e[n];t=t||!!r&&f in r,e[n]="function"==typeof r?(t=!0,N(r)):r}if(t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const r=le(e[n])[t];if(void 0!==r)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in le(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(le(e[n])));return[...new Set(t)]}},se);const n={},r={},o=new Set;for(let t=e.length-1;t>=0;t--){const i=e[t];if(!i)continue;const a=Object.getOwnPropertyNames(i);for(let e=0,t=a.length;e<t;e++){const t=a[e];if("__proto__"===t||"constructor"===t)continue;const s=Object.getOwnPropertyDescriptor(i,t);if(o.has(t)){const e=r[t];e?s.get?e.push(s.get.bind(i)):void 0!==s.value&&e.push(()=>s.value):void 0===n[t]&&(n[t]=s.value)}else s.get?(o.add(t),Object.defineProperty(n,t,{enumerable:!0,configurable:!0,get:ue.bind(r[t]=[s.get.bind(i)])})):(void 0!==s.value&&o.add(t),n[t]=s.value)}}return n}function de(e,...t){if(f in e){const n=new Set(t.length>1?t.flat():t[0]),r=t.map(t=>new Proxy({get:n=>t.includes(n)?e[n]:void 0,has:n=>t.includes(n)&&n in e,keys:()=>t.filter(t=>t in e)},se));return r.push(new Proxy({get:t=>n.has(t)?void 0:e[t],has:t=>!n.has(t)&&t in e,keys:()=>Object.keys(e).filter(e=>!n.has(e))},se)),r}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),a=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let s=!1,l=0;for(const e of t)e.includes(o)&&(s=!0,a?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;s||(a?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}let pe=0;function fe(){const e=p.context;return e?`${e.id}${e.count++}`:"cl-"+pe++}const he=e=>`Stale read from <${e}>.`;function ge(e){const t="fallback"in e&&{fallback:()=>e.fallback};return N(function(e,t,n={}){let r=[],o=[],i=[],a=0,s=t.length>1?[]:null;return F(()=>oe(i)),()=>{let l,u,c=e()||[];return c[h],R(()=>{let e,t,p,f,h,g,m,v,y,b=c.length;if(0===b)0!==a&&(oe(i),i=[],r=[],o=[],a=0,s&&(s=[])),n.fallback&&(r=[re],o[0]=A(e=>(i[0]=e,n.fallback())),a=1);else if(0===a){for(o=new Array(b),u=0;u<b;u++)r[u]=c[u],o[u]=A(d);a=b}else{for(p=new Array(b),f=new Array(b),s&&(h=new Array(b)),g=0,m=Math.min(a,b);g<m&&r[g]===c[g];g++);for(m=a-1,v=b-1;m>=g&&v>=g&&r[m]===c[v];m--,v--)p[v]=o[m],f[v]=i[m],s&&(h[v]=s[m]);for(e=new Map,t=new Array(v+1),u=v;u>=g;u--)y=c[u],l=e.get(y),t[u]=void 0===l?-1:l,e.set(y,u);for(l=g;l<=m;l++)y=r[l],u=e.get(y),void 0!==u&&-1!==u?(p[u]=o[l],f[u]=i[l],s&&(h[u]=s[l]),u=t[u],e.set(y,u)):i[l]();for(u=g;u<b;u++)u in p?(o[u]=p[u],i[u]=f[u],s&&(s[u]=h[u],s[u](u))):o[u]=A(d);o=o.slice(0,a=b),r=c.slice(0)}return o});function d(e){if(i[u]=e,s){const[e,n]=O(u);return s[u]=n,t(c[u],e)}return t(c[u])}}}(()=>e.each,e.children,t||void 0))}function me(e){const t="fallback"in e&&{fallback:()=>e.fallback};return N(function(e,t,n={}){let r,o=[],i=[],a=[],s=[],l=0;return F(()=>oe(a)),()=>{const u=e()||[];return u[h],R(()=>{if(0===u.length)return 0!==l&&(oe(a),a=[],o=[],i=[],l=0,s=[]),n.fallback&&(o=[re],i[0]=A(e=>(a[0]=e,n.fallback())),l=1),i;for(o[0]===re&&(a[0](),a=[],o=[],i=[],l=0),r=0;r<u.length;r++)r<o.length&&o[r]!==u[r]?s[r](()=>u[r]):r>=o.length&&(i[r]=A(c));for(;r<o.length;r++)a[r]();return l=s.length=a.length=u.length,o=u.slice(0),i=i.slice(0,l)});function c(e){a[r]=e;const[n,o]=O(u[r]);return s[r]=o,t(n,r)}}}(()=>e.each,e.children,t||void 0))}function ve(e){const t=e.keyed,n=N(()=>e.when,void 0,{equals:(e,n)=>t?e===n:!e==!n});return N(()=>{const r=n();if(r){const o=e.children;return"function"==typeof o&&o.length>0?R(()=>o(t?r:()=>{if(!R(n))throw he("Show");return e.when})):o}return e.fallback},void 0,void 0)}function ye(e){let t=!1;const n=$(()=>e.children),r=N(()=>{let e=n();Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++){const r=e[n].when;if(r)return t=!!e[n].keyed,[n,r,e[n]]}return[-1]},void 0,{equals:(e,n)=>e[0]===n[0]&&(t?e[1]===n[1]:!e[1]==!n[1])&&e[2]===n[2]});return N(()=>{const[n,o,i]=r();if(n<0)return e.fallback;const a=i.children;return"function"==typeof a&&a.length>0?R(()=>a(t?o:()=>{if(R(r)[0]!==n)throw he("Match");return i.when})):a},void 0,void 0)}function be(e){return e}const we=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),Ee=new Set(["innerHTML","textContent","innerText","children"]),_e=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),xe=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});const ke=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Ce=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Se={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};const Te="_$DX_DELEGATE";function De(e,t,n){let r;const o=()=>{const t=document.createElement("template");return t.innerHTML=e,n?t.content.firstChild.firstChild:t.content.firstChild},i=t?()=>R(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Ae(e,t=window.document){const n=t[Te]||(t[Te]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,Me))}}function Oe(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function Pe(e,t){null==t?e.removeAttribute("class"):e.className=t}function Ie(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n)}function Ne(e,t={},n,r){const o={};return r||P(()=>o.children=Ue(e,t.children,o.children)),P(()=>t.ref&&t.ref(e)),P(()=>function(e,t,n,r,o={},i=!1){t||(t={});for(const r in o)if(!(r in t)){if("children"===r)continue;o[r]=Le(e,r,null,o[r],n,i)}for(const r in t){if("children"===r)continue;const a=t[r];o[r]=Le(e,r,a,o[r],n,i)}}(e,t,n,0,o,!0)),o}function Re(e,t,n){return R(()=>e(t,n))}function Be(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return Ue(e,t,r,n);P(r=>Ue(e,t(),r,n),r)}function Fe(e,t,n){const r=t.trim().split(/\s+/);for(let t=0,o=r.length;t<o;t++)e.classList.toggle(r[t],n)}function Le(e,t,n,r,o,i){let a,s,l,u,c;if("style"===t)return function(e,t,n){if(!t)return n?Oe(e,"style"):t;const r=e.style;if("string"==typeof t)return r.cssText=t;let o,i;for(i in"string"==typeof n&&(r.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}(e,n,r);if("classList"===t)return function(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,a;for(i=0,a=o.length;i<a;i++){const r=o[i];r&&"undefined"!==r&&!t[r]&&(Fe(e,r,!1),delete n[r])}for(i=0,a=r.length;i<a;i++){const o=r[i],a=!!t[o];o&&"undefined"!==o&&n[o]!==a&&a&&(Fe(e,o,!0),n[o]=a)}return n}(e,n,r);if(n===r)return r;if("ref"===t)i||n(e);else if("on:"===t.slice(0,3)){const o=t.slice(3);r&&e.removeEventListener(o,r),n&&e.addEventListener(o,n)}else if("oncapture:"===t.slice(0,10)){const o=t.slice(10);r&&e.removeEventListener(o,r,!0),n&&e.addEventListener(o,n,!0)}else if("on"===t.slice(0,2)){const o=t.slice(2).toLowerCase(),i=ke.has(o);if(!i&&r){const t=Array.isArray(r)?r[0]:r;e.removeEventListener(o,t)}(i||n)&&(Ie(e,o,n,i),i&&Ae([o]))}else if("attr:"===t.slice(0,5))Oe(e,t.slice(5),n);else if((c="prop:"===t.slice(0,5))||(l=Ee.has(t))||!o&&((u=function(e,t){const n=xe[e];return"object"==typeof n?n[t]?n.$:void 0:n}(t,e.tagName))||(s=we.has(t)))||(a=e.nodeName.includes("-")))c&&(t=t.slice(5),s=!0),"class"===t||"className"===t?Pe(e,n):!a||s||l?e[u||t]=n:e[(d=t,d.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase()))]=n;else{const r=o&&t.indexOf(":")>-1&&Se[t.split(":")[0]];r?function(e,t,n,r){null==r?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}(e,r,t,n):Oe(e,_e[t]||t,n)}var d;return n}function Me(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>n||document});n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(void 0!==o?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Ue(e,t,n,r,o){for(;"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,a=void 0!==r;if(e=a&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i)if("number"===i&&(t=t.toString()),a){let o=n[0];o&&3===o.nodeType?o.data=t:o=document.createTextNode(t),n=ze(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t;else if(null==t||"boolean"===i)n=ze(e,n,r);else{if("function"===i)return P(()=>{let o=t();for(;"function"==typeof o;)o=o();n=Ue(e,o,n,r)}),()=>n;if(Array.isArray(t)){const i=[],s=n&&Array.isArray(n);if(je(i,t,n,o))return P(()=>n=Ue(e,i,n,r,!0)),()=>n;if(0===i.length){if(n=ze(e,n,r),a)return n}else s?0===n.length?$e(e,i,r):function(e,t,n){let r=n.length,o=t.length,i=r,a=0,s=0,l=t[o-1].nextSibling,u=null;for(;a<o||s<i;)if(t[a]!==n[s]){for(;t[o-1]===n[i-1];)o--,i--;if(o===a){const t=i<r?s?n[s-1].nextSibling:n[i-s]:l;for(;s<i;)e.insertBefore(n[s++],t)}else if(i===s)for(;a<o;)u&&u.has(t[a])||t[a].remove(),a++;else if(t[a]===n[i-1]&&n[s]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!u){u=new Map;let e=s;for(;e<i;)u.set(n[e],e++)}const r=u.get(t[a]);if(null!=r)if(s<r&&r<i){let l,c=a,d=1;for(;++c<o&&c<i&&null!=(l=u.get(t[c]))&&l===r+d;)d++;if(d>r-s){const o=t[a];for(;s<r;)e.insertBefore(n[s++],o)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}else a++,s++}(e,n,i):(n&&ze(e),$e(e,i));n=i}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=ze(e,n,r,t);ze(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}else console.warn("Unrecognized value. Skipped inserting",t)}return n}function je(e,t,n,r){let o=!1;for(let i=0,a=t.length;i<a;i++){let a,s=t[i],l=n&&n[i];if(null==s||!0===s||!1===s);else if("object"==(a=typeof s)&&s.nodeType)e.push(s);else if(Array.isArray(s))o=je(e,s,l)||o;else if("function"===a)if(r){for(;"function"==typeof s;)s=s();o=je(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||o}else e.push(s),o=!0;else{const t=String(s);l&&3===l.nodeType&&l.data===t?e.push(l):e.push(document.createTextNode(t))}}return o}function $e(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function ze(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const t=a.parentNode===e;r||i?t&&a.remove():t?e.replaceChild(o,a):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}function He(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function Ve(e){const{useShadow:t}=e,n=document.createTextNode(""),r=M();let o;return I(()=>{o||(o=function(e,t){const n=E,r=x;E=e,x=null;try{return G(t,!0)}catch(e){J(e)}finally{E=n,x=r}}(r,()=>N(()=>e.children)));const i=e.mount||document.body;if(i instanceof HTMLHeadElement){const[e,t]=O(!1),n=()=>t(!0);A(t=>Be(i,()=>e()?t():o(),null)),F(n)}else{const r=He(e.isSVG?"g":"div",e.isSVG),a=t&&r.attachShadow?r.attachShadow({mode:"open"}):r;Object.defineProperty(r,"_$host",{get:()=>n.parentNode,configurable:!0}),Be(a,o),i.appendChild(r),e.ref&&e.ref(r),F(()=>i.removeChild(r))}},void 0,{render:!0}),n}function We(e){const[t,n]=de(e,["component"]),r=N(()=>t.component);return N(()=>{const e=r();switch(typeof e){case"function":return Object.assign(e,{[g]:!0}),R(()=>e(n));case"string":const t=Ce.has(e),r=He(e,t);return Ne(r,n,t),r}})}function qe(e){return(t,n)=>{const{element:r}=n;return A(o=>{const i=function(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=O(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(e){i(()=>e)}})}return n}(t);r.addPropertyChangedCallback((e,t)=>i[e]=t),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const a=e(i,n);return Be(r.renderRoot,a)},function(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&(!t.assignedSlot||!t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}(r))}}function Ge(e,t,n){return 2===arguments.length&&(n=t,t={}),d(e,t)(qe(n))}const Ke={bot:void 0,onNewBlock:void 0,onAnswer:void 0,onEnd:void 0,onInit:void 0,onNewLogs:void 0,isPreview:void 0,startFrom:void 0,prefilledVariables:void 0,apiHost:void 0,resultId:void 0,sessionId:void 0},Ye={...Ke,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},Ze={...Ke,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,autoShowDelay:void 0};var Xe='/*! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.\\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-right-2{right:-8px}.-top-2{top:-8px}.bottom-5{bottom:20px}.left-0{left:0}.left-1\\/2{left:50%}.left-5{left:20px}.right-0{right:0}.right-2{right:8px}.right-5{right:20px}.top-0{top:0}.top-1\\/2{top:50%}.top-2{top:8px}.\\!z-50{z-index:50!important}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[42424242\\]{z-index:42424242}.m-auto{margin:auto}.-mr-1{margin-right:-4px}.-mt-1{margin-top:-4px}.ml-2{margin-left:8px}.mt-0{margin-top:0}.mt-0\\.5{margin-top:2px}.mt-2{margin-top:8px}.mt-4{margin-top:16px}.\\!block{display:block!important}.block{display:block}.\\!flex{display:flex!important}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.\\!h-10{height:40px!important}.h-10{height:40px}.h-2{height:8px}.h-2\\.5{height:10px}.h-3{height:12px}.h-4{height:16px}.h-5{height:20px}.h-6{height:24px}.h-8{height:32px}.h-\\[25px\\]{height:25px}.h-\\[48px\\]{height:48px}.h-\\[56px\\]{height:56px}.h-\\[58px\\]{height:58px}.h-\\[60\\%\\]{height:60%}.h-\\[80vh\\]{height:80vh}.h-full{height:100%}.h-screen{height:100vh}.max-h-80{max-height:320px}.max-h-\\[150px\\]{max-height:150px}.max-h-\\[200px\\]{max-height:200px}.min-h-full{min-height:100%}.w-10{width:40px}.w-2{width:8px}.w-3{width:12px}.w-4{width:16px}.w-5{width:20px}.w-6{width:24px}.w-8{width:32px}.w-\\[35px\\]{width:35px}.w-\\[48px\\]{width:48px}.w-\\[58px\\]{width:58px}.w-\\[60\\%\\]{width:60%}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\\[200px\\]{min-width:200px}.min-w-\\[250px\\]{min-width:250px}.max-w-\\[256px\\]{max-width:256px}.max-w-\\[350px\\]{max-width:350px}.max-w-\\[90\\%\\]{max-width:90%}.max-w-full{max-width:100%}.max-w-lg{max-width:512px}.max-w-xs{max-width:320px}.flex-1{flex:1 1 0%}.flex-\\[9\\]{flex:9}.flex-none{flex:none}.flex-shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.-rotate-180{--tw-rotate:-180deg}.-rotate-180,.rotate-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate:0deg}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.scale-0,.scale-100{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in .3s ease-out}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.\\!items-center{align-items:center!important}.items-center{align-items:center}.justify-end{justify-content:flex-end}.\\!justify-center{justify-content:center!important}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.\\!gap-2{gap:8px!important}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-6{gap:24px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.scroll-smooth{scroll-behavior:smooth}.text-ellipsis{text-overflow:ellipsis}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:6px}.rounded-t-\\[var\\(--quickbot-button-border-radius\\)\\]{border-top-left-radius:var(--quickbot-button-border-radius);border-top-right-radius:var(--quickbot-button-border-radius)}.border{border-width:1px}.border-2{border-width:2px}.\\!border-t{border-top-width:1px!important}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.\\!border-black\\/\\[0\\.08\\]{border-color:rgba(0,0,0,.08)!important}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}.\\!bg-black\\/\\[0\\.04\\]{background-color:rgba(0,0,0,.04)!important}.bg-\\[rgba\\(0\\2c 0\\2c 0\\2c 0\\.5\\)\\]{background-color:rgba(0,0,0,.5)}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-black\\/20{background-color:rgba(0,0,0,.2)}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(96 165 250/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-green-400{--tw-bg-opacity:1;background-color:rgb(74 222 128/var(--tw-bg-opacity))}.bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity))}.bg-pink-400{--tw-bg-opacity:1;background-color:rgb(244 114 182/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:0.5}.fill-transparent{fill:transparent}.stroke-2{stroke-width:2}.object-cover{-o-object-fit:cover;object-fit:cover}.\\!p-3{padding:12px!important}.p-0{padding:0}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.px-2{padding-left:8px;padding-right:8px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-5{padding-left:20px;padding-right:20px}.px-8{padding-left:32px;padding-right:32px}.py-10{padding-bottom:40px;padding-top:40px}.py-2{padding-bottom:8px;padding-top:8px}.py-3{padding-bottom:12px;padding-top:12px}.py-4{padding-bottom:16px;padding-top:16px}.py-6{padding-bottom:24px;padding-top:24px}.pb-0{padding-bottom:0}.pl-2{padding-left:8px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pr-4{padding-right:16px}.pt-2{padding-top:8px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.\\!text-xs{font-size:12px!important;line-height:16px!important}.text-2xl{font-size:24px;line-height:32px}.text-4xl{font-size:36px;line-height:40px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.text-xs{font-size:12px;line-height:16px}.\\!font-normal{font-weight:400!important}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.\\!leading-3{line-height:12px!important}.leading-relaxed{line-height:1.625}.\\!text-black\\/60{color:rgba(0,0,0,.6)!important}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.\\!no-underline{text-decoration-line:none!important}.\\!opacity-100{opacity:1!important}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.blur{--tw-blur:blur(8px)}.blur,.brightness-150{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-150{--tw-brightness:brightness(1.5)}.brightness-200{--tw-brightness:brightness(2)}.brightness-200,.brightness-95{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-95{--tw-brightness:brightness(.95)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[width\\]{transition-duration:.15s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.delay-200{transition-delay:.2s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-\\[250ms\\]{transition-duration:.25s}.duration-\\[400ms\\]{transition-duration:.4s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}:root{--quickbot-host-bubble-color:#202020;--quickbot-host-bubble-bg-rgb:245,245,245;--quickbot-host-bubble-opacity:1;--quickbot-host-bubble-border-width:0;--quickbot-host-bubble-border-rgb:0,0,0;--quickbot-host-bubble-border-opacity:0;--quickbot-host-bubble-border-radius:20px;--quickbot-host-bubble-box-shadow:0 0 #0000;--quickbot-host-bubble-blur:0px}@keyframes chatBubbles{0%{transform:translateY(2.5)}50%{transform:translateY(-2.5px)}to{transform:translateY(0)}}@keyframes fadeInFromTop{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOutFromTop{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes fadeInFromBottom{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOutFromBottom{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}.quickbot{background-color:#fff;font-family:var(--quickbot-container-font-family),-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}.conversation-container{backdrop-filter:blur(var(--quickbot-chat-container-blur));background-color:rgba(var(--quickbot-chat-container-bg-rgb),var(--quickbot-chat-container-opacity));background-image:var(--quickbot-chat-container-bg-image);background-position:50%;background-repeat:no-repeat;background-size:cover;border-color:rgba(var(--quickbot-chat-container-border-rgb),var(--quickbot-chat-container-border-opacity));border-width:var(--quickbot-chat-container-border-width);box-shadow:var(--quickbot-chat-container-box-shadow);color:rgb(var(--quickbot-chat-container-color))}.conversation-container__body::-webkit-scrollbar{display:none}.conversation-container__body{-ms-overflow-style:none;scrollbar-width:none}.bubble{border-radius:var(--quickbot-host-bubble-border-radius);max-height:70vh;max-width:100%;min-height:2rem;min-width:2.5rem;overflow:auto;padding:8px 16px;transition-delay:.2s;transition-duration:.4s;transition-property:opacity;transition-timing-function:ease-in;will-change:opacity;z-index:10}.bubble--host{backdrop-filter:blur(var(--quickbot-host-bubble-blur));background-color:rgba(var(--quickbot-host-bubble-bg-rgb),var(--quickbot-host-bubble-opacity));border-color:rgba(var(--quickbot-host-bubble-border-rgb),var(--quickbot-host-bubble-border-opacity));border-radius:var(--quickbot-host-bubble-border-radius);border-width:var(--quickbot-host-bubble-border-width);box-shadow:var(--quickbot-host-bubble-box-shadow);color:var(--quickbot-host-bubble-color);height:100%;width:100%}.bubble--typing{align-items:center;display:flex;height:2rem!important;justify-content:center;min-width:64px!important;overflow:visible!important;width:auto!important}.bubble--guest{backdrop-filter:blur(var(--quickbot-guest-bubble-blur));background-color:rgba(var(--quickbot-guest-bubble-bg-rgb),var(--quickbot-guest-bubble-opacity));border-color:rgba(var(--quickbot-guest-bubble-border-rgb),var(--quickbot-guest-bubble-border-opacity));border-radius:var(--quickbot-guest-bubble-border-radius);border-width:var(--quickbot-guest-bubble-border-width);box-shadow:var(--quickbot-guest-bubble-box-shadow);color:var(--quickbot-guest-bubble-color)}.button{backdrop-filter:blur(var(--quickbot-button-blur));background-color:rgba(var(--quickbot-button-bg-rgb),var(--quickbot-button-opacity));border-color:rgba(var(--quickbot-button-border-rgb),var(--quickbot-button-border-opacity));border-radius:var(--quickbot-host-bubble-border-radius);border-radius:var(--quickbot-button-border-radius);border-width:var(--quickbot-button-border-width);box-shadow:var(--quickbot-button-box-shadow);color:var(--quickbot-button-color);height:auto;max-height:70vh;max-height:none;max-width:100%;min-height:2rem;min-height:auto;min-width:2.5rem;overflow:auto;overflow:visible;padding:8px 16px;transition-delay:.2s;transition-duration:.4s;transition-property:opacity;transition-timing-function:ease-in;will-change:opacity;z-index:10}.button--selectable:hover{background-color:rgba(var(--quickbot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.15));border-color:rgba(var(--quickbot-button-border-rgb),calc(var(--selectable-alpha-ratio)*.35));box-shadow:0 2px 4px rgba(0,0,0,.1)}.button--selectable:active{box-shadow:0 1px 2px rgba(0,0,0,.1)}.button--selected{background-color:rgba(var(--quickbot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.25));border-color:rgba(var(--quickbot-button-border-rgb),calc(var(--selectable-alpha-ratio)*.45));box-shadow:0 2px 6px rgba(var(--quickbot-button-bg-rgb),.2)}.button__checkbox{background-color:rgba(var(--quickbot-checkbox-bg-rgb));color:var(--quickbot-button-color);padding:1px;transition:all .3s ease}.button__checkbox--checked{background-color:rgb(var(--quickbot-button-bg-rgb))}.button--has-image{display:flex;filter:none;flex-direction:column;justify-content:space-between;padding:0;transition:all .3s;width:236px}.button--has-image:focus{outline:none}.button--has-image:hover{filter:brightness(.9)}.button--has-image:active{filter:brightness(.75)}.slate-bold{font-weight:700}.slate-italic{font-style:oblique}.slate-html-container u,.slate-underline{text-decoration:underline}.bubble__dot--1,.bubble__dot--2,.bubble__dot--3{background-color:var(--quickbot-host-bubble-color);opacity:.5}.bubble__dot--1,.bubble__dot--2{animation:chatBubbles 1s ease-in-out infinite}.bubble__dot--2{animation-delay:.3s}.bubble__dot--3{animation:chatBubbles 1s ease-in-out infinite;animation-delay:.5s}.input__field{backdrop-filter:blur(var(--quickbot-input-blur));background-color:rgba(var(--quickbot-input-bg-rgb),var(--quickbot-input-opacity));box-shadow:var(--quickbot-input-box-shadow);color:var(--quickbot-input-color)}.input__field::-moz-placeholder{color:var(--quickbot-input-placeholder-color)!important;opacity:1!important}.input__field::placeholder{color:var(--quickbot-input-placeholder-color)!important;opacity:1!important}.input__field--date{border-radius:var(--quickbot-input-border-radius);color-scheme:light}.input__field--date,.input__field--phone{background-color:var(--quickbot-input-bg-color);color:var(--quickbot-input-color)}.input__field--phone{border-radius:var(--quickbot-button-border-radius)}.input__field--rating{align-items:center;border-radius:50%;display:flex;justify-content:center;padding:6px;transition:all .2s ease}.input__field--rating:hover{background-color:rgba(var(--quickbot-button-bg-rgb),.06)}.input__field--rating svg{stroke:rgb(var(--quickbot-button-bg-rgb));stroke-width:2;fill:transparent;height:32px;transition:fill .2s ease;width:32px}.input__field--rating:hover svg{fill:rgba(var(--quickbot-button-bg-rgb),.15)}.input__field--rating--selected{background-color:rgba(var(--quickbot-button-bg-rgb),.04)}.input__field--rating--selected svg{fill:rgb(var(--quickbot-button-bg-rgb))}.input__field--error{color:var(--quickbot-input-color)}.input__field--upload{border-radius:var(--quickbot-input-border-radius);transition:border-color .1s ease-out}.input__field--upload--dragging{border-color:rgb(var(--quickbot-button-bg-rgb))}.input__field--upload__progress-bar{background-color:rgb(var(--quickbot-button-bg-rgb))}.input__field--upload__progress-bar,.toast--popup-blocked{border-radius:var(--quickbot-input-border-radius)}select option{background-color:var(--quickbot-input-bg-color);color:var(--quickbot-input-color)}.progress-bar{background-color:rgba(var(--quickbot-progress-bar-bg-rgb),calc(var(--selectable-alpha-ratio)*.12));bottom:var(--quickbot-progress-bar-bottom);height:var(--quickbot-progress-bar-height);position:var(--quickbot-progress-bar-position);top:var(--quickbot-progress-bar-top)}.progress-bar>.progress-bar__fill{background-color:var(--quickbot-progress-bar-color)}.recorder .recorder__left-gradient{background-image:linear-gradient(to right,rgba(var(--quickbot-input-bg-rgb),1),rgba(var(--quickbot-input-bg-rgb),0))}.recorder .recorder__right-gradient{background-image:linear-gradient(to left,rgba(var(--quickbot-input-bg-rgb),1),rgba(var(--quickbot-input-bg-rgb),0))}.recorder button{background-color:rgba(var(--quickbot-button-bg-rgb),.3);color:rgba(var(--quickbot-button-bg-rgb))}[data-scope=menu][data-part=content]{backdrop-filter:blur(var(--quickbot-input-blur));border-color:rgba(var(--quickbot-input-border-rgb),var(--quickbot-input-border-opacity));border-width:var(--quickbot-input-border-width);box-shadow:var(--quickbot-input-box-shadow);color:var(--quickbot-input-color)}[data-scope=menu][data-part=content],[data-scope=menu][data-part=item]{background-color:rgba(var(--quickbot-input-bg-rgb),var(--quickbot-input-opacity));border-radius:var(--quickbot-input-border-radius)}[data-scope=menu][data-part=item]{cursor:pointer}[data-scope=menu][data-part=content][data-state=open]{animation:fadeInFromTop .15s ease-out forwards}[data-scope=menu][data-part=content][data-state=closed]{animation:fadeOutFromTop 50ms ease-out forwards}[data-scope=toast][data-part=group]{width:100%}[data-scope=toast][data-part=root]{background-color:rgba(var(--quickbot-input-bg-rgb),var(--quickbot-input-opacity));border-radius:var(--quickbot-chat-container-border-radius);box-shadow:var(--quickbot-input-box-shadow);color:var(--quickbot-input-color);display:flex;flex-direction:column;gap:4px;max-width:60vw;padding:16px 32px 16px 16px}[data-scope=toast][data-part=title]{font-weight:600}[data-scope=toast][data-part=description]{font-size:14px;line-height:20px}[data-scope=toast][data-part=root][data-state=open]{animation:fadeInFromBottom .15s ease-out forwards}[data-scope=toast][data-part=root][data-state=closed]{animation:fadeOutFromBottom 50ms ease-out forwards}[data-scope=progress][data-part=root]{height:100%;width:100%}[data-scope=progress][data-part=circle]{--size:40px;--thickness:4px;--radius:18px;--circomference:113.09724px}[data-scope=progress][data-part=circle-range]{stroke:#fff;--transition-prop:stroke-dasharray,stroke,stroke-dashoffset;--transition-duration:0.2s;transition-duration:.2s;transition-property:stroke-dasharray,stroke,stroke-dashoffset}[data-scope=progress][data-part=circle-track]{stroke:rgba(0,0,0,.5)}.empty\\:hidden:empty{display:none}.hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:\\!bg-\\[\\#f7f8ff\\]:hover{--tw-bg-opacity:1!important;background-color:rgb(247 248 255/var(--tw-bg-opacity))!important}.hover\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\\:\\!opacity-80:hover{opacity:.8!important}.hover\\:opacity-90:hover{opacity:.9}.hover\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:brightness-90:hover{--tw-brightness:brightness(.9)}.hover\\:brightness-90:hover,.hover\\:brightness-95:hover{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-95:hover{--tw-brightness:brightness(.95)}.hover\\:backdrop-brightness-95:hover{--tw-backdrop-brightness:brightness(.95);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px}.active\\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95}.active\\:scale-95:active,.active\\:scale-\\[0\\.98\\]:active{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:scale-\\[0\\.98\\]:active{--tw-scale-x:0.98;--tw-scale-y:0.98}.active\\:brightness-75:active{--tw-brightness:brightness(.75)}.active\\:brightness-75:active,.active\\:brightness-90:active{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.active\\:brightness-90:active{--tw-brightness:brightness(.9)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:brightness-100:disabled{--tw-brightness:brightness(1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group:hover .group-hover\\:opacity-0{opacity:0}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:backdrop-brightness-90[data-state=open]{--tw-backdrop-brightness:brightness(.9);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}@media (prefers-color-scheme:dark){.dark\\:text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}}@media (min-width:640px){.sm\\:right-5{right:20px}.sm\\:my-8{margin-bottom:32px;margin-top:32px}.sm\\:p-0{padding:0}.sm\\:opacity-0{opacity:0}}.\\[\\&_svg\\]\\:\\!h-4 svg{height:16px!important}.\\[\\&_svg\\]\\:\\!w-4 svg{width:16px!important}';const Qe=async e=>{let t;try{const n="string"==typeof e?e:e.url;t=await fetch(n,{method:"string"==typeof e?"GET":e.method,mode:"cors",headers:"string"!=typeof e&&Je(e.body)?{"Content-Type":"application/json"}:void 0,body:"string"!=typeof e&&Je(e.body)?JSON.stringify(e.body):void 0});const r=await t.json();if(!t.ok)throw"error"in r?r.error:r;return{data:r,response:t}}catch(e){return console.error(e),{error:e,response:t}}},Je=e=>null!=e,et=e=>null==e,tt=e=>null==e||""===e,nt=e=>null!=e&&""!==e,rt=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg");function ot(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ot(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function it(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ot(e))&&(r&&(r+=" "),r+=t);return r}const at=De('<svg part="button-icon" viewBox="0 0 24 24"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z">'),st=De('<div part="button-icon">'),lt=De('<img part="button-icon" alt="Bubble button icon">'),ut=De('<span part="button-icon">'),ct=De('<svg part="button-icon" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M18.601 8.39897C18.269 8.06702 17.7309 8.06702 17.3989 8.39897L12 13.7979L6.60099 8.39897C6.26904 8.06702 5.73086 8.06702 5.39891 8.39897C5.06696 8.73091 5.06696 9.2691 5.39891 9.60105L11.3989 15.601C11.7309 15.933 12.269 15.933 12.601 15.601L18.601 9.60105C18.9329 9.2691 18.9329 8.73091 18.601 8.39897Z">'),dt=De('<img part="button-icon" alt="Bubble button close icon">'),pt=De('<button part="button" aria-label="Open chatbot">'),ft="#fff",ht=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),gt=e=>(()=>{const t=pt();return t.$$click=()=>e.toggleBot(),t.style.setProperty("z-index","42424242"),Be(t,ie(ve,{get when(){return et(e.customIconSrc)},keyed:!0,get children(){const t=at();return P(n=>{const r=e.iconColor??ft,o=it("stroke-2 fill-transparent absolute duration-200 transition w-[60%]",e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100");return r!==n._v$&&(null!=(n._v$=r)?t.style.setProperty("stroke",r):t.style.removeProperty("stroke")),o!==n._v$2&&Oe(t,"class",n._v$2=o),n},{_v$:void 0,_v$2:void 0}),t}}),null),Be(t,ie(ve,{get when(){return N(()=>!!e.customIconSrc)()&&e.customIconSrc.startsWith("data:image/svg+xml")},get children(){const t=st();return P(n=>{const r=it("flex items-center justify-center","duration-200 transition",e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100","w-[60%] h-[60%]"),o=e.iconColor??ft,i=(e=>{if(!e.startsWith("data:image/svg+xml"))return null;let t=decodeURIComponent(e.replace("data:image/svg+xml;utf8,","")).replace(/(\w+)='([^']*)'/g,'$1="$2"').replace(/fill=['"]?bg['"]?/gi,'fill="currentColor"').replace(/fill=['"]#[0-9a-fA-F]{3,6}['"]?/gi,'fill="currentColor"').replace(/fill=['"]rgba?\([^)]+\)['"]?/gi,'fill="currentColor"').replace(/fill=['"](?:black|white|red|blue|green|yellow|orange|purple|pink|brown|gray|grey)['"]?/gi,'fill="currentColor"').replace(/stroke=['"]#[0-9a-fA-F]{3,6}['"]?/gi,'stroke="currentColor"').replace(/stroke=['"]rgba?\([^)]+\)['"]?/gi,'stroke="currentColor"').replace(/stroke=['"](?:black|white|red|blue|green|yellow|orange|purple|pink|brown|gray|grey)['"]?/gi,'stroke="currentColor"');return/<svg[^>]+fill=/i.test(t)||(t=t.replace("<svg ",'<svg fill="currentColor" ')),t})(e.customIconSrc);return r!==n._v$3&&Pe(t,n._v$3=r),o!==n._v$4&&(null!=(n._v$4=o)?t.style.setProperty("color",o):t.style.removeProperty("color")),i!==n._v$5&&(t.innerHTML=n._v$5=i),n},{_v$3:void 0,_v$4:void 0,_v$5:void 0}),t}}),null),Be(t,ie(ve,{get when(){return N(()=>!(!e.customIconSrc||!ht(e.customIconSrc)))()&&!e.customIconSrc.startsWith("data:image/svg+xml")},get children(){const t=lt();return P(n=>{const r=e.customIconSrc,o=it("duration-200 transition",e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100",rt(e.customIconSrc)?"w-[60%]":"w-full h-full",rt(e.customIconSrc)?"":"object-cover rounded-full");return r!==n._v$6&&Oe(t,"src",n._v$6=r),o!==n._v$7&&Pe(t,n._v$7=o),n},{_v$6:void 0,_v$7:void 0}),t}}),null),Be(t,ie(ve,{get when(){return N(()=>!!e.customIconSrc)()&&!ht(e.customIconSrc)},get children(){const t=ut();return t.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),Be(t,()=>e.customIconSrc),P(n=>{const r=it("text-4xl duration-200 transition",e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100"),o=e.iconColor??ft;return r!==n._v$8&&Pe(t,n._v$8=r),o!==n._v$9&&(null!=(n._v$9=o)?t.style.setProperty("color",o):t.style.removeProperty("color")),n},{_v$8:void 0,_v$9:void 0}),t}}),null),Be(t,ie(ve,{get when(){return et(e.customCloseIconSrc)},get children(){const t=ct();return P(n=>{const r=e.iconColor??ft,o=it("absolute duration-200 transition w-[60%]",e.isBotOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0");return r!==n._v$0&&(null!=(n._v$0=r)?t.style.setProperty("fill",r):t.style.removeProperty("fill")),o!==n._v$1&&Oe(t,"class",n._v$1=o),n},{_v$0:void 0,_v$1:void 0}),t}}),null),Be(t,ie(ve,{get when(){return N(()=>!!e.customCloseIconSrc)()&&ht(e.customCloseIconSrc)},get children(){const t=dt();return P(n=>{const r=e.customCloseIconSrc,o=it("absolute duration-200 transition",e.isBotOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0",rt(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",rt(e.customCloseIconSrc)?"":"object-cover rounded-full");return r!==n._v$10&&Oe(t,"src",n._v$10=r),o!==n._v$11&&Pe(t,n._v$11=o),n},{_v$10:void 0,_v$11:void 0}),t}}),null),Be(t,ie(ve,{get when(){return N(()=>!!e.customCloseIconSrc)()&&!ht(e.customCloseIconSrc)},get children(){const t=ut();return t.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),Be(t,()=>e.customCloseIconSrc),P(n=>{const r=it("absolute text-4xl duration-200 transition",e.isBotOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"),o=e.iconColor??ft;return r!==n._v$12&&Pe(t,n._v$12=r),o!==n._v$13&&(null!=(n._v$13=o)?t.style.setProperty("color",o):t.style.removeProperty("color")),n},{_v$12:void 0,_v$13:void 0}),t}}),null),P(n=>{const r=it("fixed bottom-5 shadow-md rounded-full hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in","left"===e.placement?" left-5":" right-5"),o=e.backgroundColor??"#01a952",i=e.buttonSize,a=e.buttonSize;return r!==n._v$14&&Pe(t,n._v$14=r),o!==n._v$15&&(null!=(n._v$15=o)?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),i!==n._v$16&&(null!=(n._v$16=i)?t.style.setProperty("width",i):t.style.removeProperty("width")),a!==n._v$17&&(null!=(n._v$17=a)?t.style.setProperty("height",a):t.style.removeProperty("height")),n},{_v$14:void 0,_v$15:void 0,_v$16:void 0,_v$17:void 0}),t})();Ae(["click"]);const mt=De('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18">'),vt=e=>(()=>{const t=mt();return Ne(t,e,!0,!0),t})(),yt=De('<div part="bubble-message"><p>'),bt=De('<img class="rounded-full w-8 h-8 object-cover" alt="Bot avatar" elementtiming="Bot avatar" fetchpriority="high">'),wt=De('<button part="bubble-message-close-button" aria-label="Close">'),Et="#F7F8FF",_t="#303235",xt=e=>{const[t,n]=O(!1),[r,o]=O({x:0,y:0}),i=e=>{o({x:e.touches[0].clientX,y:e.touches[0].clientY})},a=t=>{const n=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY;(Math.abs(n-r().x)>10||i-r().y>10)&&e.onCloseClick(),o({x:0,y:0})};return(()=>{const r=yt(),o=r.firstChild;return r.$$touchend=a,r.$$touchstart=i,r.addEventListener("mouseleave",()=>n(!1)),r.addEventListener("mouseenter",()=>n(!0)),r.$$click=()=>e.onClick(),r.style.setProperty("z-index","42424242"),Be(r,ie(kt,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),o),Be(r,ie(ve,{get when(){return e.avatarUrl},keyed:!0,children:e=>(()=>{const t=bt();return Oe(t,"src",e),t})()}),o),Be(o,()=>e.message),P(t=>{const n="fixed max-w-[256px] rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4"+("left"===e.placement?" left-5":" right-5"),o=e.previewMessageTheme?.backgroundColor??Et,i=e.previewMessageTheme?.textColor??_t,a=`calc(${e.buttonSize} + 32px)`;return n!==t._v$&&Pe(r,t._v$=n),o!==t._v$2&&(null!=(t._v$2=o)?r.style.setProperty("background-color",o):r.style.removeProperty("background-color")),i!==t._v$3&&(null!=(t._v$3=i)?r.style.setProperty("color",i):r.style.removeProperty("color")),a!==t._v$4&&(null!=(t._v$4=a)?r.style.setProperty("bottom",a):r.style.removeProperty("bottom")),t},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),r})()},kt=e=>(()=>{const t=wt();return t.$$click=t=>(t.stopPropagation(),e.onClick()),Be(t,ie(vt,{class:"w-4"})),P(n=>{const r="absolute -top-2 -right-2 rounded-full w-6 h-6 p-1 hover:brightness-95 active:brightness-90 transition-all border "+(e.isHovered?"opacity-100":"opacity-0"),o=e.previewMessageTheme?.closeButtonBackgroundColor??Et,i=e.previewMessageTheme?.closeButtonIconColor??_t;return r!==n._v$5&&Pe(t,n._v$5=r),o!==n._v$6&&(null!=(n._v$6=o)?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),i!==n._v$7&&(null!=(n._v$7=i)?t.style.setProperty("color",i):t.style.removeProperty("color")),n},{_v$5:void 0,_v$6:void 0,_v$7:void 0}),t})();Ae(["click","touchstart","touchend"]);const Ct=(e,t)=>"undefined"!=typeof window?window.__ENV?window.__ENV[e]??t:void 0:"undefined"!=typeof process?process.env[e]??t:void 0,St=({ignoreChatApiUrl:e}={ignoreChatApiUrl:!1})=>{const t=Ct("NEXT_PUBLIC_CHAT_API_URL"),n=Ct("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!n||n.some(e=>e===window.location.href)))return t;const r=Ct("NEXT_PUBLIC_VIEWER_URL")?.split(","),o=r?.find(e=>window.location.href.startsWith(e));return o??r?.[0]??"https://quick.bot"},Tt=()=>sessionStorage.getItem("botPaymentInProgress"),Dt=()=>{sessionStorage.removeItem("botPaymentInProgress")};class At extends Error{constructor(e,t,n){const r=`${e.status||0===e.status?e.status:""} ${e.statusText||""}`.trim();super(`Request failed with ${r?`status code ${r}`:"an unknown error"}`),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=e,this.request=t,this.options=n}}class Ot extends Error{constructor(e){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=e}}const Pt=e=>null!==e&&"object"==typeof e,It=(...e)=>{for(const t of e)if((!Pt(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return Rt({},...e)},Nt=(e={},t={})=>{const n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(const[e,t]of o.entries())r&&"undefined"===t||void 0===t?n.delete(e):n.set(e,t);return n},Rt=(...e)=>{let t={},n={};for(const r of e)if(Array.isArray(r))Array.isArray(t)||(t=[]),t=[...t,...r];else if(Pt(r)){for(let[e,n]of Object.entries(r))Pt(n)&&e in t&&(n=Rt(t[e],n)),t={...t,[e]:n};Pt(r.headers)&&(n=Nt(n,r.headers),t.headers=n)}return t},Bt=(()=>{let e=!1,t=!1;const n="function"==typeof globalThis.ReadableStream,r="function"==typeof globalThis.Request;return n&&r&&(t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")),e&&!t})(),Ft="function"==typeof globalThis.AbortController,Lt="function"==typeof globalThis.ReadableStream,Mt="function"==typeof globalThis.FormData,Ut=["get","post","put","patch","head","delete"],jt={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},$t=2147483647,zt=Symbol("stop"),Ht={json:!0,parseJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},Vt={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},Wt=e=>Ut.includes(e)?e.toUpperCase():e,qt=[413,429,503],Gt={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:qt,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Kt=(e={})=>{if("number"==typeof e)return{...Gt,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...Gt,...e,afterStatusCodes:qt}};class Yt{static create(e,t){const n=new Yt(e,t),r=async()=>{if("number"==typeof n._options.timeout&&n._options.timeout>$t)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await n._fetch();for(const t of n._options.hooks.afterResponse){const r=await t(n.request,n._options,n._decorateResponse(e.clone()));r instanceof globalThis.Response&&(e=r)}if(n._decorateResponse(e),!e.ok&&n._options.throwHttpErrors){let t=new At(e,n.request,n._options);for(const e of n._options.hooks.beforeError)t=await e(t);throw t}if(n._options.onDownloadProgress){if("function"!=typeof n._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Lt)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(e.clone(),n._options.onDownloadProgress)}return e},o=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(r):r();for(const[e,r]of Object.entries(jt))o[e]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||r);const i=(await o).clone();if("json"===e){if(204===i.status)return"";if(0===(await i.clone().arrayBuffer()).byteLength)return"";if(t.parseJson)return t.parseJson(await i.text())}return i[e]()};return o}constructor(e,t={}){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=e;const n=this._input instanceof Request&&"credentials"in Request.prototype?this._input.credentials:void 0;if(this._options={...n&&{credentials:n},...t,headers:Nt(this._input.headers,t.headers),hooks:Rt({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},t.hooks),method:Wt(t.method??this._input.method),prefixUrl:String(t.prefixUrl||""),retry:Kt(t.retry),throwHttpErrors:!1!==t.throwHttpErrors,timeout:t.timeout??1e4,fetch:t.fetch??globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Ft){if(this.abortController=new globalThis.AbortController,this._options.signal){const e=this._options.signal;this._options.signal.addEventListener("abort",()=>{this.abortController.abort(e.reason)})}this._options.signal=this.abortController.signal}if(Bt&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const e="?"+("string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),t=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,e);!(Mt&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(t,{...this.request}),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(e instanceof Ot)){if(e instanceof At){if(!this._options.retry.statusCodes.includes(e.response.status))return 0;const t=e.response.headers.get("Retry-After");if(t&&this._options.retry.afterStatusCodes.includes(e.response.status)){let e=Number(t);return Number.isNaN(e)?e=Date.parse(t)-Date.now():e*=1e3,void 0!==this._options.retry.maxRetryAfter&&e>this._options.retry.maxRetryAfter?0:e}if(413===e.response.status)return 0}const t=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,t)}return 0}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(t){const n=Math.min(this._calculateRetryDelay(t),$t);if(0!==n&&this._retryCount>0){await async function(e,{signal:t}){return new Promise((n,r)=>{function o(){clearTimeout(i),r(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));const i=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e)})}(n,{signal:this._options.signal});for(const e of this._options.hooks.beforeRetry){if(await e({request:this.request,options:this._options,error:t,retryCount:this._retryCount})===zt)return}return this._retry(e)}throw t}}async _fetch(){for(const e of this._options.hooks.beforeRequest){const t=await e(this.request,this._options);if(t instanceof Request){this.request=t;break}if(t instanceof Response)return t}const e=((e,t)=>{const n={};for(const r in t)r in Vt||r in Ht||r in e||(n[r]=t[r]);return n})(this.request,this._options);return!1===this._options.timeout?this._options.fetch(this.request.clone(),e):async function(e,t,n,r){return new Promise((o,i)=>{const a=setTimeout(()=>{n&&n.abort(),i(new Ot(e))},r.timeout);r.fetch(e,t).then(o).catch(i).then(()=>{clearTimeout(a)})})}(this.request.clone(),e,this.abortController,this._options)}_stream(e,t){const n=Number(e.headers.get("content-length"))||0;let r=0;return 204===e.status?(t&&t({percent:1,totalBytes:n,transferredBytes:r},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){const i=e.body.getReader();t&&t({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array),await async function e(){const{done:a,value:s}=await i.read();if(a)o.close();else{if(t){r+=s.byteLength;t({percent:0===n?0:r/n,transferredBytes:r,totalBytes:n},s)}o.enqueue(s),await e()}}()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}}
3
+ /*! MIT License © Sindre Sorhus */const Zt=e=>{const t=(t,n)=>Yt.create(t,It(e,n));for(const n of Ut)t[n]=(t,r)=>Yt.create(t,It(e,r,{method:n}));return t.create=e=>Zt(It(e)),t.extend=t=>Zt(It(e,t)),t.stop=zt,t},Xt=Zt();class Qt extends Error{constructor(e){super("This bot can only be executed on "+e)}}const Jt=({apiHost:e,apiEndpoint:t})=>{let n;return n=`${nt(e)?e:St()}`,t&&(n+=t),"preview"===process.env.NEXT_PUBLIC_VERCEL_ENV&&process.env.NEXT_PUBLIC_VERCEL_AUTOMATION_BYPASS_SECRET&&(n+=`?x-vercel-protection-bypass=${process.env.NEXT_PUBLIC_VERCEL_AUTOMATION_BYPASS_SECRET}`),n};function en(e){const t=(e||"").toLowerCase(),n=/ipad|tablet|kindle|silk|playbook/.test(t)||/android/.test(t)&&!/mobile/.test(t),r=/mobi|iphone|ipod|android.*mobile|blackberry|phone|windows phone/.test(t);return n?"tablet":r?"mobile":/macintosh|windows nt|linux|x11|cros/.test(t)?"desktop":"unknown"}const tn=e=>"text"===e.type?e.label??e.value:e.url,nn=async({apiHost:e,sessionId:t,clientLogs:n})=>{try{await Xt.post(`${nt(e)?e:St()}/api/v1/sessions/${t}/clientLogs`,{json:{clientLogs:n}})}catch(e){console.log(e)}},[rn,on]=O([]),an=e=>{if(e)return"text"===e.type?{type:"text",text:e.value,attachedFileUrls:e.attachments?.map(e=>e.url)}:"recording"===e.type?{type:"audio",url:e.url}:void 0},sn=(e,t,n=0,r=.6,o=128)=>{if(!e)return;const i=e.clientHeight*r-o;e.scrollTop+e.clientHeight>=e.scrollHeight-i&&setTimeout(()=>{e?.scrollTo(0,t?t.offsetTop-n:e.scrollHeight)},50)},ln={isInputPrefillEnabled:!1,rememberUser:{isEnabled:!1,storage:"session"}},un={enabled:!0,speed:400,maxDelay:3,delayBetweenBubbles:0,isDisabledOnFirstMessage:!0};[{value:"session",label:"Session"},{value:"local",label:"Local"}].map(e=>e.value);const cn=Symbol("store-raw"),dn=Symbol("store-node");function pn(e){let t=e[f];if(!t&&(Object.defineProperty(e,f,{value:t=new Proxy(e,bn)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function fn(e){let t;return null!=e&&"object"==typeof e&&(e[f]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function hn(e,t=new Set){let n,r,o,i;if(n=null!=e&&e[cn])return n;if(!fn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,i=e.length;n<i;n++)o=e[n],(r=hn(o,t))!==o&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const n=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let s=0,l=n.length;s<l;s++)i=n[s],a[i].get||(o=e[i],(r=hn(o,t))!==o&&(e[i]=r))}return e}function gn(e){let t=e[dn];return t||Object.defineProperty(e,dn,{value:t=Object.create(null)}),t}function mn(e,t,n){return e[t]||(e[t]=yn(n))}function vn(e){if(L()){const t=gn(e);(t._||(t._=yn()))()}}function yn(e){const[t,n]=O(e,{equals:!1,internal:!0});return t.$=n,t}const bn={get(e,t,n){if(t===cn)return e;if(t===f)return n;if(t===h)return vn(e),n;const r=gn(e),o=r[t];let i=o?o():e[t];if(t===dn||"__proto__"===t)return i;if(!o){const n=Object.getOwnPropertyDescriptor(e,t);!L()||"function"==typeof i&&!e.hasOwnProperty(t)||n&&n.get||(i=mn(r,t,i)())}return fn(i)?pn(i):i},has(e,t){return t===cn||t===f||t===h||t===dn||"__proto__"===t||(this.get(e,t,e),t in e)},set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){return vn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return n&&!n.get&&n.configurable&&t!==f&&t!==dn?(delete n.value,delete n.writable,n.get=()=>e[f][t],n):n}};function wn(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;void 0===n?delete e[t]:e[t]=n;let a,s=gn(e);if((a=mn(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let t=e.length;t<i;t++)(a=s[t])&&a.$();(a=mn(s,"length",i))&&a.$(e.length)}(a=s._)&&a.$()}function En(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];wn(e,o,t[o])}}function _n(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let o=0;o<r.length;o++)_n(e,[r[o]].concat(t),n);return}if(a&&"function"===i){for(let o=0;o<e.length;o++)r(e[o],o)&&_n(e,[o].concat(t),n);return}if(a&&"object"===i){const{from:o=0,to:i=e.length-1,by:a=1}=r;for(let r=o;r<=i;r+=a)_n(e,[r].concat(t),n);return}if(t.length>1)return void _n(e[r],t,[r].concat(n));o=e[r],n=[r].concat(n)}let i=t[0];"function"==typeof i&&(i=i(o,n),i===o)||void 0===r&&null==i||(i=hn(i),void 0===r||fn(o)&&fn(i)&&!Array.isArray(i)?En(o,i):wn(e,r,i))}function xn(...[e,t]){const n=hn(e||{}),r=Array.isArray(n);return[pn(n),function(...e){var t;t=()=>{r&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=hn(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const r=t[n];e[n]!==r&&wn(e,n,r)}wn(e,"length",r)}else En(e,t)}(n,e[0]):_n(n,e)},G(t,!1)}]}const kn=Symbol("store-root");function Cn(e,t,n,r,o){const i=t[n];if(e===i)return;if(n!==kn&&(!fn(e)||!fn(i)||o&&e[o]!==i[o]))return void wn(t,n,e);if(Array.isArray(e)){if(e.length&&i.length&&(!r||o&&e[0]&&null!=e[0][o])){let t,n,a,s,l,u,c,d;for(a=0,s=Math.min(i.length,e.length);a<s&&(i[a]===e[a]||o&&i[a]&&e[a]&&i[a][o]===e[a][o]);a++)Cn(e[a],i,a,r,o);const p=new Array(e.length),f=new Map;for(s=i.length-1,l=e.length-1;s>=a&&l>=a&&(i[s]===e[l]||o&&i[a]&&e[a]&&i[s][o]===e[l][o]);s--,l--)p[l]=i[s];if(a>l||a>s){for(n=a;n<=l;n++)wn(i,n,e[n]);for(;n<e.length;n++)wn(i,n,p[n]),Cn(e[n],i,n,r,o);return void(i.length>e.length&&wn(i,"length",e.length))}for(c=new Array(l+1),n=l;n>=a;n--)u=e[n],d=o&&u?u[o]:u,t=f.get(d),c[n]=void 0===t?-1:t,f.set(d,n);for(t=a;t<=s;t++)u=i[t],d=o&&u?u[o]:u,n=f.get(d),void 0!==n&&-1!==n&&(p[n]=i[t],n=c[n],f.set(d,n));for(n=a;n<e.length;n++)n in p?(wn(i,n,p[n]),Cn(e[n],i,n,r,o)):wn(i,n,e[n])}else for(let t=0,n=e.length;t<n;t++)Cn(e[t],i,t,r,o);return void(i.length>e.length&&wn(i,"length",e.length))}const a=Object.keys(e);for(let t=0,n=a.length;t<n;t++)Cn(e[a[t]],i,a[t],r,o);const s=Object.keys(i);for(let t=0,n=s.length;t<n;t++)void 0===e[s[t]]&&wn(i,s[t],void 0)}function Sn(e,t={}){const{merge:n,key:r="id"}=t,o=hn(e);return e=>{if(!fn(e)||!fn(o))return o;const t=Cn(o,{[kn]:e},kn,n,r);return void 0===t?e:t}}function Tn(e,t){const[n,r]=O(!1);if(!t.storage)return[...e,n,r];const o=Dn(t.storage||ln.rememberUser.storage),i=JSON.stringify.bind(JSON),a=JSON.parse.bind(JSON),s=o.getItem(t.key),l="function"==typeof e[0]?t=>e[1](()=>a(t)):t=>e[1](Sn(a(t)));return s&&(l(s),r(!0),t.onRecovered?.()),[e[0],"function"==typeof e[0]?n=>{r(!1);const a=e[1](n);return n?o.setItem(t.key,i(a)):o.removeItem(t.key),a}:(...n)=>{r(!1),e[1](...n);const a=i(R(()=>e[0]));o.setItem(t.key,a)},n,r]}const Dn=e=>"session"===(e??ln.rememberUser.storage)?sessionStorage:localStorage,An=e=>"string"==typeof e?e:e instanceof Error?e.name+": "+e.message:JSON.stringify(e),On=Object.getPrototypeOf(async function(){}).constructor,Pn=async({content:e,args:t})=>{try{const n=On(...t.map(e=>e.id),In(e));await n(...t.map(e=>e.value))}catch(e){return{logs:[{status:"error",description:"Script block failed to execute",details:An(e)}]}}},In=e=>e.replace(/<script>/g,"").replace(/<\/script>/g,""),Nn=async({args:e,content:t})=>{try{const n=On(...Object.keys(e),t);await n(...Object.keys(e).map(t=>e[t]))}catch(e){console.warn("Script threw an error:",e)}};var Rn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Fn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Ln={exports:{}};const Mn="undefined"!=typeof Buffer,Un=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,jn=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function $n(e,t,n){null==n&&null!==t&&"object"==typeof t&&(n=t,t=void 0),Mn&&Buffer.isBuffer(e)&&(e=e.toString()),e&&65279===e.charCodeAt(0)&&(e=e.slice(1));const r=JSON.parse(e,t);if(null===r||"object"!=typeof r)return r;const o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if("ignore"===o&&"ignore"===i)return r;if("ignore"!==o&&"ignore"!==i){if(!1===Un.test(e)&&!1===jn.test(e))return r}else if("ignore"!==o&&"ignore"===i){if(!1===Un.test(e))return r}else if(!1===jn.test(e))return r;return zn(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function zn(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const e=o;o=[];for(const i of e){if("ignore"!==t&&Object.prototype.hasOwnProperty.call(i,"__proto__")){if(!0===r)return null;if("error"===t)throw new SyntaxError("Object contains forbidden prototype property");delete i.__proto__}if("ignore"!==n&&Object.prototype.hasOwnProperty.call(i,"constructor")&&Object.prototype.hasOwnProperty.call(i.constructor,"prototype")){if(!0===r)return null;if("error"===n)throw new SyntaxError("Object contains forbidden prototype property");delete i.constructor}for(const e in i){const t=i[e];t&&"object"==typeof t&&o.push(t)}}}return e}function Hn(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return $n(e,t,n)}finally{Error.stackTraceLimit=r}}var Vn,Wn;Ln.exports=Hn,Ln.exports.default=Hn,Ln.exports.parse=Hn,Ln.exports.safeParse=function(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return $n(e,t,{safe:!0})}catch(e){return null}finally{Error.stackTraceLimit=n}},Ln.exports.scan=zn,function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Vn||(Vn={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Wn||(Wn={}));const qn=Vn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Gn=e=>{switch(typeof e){case"undefined":return qn.undefined;case"string":return qn.string;case"number":return isNaN(e)?qn.nan:qn.number;case"boolean":return qn.boolean;case"function":return qn.function;case"bigint":return qn.bigint;case"symbol":return qn.symbol;case"object":return Array.isArray(e)?qn.array:null===e?qn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?qn.promise:"undefined"!=typeof Map&&e instanceof Map?qn.map:"undefined"!=typeof Set&&e instanceof Set?qn.set:"undefined"!=typeof Date&&e instanceof Date?qn.date:qn.object;default:return qn.unknown}},Kn=Vn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Yn extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(r);else if("invalid_return_type"===o.code)r(o.returnTypeError);else if("invalid_arguments"===o.code)r(o.argumentsError);else if(0===o.path.length)n._errors.push(t(o));else{let e=n,r=0;for(;r<o.path.length;){const n=o.path[r];r===o.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(o))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof Yn))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Vn.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Yn.create=e=>new Yn(e);const Zn=(e,t)=>{let n;switch(e.code){case Kn.invalid_type:n=e.received===qn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Kn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Vn.jsonStringifyReplacer)}`;break;case Kn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Vn.joinValues(e.keys,", ")}`;break;case Kn.invalid_union:n="Invalid input";break;case Kn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Vn.joinValues(e.options)}`;break;case Kn.invalid_enum_value:n=`Invalid enum value. Expected ${Vn.joinValues(e.options)}, received '${e.received}'`;break;case Kn.invalid_arguments:n="Invalid function arguments";break;case Kn.invalid_return_type:n="Invalid function return type";break;case Kn.invalid_date:n="Invalid date";break;case Kn.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Vn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Kn.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Kn.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Kn.custom:n="Invalid input";break;case Kn.invalid_intersection_types:n="Intersection results could not be merged";break;case Kn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Kn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Vn.assertNever(e)}return{message:n}};let Xn=Zn;function Qn(){return Xn}const Jn=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],a={...o,path:i};if(void 0!==o.message)return{...o,path:i,message:o.message};let s="";const l=r.filter(e=>!!e).slice().reverse();for(const e of l)s=e(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}};function er(e,t){const n=Qn(),r=Jn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Zn?void 0:Zn].filter(e=>!!e)});e.common.issues.push(r)}class tr{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return nr;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,r=await e.value;n.push({key:t,value:r})}return tr.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:o}=r;if("aborted"===t.status)return nr;if("aborted"===o.status)return nr;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"===t.value||void 0===o.value&&!r.alwaysSet||(n[t.value]=o.value)}return{status:e.value,value:n}}}const nr=Object.freeze({status:"aborted"}),rr=e=>({status:"dirty",value:e}),or=e=>({status:"valid",value:e}),ir=e=>"aborted"===e.status,ar=e=>"dirty"===e.status,sr=e=>"valid"===e.status,lr=e=>"undefined"!=typeof Promise&&e instanceof Promise;function ur(e,t,n,r){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function cr(e,t,n,r,o){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var dr,pr,fr;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(dr||(dr={}));class hr{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gr=(e,t)=>{if(sr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Yn(e.common.issues);return this._error=t,this._error}}};function mr(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:o};return{errorMap:(t,o)=>{var i,a;const{message:s}=e;return"invalid_enum_value"===t.code?{message:null!=s?s:o.defaultError}:void 0===o.data?{message:null!==(i=null!=s?s:r)&&void 0!==i?i:o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:null!==(a=null!=s?s:n)&&void 0!==a?a:o.defaultError}},description:o}}class vr{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Gn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Gn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new tr,ctx:{common:e.parent.common,data:e.data,parsedType:Gn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(lr(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Gn(e)},o=this._parseSync({data:e,path:r.path,parent:r});return gr(r,o)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Gn(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(lr(r)?r:Promise.resolve(r));return gr(n,o)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,r)=>{const o=e(t),i=()=>r.addIssue({code:Kn.custom,...n(t)});return"undefined"!=typeof Promise&&o instanceof Promise?o.then(e=>!!e||(i(),!1)):!!o||(i(),!1)})}refinement(e,t){return this._refinement((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1))}_refinement(e){return new ho({schema:this,typeName:So.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return go.create(this,this._def)}nullable(){return mo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kr.create(this,this._def)}promise(){return fo.create(this,this._def)}or(e){return Xr.create([this,e],this._def)}and(e){return to.create(this,e,this._def)}transform(e){return new ho({...mr(this._def),schema:this,typeName:So.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new vo({...mr(this._def),innerType:this,defaultValue:t,typeName:So.ZodDefault})}brand(){return new Eo({typeName:So.ZodBranded,type:this,...mr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new yo({...mr(this._def),innerType:this,catchValue:t,typeName:So.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return _o.create(this,e)}readonly(){return xo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const yr=/^c[^\s-]{8,}$/i,br=/^[0-9a-z]+$/,wr=/^[0-9A-HJKMNP-TV-Z]{26}$/,Er=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,_r=/^[a-z0-9_-]{21}$/i,xr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Cr;const Sr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tr=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Dr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ar="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Or=new RegExp(`^${Ar}$`);function Pr(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function Ir(e){return new RegExp(`^${Pr(e)}$`)}function Nr(e){let t=`${Ar}T${Pr(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Rr(e,t){return!("v4"!==t&&t||!Sr.test(e))||!("v6"!==t&&t||!Tr.test(e))}class Br extends vr{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==qn.string){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.string,received:t.parsedType}),nr}const t=new tr;let n;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),er(n,{code:Kn.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),er(n,{code:Kn.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const o=e.data.length>r.value,i=e.data.length<r.value;(o||i)&&(n=this._getOrReturnCtx(e,n),o?er(n,{code:Kn.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):i&&er(n,{code:Kn.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)kr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"email",code:Kn.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)Cr||(Cr=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Cr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"emoji",code:Kn.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)Er.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"uuid",code:Kn.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)_r.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"nanoid",code:Kn.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)yr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"cuid",code:Kn.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)br.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"cuid2",code:Kn.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)wr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"ulid",code:Kn.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(o){n=this._getOrReturnCtx(e,n),er(n,{validation:"url",code:Kn.invalid_string,message:r.message}),t.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"regex",code:Kn.invalid_string,message:r.message}),t.dirty())}else if("trim"===r.kind)e.data=e.data.trim();else if("includes"===r.kind)e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),er(n,{code:Kn.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty());else if("toLowerCase"===r.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===r.kind)e.data=e.data.toUpperCase();else if("startsWith"===r.kind)e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),er(n,{code:Kn.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty());else if("endsWith"===r.kind)e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),er(n,{code:Kn.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty());else if("datetime"===r.kind){Nr(r).test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{code:Kn.invalid_string,validation:"datetime",message:r.message}),t.dirty())}else if("date"===r.kind){Or.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{code:Kn.invalid_string,validation:"date",message:r.message}),t.dirty())}else if("time"===r.kind){Ir(r).test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{code:Kn.invalid_string,validation:"time",message:r.message}),t.dirty())}else"duration"===r.kind?xr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"duration",code:Kn.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?Rr(e.data,r.version)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"ip",code:Kn.invalid_string,message:r.message}),t.dirty()):"base64"===r.kind?Dr.test(e.data)||(n=this._getOrReturnCtx(e,n),er(n,{validation:"base64",code:Kn.invalid_string,message:r.message}),t.dirty()):Vn.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:Kn.invalid_string,...dr.errToObj(n)})}_addCheck(e){return new Br({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...dr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...dr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...dr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...dr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...dr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...dr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...dr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...dr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...dr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...dr.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...dr.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...dr.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...dr.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...dr.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...dr.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...dr.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...dr.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...dr.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...dr.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...dr.errToObj(t)})}nonempty(e){return this.min(1,dr.errToObj(e))}trim(){return new Br({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Br({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Br({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Fr(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r;return parseInt(e.toFixed(o).replace(".",""))%parseInt(t.toFixed(o).replace(".",""))/Math.pow(10,o)}Br.create=e=>{var t;return new Br({checks:[],typeName:So.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...mr(e)})};class Lr extends vr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==qn.number){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.number,received:t.parsedType}),nr}let t;const n=new tr;for(const r of this._def.checks)if("int"===r.kind)Vn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),er(t,{code:Kn.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),er(t,{code:Kn.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),er(t,{code:Kn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Fr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),er(t,{code:Kn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),er(t,{code:Kn.not_finite,message:r.message}),n.dirty()):Vn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,dr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,dr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,dr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,dr.toString(t))}setLimit(e,t,n,r){return new Lr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:dr.toString(r)}]})}_addCheck(e){return new Lr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:dr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:dr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:dr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:dr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:dr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:dr.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:dr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:dr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:dr.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&Vn.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Lr.create=e=>new Lr({checks:[],typeName:So.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...mr(e)});class Mr extends vr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==qn.bigint){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.bigint,received:t.parsedType}),nr}let t;const n=new tr;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),er(t,{code:Kn.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),er(t,{code:Kn.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty())}else"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),er(t,{code:Kn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Vn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,dr.toString(t))}gt(e,t){return this.setLimit("min",e,!1,dr.toString(t))}lte(e,t){return this.setLimit("max",e,!0,dr.toString(t))}lt(e,t){return this.setLimit("max",e,!1,dr.toString(t))}setLimit(e,t,n,r){return new Mr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:dr.toString(r)}]})}_addCheck(e){return new Mr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:dr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:dr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:dr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:dr.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:dr.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Mr.create=e=>{var t;return new Mr({checks:[],typeName:So.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...mr(e)})};class Ur extends vr{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==qn.boolean){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.boolean,received:t.parsedType}),nr}return or(e.data)}}Ur.create=e=>new Ur({typeName:So.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...mr(e)});class jr extends vr{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==qn.date){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.date,received:t.parsedType}),nr}if(isNaN(e.data.getTime())){return er(this._getOrReturnCtx(e),{code:Kn.invalid_date}),nr}const t=new tr;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),er(n,{code:Kn.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),er(n,{code:Kn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Vn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new jr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:dr.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:dr.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}jr.create=e=>new jr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:So.ZodDate,...mr(e)});class $r extends vr{_parse(e){if(this._getType(e)!==qn.symbol){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.symbol,received:t.parsedType}),nr}return or(e.data)}}$r.create=e=>new $r({typeName:So.ZodSymbol,...mr(e)});class zr extends vr{_parse(e){if(this._getType(e)!==qn.undefined){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.undefined,received:t.parsedType}),nr}return or(e.data)}}zr.create=e=>new zr({typeName:So.ZodUndefined,...mr(e)});class Hr extends vr{_parse(e){if(this._getType(e)!==qn.null){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.null,received:t.parsedType}),nr}return or(e.data)}}Hr.create=e=>new Hr({typeName:So.ZodNull,...mr(e)});class Vr extends vr{constructor(){super(...arguments),this._any=!0}_parse(e){return or(e.data)}}Vr.create=e=>new Vr({typeName:So.ZodAny,...mr(e)});class Wr extends vr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return or(e.data)}}Wr.create=e=>new Wr({typeName:So.ZodUnknown,...mr(e)});class qr extends vr{_parse(e){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.never,received:t.parsedType}),nr}}qr.create=e=>new qr({typeName:So.ZodNever,...mr(e)});class Gr extends vr{_parse(e){if(this._getType(e)!==qn.undefined){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.void,received:t.parsedType}),nr}return or(e.data)}}Gr.create=e=>new Gr({typeName:So.ZodVoid,...mr(e)});class Kr extends vr{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==qn.array)return er(t,{code:Kn.invalid_type,expected:qn.array,received:t.parsedType}),nr;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,o=t.data.length<r.exactLength.value;(e||o)&&(er(t,{code:e?Kn.too_big:Kn.too_small,minimum:o?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(er(t,{code:Kn.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(er(t,{code:Kn.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new hr(t,e,t.path,n)))).then(e=>tr.mergeArray(n,e));const o=[...t.data].map((e,n)=>r.type._parseSync(new hr(t,e,t.path,n)));return tr.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Kr({...this._def,minLength:{value:e,message:dr.toString(t)}})}max(e,t){return new Kr({...this._def,maxLength:{value:e,message:dr.toString(t)}})}length(e,t){return new Kr({...this._def,exactLength:{value:e,message:dr.toString(t)}})}nonempty(e){return this.min(1,e)}}function Yr(e){if(e instanceof Zr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=go.create(Yr(r))}return new Zr({...e._def,shape:()=>t})}return e instanceof Kr?new Kr({...e._def,type:Yr(e.element)}):e instanceof go?go.create(Yr(e.unwrap())):e instanceof mo?mo.create(Yr(e.unwrap())):e instanceof no?no.create(e.items.map(e=>Yr(e))):e}Kr.create=(e,t)=>new Kr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:So.ZodArray,...mr(t)});class Zr extends vr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Vn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==qn.object){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.object,received:t.parsedType}),nr}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof qr&&"strip"===this._def.unknownKeys))for(const e in n.data)o.includes(e)||i.push(e);const a=[];for(const e of o){const t=r[e],o=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new hr(n,o,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof qr){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&(er(n,{code:Kn.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new hr(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of a){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>tr.mergeObjectSync(t,e)):tr.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return dr.errToObj,new Zr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,o,i,a;const s=null!==(i=null===(o=(r=this._def).errorMap)||void 0===o?void 0:o.call(r,t,n).message)&&void 0!==i?i:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=dr.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Zr({...this._def,unknownKeys:"strip"})}passthrough(){return new Zr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Zr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Zr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:So.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Zr({...this._def,catchall:e})}pick(e){const t={};return Vn.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new Zr({...this._def,shape:()=>t})}omit(e){const t={};return Vn.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new Zr({...this._def,shape:()=>t})}deepPartial(){return Yr(this)}partial(e){const t={};return Vn.objectKeys(this.shape).forEach(n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}),new Zr({...this._def,shape:()=>t})}required(e){const t={};return Vn.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof go;)e=e._def.innerType;t[n]=e}}),new Zr({...this._def,shape:()=>t})}keyof(){return uo(Vn.objectKeys(this.shape))}}Zr.create=(e,t)=>new Zr({shape:()=>e,unknownKeys:"strip",catchall:qr.create(),typeName:So.ZodObject,...mr(t)}),Zr.strictCreate=(e,t)=>new Zr({shape:()=>e,unknownKeys:"strict",catchall:qr.create(),typeName:So.ZodObject,...mr(t)}),Zr.lazycreate=(e,t)=>new Zr({shape:e,unknownKeys:"strip",catchall:qr.create(),typeName:So.ZodObject,...mr(t)});class Xr extends vr{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map(e=>new Yn(e.ctx.common.issues));return er(t,{code:Kn.invalid_union,unionErrors:n}),nr});{let e;const r=[];for(const o of n){const n={...t,common:{...t.common,issues:[]},parent:null},i=o._parseSync({data:t.data,path:t.path,parent:n});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=r.map(e=>new Yn(e));return er(t,{code:Kn.invalid_union,unionErrors:o}),nr}}get options(){return this._def.options}}Xr.create=(e,t)=>new Xr({options:e,typeName:So.ZodUnion,...mr(t)});const Qr=e=>e instanceof so?Qr(e.schema):e instanceof ho?Qr(e.innerType()):e instanceof lo?[e.value]:e instanceof co?e.options:e instanceof po?Vn.objectValues(e.enum):e instanceof vo?Qr(e._def.innerType):e instanceof zr?[void 0]:e instanceof Hr?[null]:e instanceof go?[void 0,...Qr(e.unwrap())]:e instanceof mo?[null,...Qr(e.unwrap())]:e instanceof Eo||e instanceof xo?Qr(e.unwrap()):e instanceof yo?Qr(e._def.innerType):[];class Jr extends vr{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==qn.object)return er(t,{code:Kn.invalid_type,expected:qn.object,received:t.parsedType}),nr;const n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(er(t,{code:Kn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),nr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=Qr(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of t){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,n)}}return new Jr({typeName:So.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...mr(n)})}}function eo(e,t){const n=Gn(e),r=Gn(t);if(e===t)return{valid:!0,data:e};if(n===qn.object&&r===qn.object){const n=Vn.objectKeys(t),r=Vn.objectKeys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const n of r){const r=eo(e[n],t[n]);if(!r.valid)return{valid:!1};o[n]=r.data}return{valid:!0,data:o}}if(n===qn.array&&r===qn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const o=eo(e[r],t[r]);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}return n===qn.date&&r===qn.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class to extends vr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(ir(e)||ir(r))return nr;const o=eo(e.value,r.value);return o.valid?((ar(e)||ar(r))&&t.dirty(),{status:t.value,value:o.data}):(er(n,{code:Kn.invalid_intersection_types}),nr)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}to.create=(e,t,n)=>new to({left:e,right:t,typeName:So.ZodIntersection,...mr(n)});class no extends vr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==qn.array)return er(n,{code:Kn.invalid_type,expected:qn.array,received:n.parsedType}),nr;if(n.data.length<this._def.items.length)return er(n,{code:Kn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),nr;!this._def.rest&&n.data.length>this._def.items.length&&(er(n,{code:Kn.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new hr(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>tr.mergeArray(t,e)):tr.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new no({...this._def,rest:e})}}no.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new no({items:e,typeName:So.ZodTuple,rest:null,...mr(t)})};class ro extends vr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==qn.object)return er(n,{code:Kn.invalid_type,expected:qn.object,received:n.parsedType}),nr;const r=[],o=this._def.keyType,i=this._def.valueType;for(const e in n.data)r.push({key:o._parse(new hr(n,e,n.path,e)),value:i._parse(new hr(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?tr.mergeObjectAsync(t,r):tr.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new ro(t instanceof vr?{keyType:e,valueType:t,typeName:So.ZodRecord,...mr(n)}:{keyType:Br.create(),valueType:e,typeName:So.ZodRecord,...mr(t)})}}class oo extends vr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==qn.map)return er(n,{code:Kn.invalid_type,expected:qn.map,received:n.parsedType}),nr;const r=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([e,t],i)=>({key:r._parse(new hr(n,e,n.path,[i,"key"])),value:o._parse(new hr(n,t,n.path,[i,"value"]))}));if(n.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const n of i){const r=await n.key,o=await n.value;if("aborted"===r.status||"aborted"===o.status)return nr;"dirty"!==r.status&&"dirty"!==o.status||t.dirty(),e.set(r.value,o.value)}return{status:t.value,value:e}})}{const e=new Map;for(const n of i){const r=n.key,o=n.value;if("aborted"===r.status||"aborted"===o.status)return nr;"dirty"!==r.status&&"dirty"!==o.status||t.dirty(),e.set(r.value,o.value)}return{status:t.value,value:e}}}}oo.create=(e,t,n)=>new oo({valueType:t,keyType:e,typeName:So.ZodMap,...mr(n)});class io extends vr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==qn.set)return er(n,{code:Kn.invalid_type,expected:qn.set,received:n.parsedType}),nr;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(er(n,{code:Kn.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(er(n,{code:Kn.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const o=this._def.valueType;function i(e){const n=new Set;for(const r of e){if("aborted"===r.status)return nr;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map((e,t)=>o._parse(new hr(n,e,n.path,t)));return n.common.async?Promise.all(a).then(e=>i(e)):i(a)}min(e,t){return new io({...this._def,minSize:{value:e,message:dr.toString(t)}})}max(e,t){return new io({...this._def,maxSize:{value:e,message:dr.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}io.create=(e,t)=>new io({valueType:e,minSize:null,maxSize:null,typeName:So.ZodSet,...mr(t)});class ao extends vr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==qn.function)return er(t,{code:Kn.invalid_type,expected:qn.function,received:t.parsedType}),nr;function n(e,n){return Jn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Qn(),Zn].filter(e=>!!e),issueData:{code:Kn.invalid_arguments,argumentsError:n}})}function r(e,n){return Jn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Qn(),Zn].filter(e=>!!e),issueData:{code:Kn.invalid_return_type,returnTypeError:n}})}const o={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof fo){const e=this;return or(async function(...t){const a=new Yn([]),s=await e._def.args.parseAsync(t,o).catch(e=>{throw a.addIssue(n(t,e)),a}),l=await Reflect.apply(i,this,s),u=await e._def.returns._def.type.parseAsync(l,o).catch(e=>{throw a.addIssue(r(l,e)),a});return u})}{const e=this;return or(function(...t){const a=e._def.args.safeParse(t,o);if(!a.success)throw new Yn([n(t,a.error)]);const s=Reflect.apply(i,this,a.data),l=e._def.returns.safeParse(s,o);if(!l.success)throw new Yn([r(s,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ao({...this._def,args:no.create(e).rest(Wr.create())})}returns(e){return new ao({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ao({args:e||no.create([]).rest(Wr.create()),returns:t||Wr.create(),typeName:So.ZodFunction,...mr(n)})}}class so extends vr{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}so.create=(e,t)=>new so({getter:e,typeName:So.ZodLazy,...mr(t)});class lo extends vr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return er(t,{received:t.data,code:Kn.invalid_literal,expected:this._def.value}),nr}return{status:"valid",value:e.data}}get value(){return this._def.value}}function uo(e,t){return new co({values:e,typeName:So.ZodEnum,...mr(t)})}lo.create=(e,t)=>new lo({value:e,typeName:So.ZodLiteral,...mr(t)});class co extends vr{constructor(){super(...arguments),pr.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return er(t,{expected:Vn.joinValues(n),received:t.parsedType,code:Kn.invalid_type}),nr}if(ur(this,pr)||cr(this,pr,new Set(this._def.values)),!ur(this,pr).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return er(t,{received:t.data,code:Kn.invalid_enum_value,options:n}),nr}return or(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return co.create(e,{...this._def,...t})}exclude(e,t=this._def){return co.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}pr=new WeakMap,co.create=uo;class po extends vr{constructor(){super(...arguments),fr.set(this,void 0)}_parse(e){const t=Vn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==qn.string&&n.parsedType!==qn.number){const e=Vn.objectValues(t);return er(n,{expected:Vn.joinValues(e),received:n.parsedType,code:Kn.invalid_type}),nr}if(ur(this,fr)||cr(this,fr,new Set(Vn.getValidEnumValues(this._def.values))),!ur(this,fr).has(e.data)){const e=Vn.objectValues(t);return er(n,{received:n.data,code:Kn.invalid_enum_value,options:e}),nr}return or(e.data)}get enum(){return this._def.values}}fr=new WeakMap,po.create=(e,t)=>new po({values:e,typeName:So.ZodNativeEnum,...mr(t)});class fo extends vr{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==qn.promise&&!1===t.common.async)return er(t,{code:Kn.invalid_type,expected:qn.promise,received:t.parsedType}),nr;const n=t.parsedType===qn.promise?t.data:Promise.resolve(t.data);return or(n.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}fo.create=(e,t)=>new fo({type:e,typeName:So.ZodPromise,...mr(t)});class ho extends vr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===So.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:e=>{er(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===r.type){const e=r.transform(n.data,o);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return nr;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?nr:"dirty"===r.status||"dirty"===t.value?rr(r.value):r});{if("aborted"===t.value)return nr;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?nr:"dirty"===r.status||"dirty"===t.value?rr(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,o);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?nr:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?nr:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!sr(e))return e;const i=r.transform(e.value,o);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>sr(e)?Promise.resolve(r.transform(e.value,o)).then(e=>({status:t.value,value:e})):e)}Vn.assertNever(r)}}ho.create=(e,t,n)=>new ho({schema:e,typeName:So.ZodEffects,effect:t,...mr(n)}),ho.createWithPreprocess=(e,t,n)=>new ho({schema:t,effect:{type:"preprocess",transform:e},typeName:So.ZodEffects,...mr(n)});class go extends vr{_parse(e){return this._getType(e)===qn.undefined?or(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}go.create=(e,t)=>new go({innerType:e,typeName:So.ZodOptional,...mr(t)});class mo extends vr{_parse(e){return this._getType(e)===qn.null?or(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}mo.create=(e,t)=>new mo({innerType:e,typeName:So.ZodNullable,...mr(t)});class vo extends vr{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===qn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}vo.create=(e,t)=>new vo({innerType:e,typeName:So.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...mr(t)});class yo extends vr{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return lr(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new Yn(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new Yn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}yo.create=(e,t)=>new yo({innerType:e,typeName:So.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...mr(t)});class bo extends vr{_parse(e){if(this._getType(e)!==qn.nan){const t=this._getOrReturnCtx(e);return er(t,{code:Kn.invalid_type,expected:qn.nan,received:t.parsedType}),nr}return{status:"valid",value:e.data}}}bo.create=e=>new bo({typeName:So.ZodNaN,...mr(e)});const wo=Symbol("zod_brand");class Eo extends vr{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class _o extends vr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?nr:"dirty"===e.status?(t.dirty(),rr(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?nr:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new _o({in:e,out:t,typeName:So.ZodPipeline})}}class xo extends vr{_parse(e){const t=this._def.innerType._parse(e),n=e=>(sr(e)&&(e.value=Object.freeze(e.value)),e);return lr(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}function ko(e,t={},n){return e?Vr.create().superRefine((r,o)=>{var i,a;if(!e(r)){const e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,s=null===(a=null!==(i=e.fatal)&&void 0!==i?i:n)||void 0===a||a,l="string"==typeof e?{message:e}:e;o.addIssue({code:"custom",...l,fatal:s})}}):Vr.create()}xo.create=(e,t)=>new xo({innerType:e,typeName:So.ZodReadonly,...mr(t)});const Co={object:Zr.lazycreate};var So;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(So||(So={}));const To=Br.create,Do=Lr.create,Ao=bo.create,Oo=Mr.create,Po=Ur.create,Io=jr.create,No=$r.create,Ro=zr.create,Bo=Hr.create,Fo=Vr.create,Lo=Wr.create,Mo=qr.create,Uo=Gr.create,jo=Kr.create,$o=Zr.create,zo=Zr.strictCreate,Ho=Xr.create,Vo=Jr.create,Wo=to.create,qo=no.create,Go=ro.create,Ko=oo.create,Yo=io.create,Zo=ao.create,Xo=so.create,Qo=lo.create,Jo=co.create,ei=po.create,ti=fo.create,ni=ho.create,ri=go.create,oi=mo.create,ii=ho.createWithPreprocess,ai=_o.create,si={string:e=>Br.create({...e,coerce:!0}),number:e=>Lr.create({...e,coerce:!0}),boolean:e=>Ur.create({...e,coerce:!0}),bigint:e=>Mr.create({...e,coerce:!0}),date:e=>jr.create({...e,coerce:!0})},li=nr;var ui=Object.freeze({__proto__:null,defaultErrorMap:Zn,setErrorMap:function(e){Xn=e},getErrorMap:Qn,makeIssue:Jn,EMPTY_PATH:[],addIssueToContext:er,ParseStatus:tr,INVALID:nr,DIRTY:rr,OK:or,isAborted:ir,isDirty:ar,isValid:sr,isAsync:lr,get util(){return Vn},get objectUtil(){return Wn},ZodParsedType:qn,getParsedType:Gn,ZodType:vr,datetimeRegex:Nr,ZodString:Br,ZodNumber:Lr,ZodBigInt:Mr,ZodBoolean:Ur,ZodDate:jr,ZodSymbol:$r,ZodUndefined:zr,ZodNull:Hr,ZodAny:Vr,ZodUnknown:Wr,ZodNever:qr,ZodVoid:Gr,ZodArray:Kr,ZodObject:Zr,ZodUnion:Xr,ZodDiscriminatedUnion:Jr,ZodIntersection:to,ZodTuple:no,ZodRecord:ro,ZodMap:oo,ZodSet:io,ZodFunction:ao,ZodLazy:so,ZodLiteral:lo,ZodEnum:co,ZodNativeEnum:po,ZodPromise:fo,ZodEffects:ho,ZodTransformer:ho,ZodOptional:go,ZodNullable:mo,ZodDefault:vo,ZodCatch:yo,ZodNaN:bo,BRAND:wo,ZodBranded:Eo,ZodPipeline:_o,ZodReadonly:xo,custom:ko,Schema:vr,ZodSchema:vr,late:Co,get ZodFirstPartyTypeKind(){return So},coerce:si,any:Fo,array:jo,bigint:Oo,boolean:Po,date:Io,discriminatedUnion:Vo,effect:ni,enum:Jo,function:Zo,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>ko(t=>t instanceof e,t),intersection:Wo,lazy:Xo,literal:Qo,map:Ko,nan:Ao,nativeEnum:ei,never:Mo,null:Bo,nullable:oi,number:Do,object:$o,oboolean:()=>Po().optional(),onumber:()=>Do().optional(),optional:ri,ostring:()=>To().optional(),pipeline:ai,preprocess:ii,promise:ti,record:Go,set:Yo,strictObject:zo,string:To,symbol:No,transformer:ni,tuple:qo,undefined:Ro,union:Ho,unknown:Lo,void:Uo,NEVER:li,ZodIssueCode:Kn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Yn});new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var ci={code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},di={code:"1",name:"function_call",parse:e=>{if(null==e||"object"!=typeof e||!("function_call"in e)||"object"!=typeof e.function_call||null==e.function_call||!("name"in e.function_call)||!("arguments"in e.function_call)||"string"!=typeof e.function_call.name||"string"!=typeof e.function_call.arguments)throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},pi={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},fi={code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},hi={code:"4",name:"assistant_message",parse:e=>{if(!(null!=e&&"object"==typeof e&&"id"in e&&"role"in e&&"content"in e&&"string"==typeof e.id&&"string"==typeof e.role&&"assistant"===e.role&&Array.isArray(e.content)&&e.content.every(e=>null!=e&&"object"==typeof e&&"type"in e&&"text"===e.type&&"text"in e&&null!=e.text&&"object"==typeof e.text&&"value"in e.text&&"string"==typeof e.text.value)))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},gi={code:"5",name:"assistant_control_data",parse:e=>{if(null==e||"object"!=typeof e||!("threadId"in e)||!("messageId"in e)||"string"!=typeof e.threadId||"string"!=typeof e.messageId)throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},mi={code:"6",name:"data_message",parse:e=>{if(null==e||"object"!=typeof e||!("role"in e)||!("data"in e)||"string"!=typeof e.role||"data"!==e.role)throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},vi={code:"7",name:"tool_calls",parse:e=>{if(null==e||"object"!=typeof e||!("tool_calls"in e)||"object"!=typeof e.tool_calls||null==e.tool_calls||!Array.isArray(e.tool_calls)||e.tool_calls.some(e=>!(null!=e&&"object"==typeof e&&"id"in e&&"string"==typeof e.id&&"type"in e&&"string"==typeof e.type&&"function"in e&&null!=e.function&&"object"==typeof e.function&&"arguments"in e.function&&"string"==typeof e.function.name&&"string"==typeof e.function.arguments)))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},yi={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},bi={code:"9",name:"tool_call",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName||!("args"in e)||"object"!=typeof e.args)throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},wi={code:"a",name:"tool_result",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},Ei={code:"b",name:"tool_call_streaming_start",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName)throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},_i={code:"c",name:"tool_call_delta",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("argsTextDelta"in e)||"string"!=typeof e.argsTextDelta)throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},xi={code:"d",name:"finish_message",parse:e=>{if(!(null!=e&&"object"==typeof e&&"finishReason"in e&&"string"==typeof e.finishReason&&"usage"in e&&null!=e.usage&&"object"==typeof e.usage&&"promptTokens"in e.usage&&"completionTokens"in e.usage))throw new Error('"finish_message" parts expect an object with a "finishReason" and "usage" property.');return"number"!=typeof e.usage.promptTokens&&(e.usage.promptTokens=Number.NaN),"number"!=typeof e.usage.completionTokens&&(e.usage.completionTokens=Number.NaN),{type:"finish_message",value:e}}},ki=[ci,di,pi,fi,hi,gi,mi,vi,yi,bi,wi,Ei,_i,xi],Ci={[ci.code]:ci,[di.code]:di,[pi.code]:pi,[fi.code]:fi,[hi.code]:hi,[gi.code]:gi,[mi.code]:mi,[vi.code]:vi,[yi.code]:yi,[bi.code]:bi,[wi.code]:wi,[Ei.code]:Ei,[_i.code]:_i,[xi.code]:xi},Si=ki.map(e=>e.code),Ti=e=>{const t=e.indexOf(":");if(-1===t)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!Si.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return Ci[r].parse(i)},Di="\n".charCodeAt(0);function Ai(e,t){const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return e.length=0,n}let Oi=null;const Pi=e=>async({messages:t,onMessageStream:n})=>{try{Oi=new AbortController;const r=e.apiHost,o=await fetch((nt(r)?r:St())+`/api/v2/sessions/${e.sessionId}/streamMessage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t}),signal:Oi.signal});if(!o.ok){if((e.retryAttempt??0)<1&&(403===o.status||500===o.status||503===o.status))return await new Promise(e=>setTimeout(e,3e3)),Pi({...e,retryAttempt:(e.retryAttempt??0)+1})({messages:t,onMessageStream:n});try{return{error:await o.json()||"Failed to fetch the chat response."}}catch{return{error:{message:"Failed to fetch the chat response."}}}}if(!o.body)throw new Error("The response body is empty.");let i="";const a=o.body.getReader(),s=fe();for await(const{type:e,value:t}of async function*(e,{isAborted:t}={}){const n=new TextDecoder,r=[];let o=0;for(;;){const{value:i}=await e.read();if(i&&(r.push(i),o+=i.length,i[i.length-1]!==Di))continue;if(0===r.length)break;const a=Ai(r,o);o=0;const s=n.decode(a,{stream:!0}).split("\n").filter(e=>""!==e).map(Ti);for(const e of s)yield e;if(null==t?void 0:t()){e.cancel();break}}}(a,{isAborted:()=>null===Oi}))if("text"===e)i+=t,n&&n({id:s,message:i});else if("error"===e)return{error:{message:t}};return Oi=null,{message:i}}catch(e){return console.error(e),"AbortError"===e.name?(Oi=null,{error:{message:"Request aborted"}}):e instanceof Error?{error:{message:e.message}}:{error:{message:"Failed to fetch the chat response."}}}},Ii=e=>{if(!et(e)){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{console.warn("Failed to safely stringify variable value",e)}}},Ni=Object.getPrototypeOf(async function(){}).constructor,Ri=async e=>{tt(e?.pixelId)||(e=>{if(!e?.eventType||!e.pixelId)return;if(!window.fbq)return void console.error("Facebook Pixel was not properly initialized");const t=e.params?.length?e.params.reduce((e,t)=>t.key&&t.value?{...e,[t.key]:t.value}:e,{}):void 0;if("Custom"===e.eventType){if(!e.name)return;window.fbq("trackSingleCustom",e.pixelId,e.name,t)}window.fbq("trackSingle",e.pixelId,e.eventType,t)})(e)},Bi=async e=>{const t=e.customHeadCode;nt(t)&&(e=>{e.split("</noscript>").forEach(e=>{const[t,n]=e.split("<noscript>"),r=document.createRange().createContextualFragment(t);if(document.head.append(r),et(n))return;const o=document.createElement("noscript"),i=document.createRange().createContextualFragment(n);o.append(i),document.head.append(o)})})(t);const n=e.gtmId;nt(n)&&document.body.prepend((e=>{if(document.getElementById("gtm-noscript"))return"";const t=document.createElement("noscript");t.id="gtm-noscript";const n=document.createElement("iframe");return n.src=`https://www.googletagmanager.com/ns.html?id=${e}`,n.height="0",n.width="0",n.style.display="none",n.style.visibility="hidden",t.appendChild(n),t})(n));const r=e.pixelIds;Je(r)&&(e=>{const t=document.createElement("script");t.innerHTML=`!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n ${e.map(e=>`fbq('init', '${e}');`).join("\n")}\n fbq('track', 'PageView');`,document.head.appendChild(t)})(r)},Fi=async({clientSideAction:e,context:t,onMessageStream:n})=>{if("chatwoot"in e)return r=e.chatwoot,void Pn(r.scriptToExecute);var r;if("scriptToExecute"in e)return Pn(e.scriptToExecute);if("redirect"in e)return(({url:e,isNewTab:t}={})=>{if(!e)return;if(!t)return void(window.location.href=e);const n=window.open(e,"_blank");if(!n)return{blockedPopupUrl:e};try{if(n.closed)return{blockedPopupUrl:e};if(!n.opener)return n.close(),{blockedPopupUrl:e}}catch{return{blockedPopupUrl:e}}})(e.redirect);if("wait"in e)return await(async({secondsToWaitFor:e})=>{await new Promise(t=>setTimeout(t,1e3*e))})(e.wait),e.expectsDedicatedReply?{replyToSend:void 0}:void 0;if("setVariable"in e)return(async({content:e,args:t,isCode:n})=>{try{if(!isNaN(e)&&/0[^.].+/.test(e))return{replyToSend:e};const n=Ni(...t.map(e=>e.id),e.includes("return ")?e:`return ${e}`),r=await n(...t.map(e=>e.value));return{replyToSend:Ii(r)??void 0}}catch(t){return console.error(t),{replyToSend:Ii(e)??void 0,logs:n?[{status:"error",description:"Failed to execute Variable code",details:An(t)}]:void 0}}})(e.setVariable.scriptToExecute);if("streamOpenAiChatCompletion"in e||"stream"in e){const{error:r,message:o}=await Pi(t)({messages:"streamOpenAiChatCompletion"in e?e.streamOpenAiChatCompletion?.messages:void 0,onMessageStream:n});return r?{replyToSend:void 0,logs:[{status:"error",description:"Message streaming returned an error",details:JSON.stringify(r,null,2)}]}:{replyToSend:o}}if("webhookToExecute"in e){return{replyToSend:await(async e=>{const{url:t,method:n,body:r,headers:o}=e;try{const e=await fetch(t,{method:n,body:"GET"!==n&&r?JSON.stringify(r):void 0,headers:o}),i=e.status,a=await e.json();return JSON.stringify({statusCode:i,data:a})}catch(e){return console.error(e),JSON.stringify({statusCode:500,data:"An error occured while executing the webhook on the client"})}})(e.webhookToExecute)}}return"startPropsToInject"in e?Bi(e.startPropsToInject):"pixel"in e?Ri(e.pixel):"codeToExecute"in e?Nn(e.codeToExecute):void 0},[Li,Mi]=O(),Ui=U(),ji=e=>{const[t,n]=O({}),[r,o]=O(e.initialChatReply.bot.theme),[i,a]=O(!1),[s,l]=O(!1),[u,c]=O(),[d,p]=O(e.initialChatReply.dynamicTheme),[f,h]=O([]);const[g,m,v,y]=Tn(O([{input:e.initialChatReply.input,messages:e.initialChatReply.messages,clientSideActions:e.initialChatReply.clientSideActions}]),{key:`bot-${e.context.bot.id}-chatChunks`,storage:e.context.storage,onRecovered:()=>{}});I(()=>{if(v()){const e=[...g()].reverse().find(e=>e.input);e?.input&&h([e.input])}else e.initialChatReply.input&&h([e.initialChatReply.input])});const[b,w]=O({}),E=()=>[...g()].pop(),_=async t=>{y(!1),a(!1);const n=E()?.input;t&&m(e=>{const n=e.length-1;if(n<0)return e;const r=e[n];return r.input?[...e.slice(0,n),{...r,input:{...r.input,answer:t}}]:e}),n?.id&&e.onAnswer&&t&&e.onAnswer({message:tn(t),blockId:n.id});const r=n?.id&&t?{inputBlockId:n.id,inputType:n.type}:void 0,o=setTimeout(()=>{l(!0)},1e3),{data:i,error:s}=await(async({apiHost:e,message:t,sessionId:n,messageMetadata:r})=>{try{return{data:await Xt.post(`${nt(e)?e:St()}/api/v1/sessions/${n}/continueChat`,{json:{message:t,messageMetadata:r},timeout:!1}).json()}}catch(e){return{error:e}}})({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,message:an(t),messageMetadata:r});if(clearTimeout(o),l(!1),s){a(!0);const t=[{description:"Failed to send the reply",details:s instanceof At?{status:s.response.status,body:await s.response.json()}:s,status:"error"}];return await nn({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:t}),void e.onNewLogs?.(t)}if(i){if(i.progress&&e.onProgressUpdate?.(i.progress),i.lastMessageNewFormat&&(on([...rn(),{inputIndex:[...g()].length-1,formattedMessage:i.lastMessageNewFormat}]),m(e=>{const t=e.length-1;if(t<0)return e;const n=e[t];return n.input?.answer&&"text"===n.input.answer.type?[...e.slice(0,t),{...n,input:{...n.input,answer:{...n.input.answer,label:i.lastMessageNewFormat}}}]:e})),i.logs&&e.onNewLogs?.(i.logs),i.dynamicTheme&&p(i.dynamicTheme),i.input&&h([...f(),i.input]),i.clientSideActions){const e=i.clientSideActions.filter(e=>et(e.lastBubbleBlockId));if(await C(e),1===i.clientSideActions.length&&"stream"===i.clientSideActions[0].type&&0===i.messages.length&&void 0===i.input)return}m(e=>[...e,{input:i.input,messages:i.messages,clientSideActions:i.clientSideActions}])}},x=({id:e,message:t})=>{l(!1);const n=[...g()].pop();n&&(n.streamingMessageId!==e&&m(t=>[...t,{messages:[],streamingMessageId:e}]),Mi({id:e,content:t}))},k=async t=>{t&&(e.onNewLogs?.(t),e.context.isPreview||await nn({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:t}))},C=async t=>{if(!v())for(const n of t){("streamOpenAiChatCompletion"in n||"webhookToExecute"in n||"stream"in n)&&l(!0);const t=await Fi({clientSideAction:n,context:{apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId},onMessageStream:x});if(t&&"logs"in t&&k(t.logs),t&&"replyToSend"in t)return l(!1),void _(t.replyToSend?{type:"text",value:t.replyToSend}:void 0);t&&"blockedPopupUrl"in t&&c(t.blockedPopupUrl)}};return I(()=>{o(((e,t)=>({...e,chat:{...e.chat,hostAvatar:e.chat?.hostAvatar&&t?.hostAvatarUrl?{...e.chat.hostAvatar,url:t.hostAvatarUrl}:e.chat?.hostAvatar,guestAvatar:e.chat?.guestAvatar&&t?.guestAvatarUrl?{...e.chat.guestAvatar,url:t?.guestAvatarUrl}:e.chat?.guestAvatar}}))(e.initialChatReply.bot.theme,d()))}),F(()=>{Mi(void 0),on([])}),ie(Ui.Provider,{value:{chatChunks:g,theme:r,dynamicTheme:d,setTheme:o,answers:t,setAnswer:(e,t)=>{n(n=>({...n,[e]:t}))},getAnswer:e=>t()[e],hasError:i,setHasError:a,blockRef:void 0,currentBlock:E,blockedPopupUrl:u,setBlockedPopupUrl:c,isSending:s,displayedMessageIndexes:b,setDisplayedMessageIndex:(e,t)=>{w(n=>({...n,[e]:t}))},getDisplayedMessageIndex:e=>b()[e]??0,sendMessage:_,processClientSideActions:C,onBubblesDisplayed:()=>{const t=f();if(t.length>0){const[n,...r]=t;e.onNewBlock?.({id:n.id,type:n.type}),h(r)}}},get children(){return e.children}})},$i=()=>{const e=j(Ui);if(!e)throw new Error("useInputAnswer must be used within an InputAnswerProvider");return e},[zi,Hi]=O(),Vi=De('<div class="flex items-center gap-1"><div class="w-2 h-2 rounded-full bubble__dot--1"></div><div class="w-2 h-2 rounded-full bubble__dot--2"></div><div class="w-2 h-2 rounded-full bubble__dot--3">'),Wi=()=>Vi(),qi=!0,Gi=De('<div><div class="flex w-full items-center"><div class="flex z-10 items-start w-full max-w-full"><div>'),Ki=De('<audio class="w-full animate-fade-in" controls>');let Yi;const Zi=e=>{let t,n,r=!1;const[o,i]=O(!!e.onTransitionEnd);return B(()=>{Yi=setTimeout(()=>{r||(r=!0,i(!1),setTimeout(()=>e.onTransitionEnd?.(t),400))},100)}),F(()=>{Yi&&clearTimeout(Yi)}),(()=>{const r=Gi(),i=r.firstChild.firstChild.firstChild;return"function"==typeof t?Re(t,r):t=r,Be(i,(()=>{const t=N(()=>!!o());return()=>t()?ie(Wi,{}):(()=>{const t=Ki();return"function"==typeof n?Re(n,t):n=t,P(n=>{const r=e.content?.url,o=!!e.onTransitionEnd&&(e.content?.isAutoplayEnabled??qi);return r!==n._v$3&&Oe(t,"src",n._v$3=r),o!==n._v$4&&(t.autoplay=n._v$4=o),n},{_v$3:void 0,_v$4:void 0}),t})()})()),P(t=>{const n=it("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),a=it("bubble bubble--host relative transition-all duration-300",o()&&"bubble--typing");return n!==t._v$&&Pe(r,t._v$=n),a!==t._v$2&&Pe(i,t._v$2=a),t},{_v$:void 0,_v$2:void 0}),r})()},[Xi,Qi]=O("100%"),Ji=De('<div><div class="flex w-full items-center"><div class="flex z-10 items-start w-full max-w-full"><div>'),ea=De('<div class="w-full overflow-y-auto">'),ta=De('<div class="animate-fade-in w-full">'),na=De('<iframe id="bubble--embed" class="w-full h-full rounded-md">');let ra;const oa=e=>{let t,n;const[r,o]=O(!!e.onTransitionEnd),i=e.content?.initFunction,a=t=>{e.content?.waitForEvent?.isEnabled&&nt(t.data.name)&&t.data.name===e.content?.waitForEvent.name&&(e.onCompleted?.(e.content.waitForEvent.saveDataInVariableId&&t.data.data?{type:"text",value:t.data.data}:void 0),window.removeEventListener("message",a))};return B(()=>{if(i){Nn({args:{...i.args,botElement:n},content:i.content});const t=e.content?.waitForEventFunction;t&&Nn({args:{...t.args,continueFlow:t=>e.onCompleted?.(t?{type:"text",value:t}:void 0)},content:t.content})}ra=setTimeout(()=>{o(!1),!i&&e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",a),setTimeout(()=>{e.onTransitionEnd?.(t)},400)},2e3)}),F(()=>{ra&&clearTimeout(ra),window.removeEventListener("message",a)}),(()=>{const o=Ji(),a=o.firstChild.firstChild.firstChild;return"function"==typeof t?Re(t,o):t=o,Be(a,(()=>{const t=N(()=>!!r());return()=>t()?ie(Wi,{}):(()=>{const t=ta();return Be(t,ie(ve,{when:i,get fallback(){return(()=>{const t=na();return P(()=>Oe(t,"src",e.content?.url)),t})()},get children(){const e=ea();return"function"==typeof n?Re(n,e):n=e,P(()=>null!=`calc(${Xi()} - 100px)`?e.style.setProperty("max-height",`calc(${Xi()} - 100px)`):e.style.removeProperty("max-height")),e}})),t})()})()),P(t=>{const n=it("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),i=it("bubble bubble--host relative transition-all duration-300 z-20 w-full",r()&&"bubble--typing");return n!==t._v$&&Pe(o,t._v$=n),i!==t._v$2&&Pe(a,t._v$2=i),t},{_v$:void 0,_v$2:void 0}),o})()},ia={alt:"Bubble image"},aa=De('<img elementtiming="Bubble image" fetchpriority="high">'),sa=De('<div><div class="flex w-full items-center"><div class="flex z-10 items-start max-w-full"><div>'),la=De('<div class="animate-fade-in w-full">'),ua=De('<a target="_blank" class="z-10 bubble">'),ca=De('<figure class="z-10 w-full">');let da;const pa=e=>{let t,n;const[r,o]=O(!!e.onTransitionEnd),i=()=>{r()&&(o(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},400))};B(()=>{n&&(da=setTimeout(i,5e3),n.onload=()=>{clearTimeout(da),i()})}),F(()=>{da&&clearTimeout(da)});const a=(()=>{const t=aa();return"function"==typeof n?Re(n,t):n=t,t.style.setProperty("max-height","512px"),P(n=>{const r=e.content?.url,o=e.content?.clickLink?.alt??ia.alt,i=it(e.onTransitionEnd?"transition-opacity duration-[400ms] ease-in delay-200":void 0,e.content?.url?.endsWith(".svg")?"w-full":void 0,"rounded-md");return r!==n._v$&&Oe(t,"src",n._v$=r),o!==n._v$2&&Oe(t,"alt",n._v$2=o),i!==n._v$3&&Pe(t,n._v$3=i),n},{_v$:void 0,_v$2:void 0,_v$3:void 0}),t})();return(()=>{const n=sa(),o=n.firstChild.firstChild.firstChild;return"function"==typeof t?Re(t,n):t=n,Be(o,(()=>{const t=N(()=>!!r());return()=>t()?ie(Wi,{}):(()=>{const t=la();return Be(t,(()=>{const t=N(()=>!!e.content?.clickLink);return()=>t()?(()=>{const t=ua();return Be(t,a),P(()=>Oe(t,"href",e.content.clickLink.url)),t})():(()=>{const e=ca();return Be(e,a),e})()})()),t})()})()),P(t=>{const i=it("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),a=it("bubble bubble--host relative transition-all duration-300",r()&&"bubble--typing");return i!==t._v$4&&Pe(n,t._v$4=i),a!==t._v$5&&Pe(o,t._v$5=a),t},{_v$4:void 0,_v$5:void 0}),n})()},fa=De("<br>"),ha=De("<span>"),ga=e=>(()=>{const t=ha();return Be(t,()=>e.text,null),Be(t,ie(ve,{get when(){return N(()=>!!e.isUniqueChild)()&&tt(e.text)},get children(){return fa()}}),null),P(()=>Pe(t,((e,t,n)=>{let r="";return e&&(r+="slate-bold"),t&&(r+=" slate-italic"),n&&(r+=" slate-underline"),r})(e.bold,e.italic,e.underline))),t})(),ma=De('<a target="_blank" rel="noopener noreferrer">'),va=De("<ol>"),ya=De("<ul>"),ba=De("<li>"),wa=De("<span>"),Ea=De("<div>"),_a=e=>ie(ye,{get children(){return[ie(be,{get when(){return Je(e.element.text)},get children(){return ie(ga,ce(()=>e.element,{get isUniqueChild(){return e.isUniqueChild??!1}}))}}),ie(be,{when:!0,get children(){return ie(ye,{get children(){return[ie(be,{get when(){return"a"===e.element.type},get children(){const t=ma();return Be(t,ie(ge,{get each(){return e.element.children},children:t=>ie(_a,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),P(()=>Oe(t,"href",e.element.url)),t}}),ie(be,{get when(){return"ol"===e.element.type},get children(){const t=va();return Be(t,ie(ge,{get each(){return e.element.children},children:t=>ie(_a,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),t}}),ie(be,{get when(){return"ul"===e.element.type},get children(){const t=ya();return Be(t,ie(ge,{get each(){return e.element.children},children:t=>ie(_a,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),t}}),ie(be,{get when(){return"li"===e.element.type},get children(){const t=ba();return Be(t,ie(ge,{get each(){return e.element.children},children:t=>ie(_a,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),t}}),ie(be,{when:!0,get children(){return ie(xa,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??!1},get children(){return ie(ge,{get each(){return e.element.children},children:t=>ie(_a,{element:t,get isUniqueChild(){return 1===e.element.children?.length},get insideInlineVariable(){return"inline-variable"===e.element.type}})})}})}})]}})}})]}}),xa=e=>ie(ye,{get children(){return[ie(be,{get when(){return"inline-variable"===e.element.type||e.insideInlineVariable},get children(){const t=wa();return Be(t,()=>e.children),P(()=>Oe(t,"data-element-type",e.element.type)),t}}),ie(be,{when:!0,get children(){const t=Ea();return Be(t,()=>e.children),P(()=>Oe(t,"data-element-type",e.element.type)),t}})]}});var ka,Ca={exports:{}},Sa={};Ca.exports=function(){if(ka)return Sa;ka=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.iterator,p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,h={};function g(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||p}function m(){}function v(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||p}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=g.prototype;var y=v.prototype=new m;y.constructor=v,f(y,g.prototype),y.isPureReactComponent=!0;var b=Array.isArray,w=Object.prototype.hasOwnProperty,E={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function x(t,n,r){var o,i={},a=null,s=null;if(null!=n)for(o in void 0!==n.ref&&(s=n.ref),void 0!==n.key&&(a=""+n.key),n)w.call(n,o)&&!_.hasOwnProperty(o)&&(i[o]=n[o]);var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];i.children=u}if(t&&t.defaultProps)for(o in l=t.defaultProps)void 0===i[o]&&(i[o]=l[o]);return{$$typeof:e,type:t,key:a,ref:s,props:i,_owner:E.current}}function k(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var C=/\/+/g;function S(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function T(n,r,o,i,a){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l=!1;if(null===n)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(n.$$typeof){case e:case t:l=!0}}if(l)return a=a(l=n),n=""===i?"."+S(l,0):i,b(a)?(o="",null!=n&&(o=n.replace(C,"$&/")+"/"),T(a,r,o,"",function(e){return e})):null!=a&&(k(a)&&(a=function(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}(a,o+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(C,"$&/")+"/")+n)),r.push(a)),1;if(l=0,i=""===i?".":i+":",b(n))for(var u=0;u<n.length;u++){var c=i+S(s=n[u],u);l+=T(s,r,o,c,a)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(n),"function"==typeof c)for(n=c.call(n),u=0;!(s=n.next()).done;)l+=T(s=s.value,r,o,c=i+S(s,u++),a);else if("object"===s)throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return l}function D(e,t,n){if(null==e)return e;var r=[],o=0;return T(e,r,"","",function(e){return t.call(n,e,o++)}),r}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O={current:null},P={transition:null},I={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:P,ReactCurrentOwner:E};return Sa.Children={map:D,forEach:function(e,t,n){D(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return D(e,function(){t++}),t},toArray:function(e){return D(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},Sa.Component=g,Sa.Fragment=n,Sa.Profiler=o,Sa.PureComponent=v,Sa.StrictMode=r,Sa.Suspense=l,Sa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,Sa.cloneElement=function(t,n,r){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=f({},t.props),i=t.key,a=t.ref,s=t._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,s=E.current),void 0!==n.key&&(i=""+n.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(u in n)w.call(n,u)&&!_.hasOwnProperty(u)&&(o[u]=void 0===n[u]&&void 0!==l?l[u]:n[u])}var u=arguments.length-2;if(1===u)o.children=r;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];o.children=l}return{$$typeof:e,type:t.type,key:i,ref:a,props:o,_owner:s}},Sa.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:i,_context:e},e.Consumer=e},Sa.createElement=x,Sa.createFactory=function(e){var t=x.bind(null,e);return t.type=e,t},Sa.createRef=function(){return{current:null}},Sa.forwardRef=function(e){return{$$typeof:s,render:e}},Sa.isValidElement=k,Sa.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:A}},Sa.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},Sa.startTransition=function(e){var t=P.transition;P.transition={};try{e()}finally{P.transition=t}},Sa.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},Sa.useCallback=function(e,t){return O.current.useCallback(e,t)},Sa.useContext=function(e){return O.current.useContext(e)},Sa.useDebugValue=function(){},Sa.useDeferredValue=function(e){return O.current.useDeferredValue(e)},Sa.useEffect=function(e,t){return O.current.useEffect(e,t)},Sa.useId=function(){return O.current.useId()},Sa.useImperativeHandle=function(e,t,n){return O.current.useImperativeHandle(e,t,n)},Sa.useInsertionEffect=function(e,t){return O.current.useInsertionEffect(e,t)},Sa.useLayoutEffect=function(e,t){return O.current.useLayoutEffect(e,t)},Sa.useMemo=function(e,t){return O.current.useMemo(e,t)},Sa.useReducer=function(e,t,n){return O.current.useReducer(e,t,n)},Sa.useRef=function(e){return O.current.useRef(e)},Sa.useState=function(e){return O.current.useState(e)},Sa.useSyncExternalStore=function(e,t,n){return O.current.useSyncExternalStore(e,t,n)},Sa.useTransition=function(){return O.current.useTransition()},Sa.version="18.2.0",Sa}();var Ta=Ca.exports,Da=Bn(Ta),Aa=o({__proto__:null,default:Da},[Ta]);function Oa(e){return"init"in e}function Pa(e){return!!e.write}function Ia(e){return"v"in e||"e"in e}function Na(e){if("e"in e)throw e.e;if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}const Ra=new WeakMap;function Ba(e){var t;return La(e)&&!!(null==(t=Ra.get(e))?void 0:t[0])}function Fa(e,t){let n=Ra.get(e);if(!n){n=[!0,new Set],Ra.set(e,n);const t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)}function La(e){return"function"==typeof(null==e?void 0:e.then)}function Ma(e,t,n){if(!n.p.has(e)){n.p.add(e);const r=()=>n.p.delete(e);t.then(r,r)}}function Ua(e,t,n){var r;const o=new Set;for(const t of(null==(r=n.get(e))?void 0:r.t)||[])o.add(t);for(const e of t.p)o.add(e);return o}const ja=(e,t,...n)=>t.read(...n),$a=(e,t,...n)=>t.write(...n),za=(e,t)=>{var n;return null==(n=t.INTERNAL_onInit)?void 0:n.call(t,e)},Ha=(e,t,n)=>{var r;return null==(r=t.onMount)?void 0:r.call(t,n)},Va=(e,t)=>{var n;const r=is(e),o=r[0],i=r[6],a=r[9];if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Atom is undefined or null");let s=o.get(t);return s||(s={d:new Map,p:new Set,n:0},o.set(t,s),null==(n=i.i)||n.call(i,t),null==a||a(e,t)),s},Wa=e=>{const t=is(e),n=t[1],r=t[3],o=t[4],i=t[5],a=t[6],s=t[13],l=[],u=e=>{try{e()}catch(e){l.push(e)}};do{a.f&&u(a.f);const t=new Set,l=t.add.bind(t);r.forEach(e=>{var t;return null==(t=n.get(e))?void 0:t.l.forEach(l)}),r.clear(),i.forEach(l),i.clear(),o.forEach(l),o.clear(),t.forEach(u),r.size&&s(e)}while(r.size||i.size||o.size);if(l.length)throw new AggregateError(l)},qa=e=>{const t=is(e),n=t[1],r=t[2],o=t[3],i=t[11],a=t[14],s=t[17],l=[],u=new WeakSet,c=new WeakSet,d=Array.from(o);for(;d.length;){const t=d[d.length-1],o=i(e,t);if(c.has(t))d.pop();else if(u.has(t)){if(r.get(t)===o.n)l.push([t,o]);else if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&r.has(t))throw new Error("[Bug] invalidated atom exists");c.add(t),d.pop()}else{u.add(t);for(const e of Ua(t,o,n))u.has(e)||d.push(e)}}for(let t=l.length-1;t>=0;--t){const[n,i]=l[t];let u=!1;for(const e of i.d.keys())if(e!==n&&o.has(e)){u=!0;break}u&&(a(e,n),s(e,n)),r.delete(n)}},Ga=new WeakSet,Ka=(e,t)=>{var n,r;const o=is(e),i=o[1],a=o[2],s=o[3],l=o[6],u=o[7],c=o[11],d=o[12],p=o[13],f=o[14],h=o[16],g=o[17],m=o[20],v=c(e,t);if(Ia(v)){if(i.has(t)&&a.get(t)!==v.n)return v;let n=!1;for(const[t,r]of v.d)if(f(e,t).n!==r){n=!0;break}if(!n)return v}v.d.clear();let y,b,w=!0;function E(){i.has(t)&&(g(e,t),p(e),d(e))}const _={get signal(){return y||(y=new AbortController),y.signal},get setSelf(){return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),"production"===(import.meta.env?import.meta.env.MODE:void 0)||Pa(t)||console.warn("setSelf function cannot be used with read-only atom"),!b&&Pa(t)&&(b=(...n)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&w&&console.warn("setSelf function cannot be called in sync"),!w)try{return h(e,t,...n)}finally{p(e),d(e)}}),b}},x=v.n;try{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&Ga.delete(e);const r=u(e,t,function(n){var r;if(n===t){const t=c(e,n);if(!Ia(t)){if(!Oa(n))throw new Error("no atom init");m(e,n,n.init)}return Na(t)}const o=f(e,n);try{return Na(o)}finally{v.d.set(n,o.n),Ba(v.v)&&Ma(t,v.v,o),i.has(t)&&(null==(r=i.get(n))||r.t.add(t)),w||E()}},_);return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&Ga.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),m(e,t,r),La(r)&&(Fa(r,()=>null==y?void 0:y.abort()),r.then(E,E)),null==(n=l.r)||n.call(l,t),v}catch(e){return delete v.v,v.e=e,++v.n,v}finally{w=!1,x!==v.n&&a.get(t)===x&&(a.set(t,v.n),s.add(t),null==(r=l.c)||r.call(l,t))}},Ya=(e,t)=>{const n=is(e),r=n[1],o=n[2],i=n[11],a=[t];for(;a.length;){const t=a.pop(),n=i(e,t);for(const s of Ua(t,n,r)){const t=i(e,s);o.set(s,t.n),a.push(s)}}},Za=(e,t,...n)=>{const r=is(e),o=r[3],i=r[6],a=r[8],s=r[11],l=r[12],u=r[13],c=r[14],d=r[15],p=r[16],f=r[17],h=r[20];let g=!0;const m=t=>Na(c(e,t)),v=(n,...r)=>{var a;const c=s(e,n);try{if(n===t){if(!Oa(n))throw new Error("atom not writable");"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&Ga.add(e);const t=c.n,s=r[0];return h(e,n,s),f(e,n),void(t!==c.n&&(o.add(n),d(e,n),null==(a=i.c)||a.call(i,n)))}return p(e,n,...r)}finally{g||(u(e),l(e))}};try{return a(e,t,m,v,...n)}finally{g=!1}},Xa=(e,t)=>{var n;const r=is(e),o=r[1],i=r[3],a=r[6],s=r[11],l=r[15],u=r[18],c=r[19],d=s(e,t),p=o.get(t);if(p&&!Ba(d.v)){for(const[r,o]of d.d)if(!p.d.has(r)){const c=s(e,r);u(e,r).t.add(t),p.d.add(r),o!==c.n&&(i.add(r),l(e,r),null==(n=a.c)||n.call(a,r))}for(const n of p.d)if(!d.d.has(n)){p.d.delete(n);const r=c(e,n);null==r||r.t.delete(t)}}},Qa=(e,t)=>{var n;const r=is(e),o=r[1],i=r[4],a=r[6],s=r[10],l=r[11],u=r[12],c=r[13],d=r[14],p=r[16],f=r[18],h=l(e,t);let g=o.get(t);if(!g){d(e,t);for(const n of h.d.keys()){f(e,n).t.add(t)}if(g={l:new Set,d:new Set(h.d.keys()),t:new Set},o.set(t,g),Pa(t)){const n=()=>{let n=!0;const r=(...r)=>{try{return p(e,t,...r)}finally{n||(c(e),u(e))}};try{const o=s(e,t,r);o&&(g.u=()=>{n=!0;try{o()}finally{n=!1}})}finally{n=!1}};i.add(n)}null==(n=a.m)||n.call(a,t)}return g},Ja=(e,t)=>{var n,r;const o=is(e),i=o[1],a=o[5],s=o[6],l=o[11],u=o[19],c=l(e,t);let d=i.get(t);if(!d||d.l.size)return d;let p=!1;for(const e of d.t)if(null==(n=i.get(e))?void 0:n.d.has(t)){p=!0;break}if(p)return d;d.u&&a.add(d.u),d=void 0,i.delete(t);for(const n of c.d.keys()){const r=u(e,n);null==r||r.t.delete(t)}null==(r=s.u)||r.call(s,t)},es=(e,t,n)=>{const r=is(e)[11],o=r(e,t),i="v"in o,a=o.v;if(La(n))for(const i of o.d.keys())Ma(t,n,r(e,i));o.v=n,delete o.e,i&&Object.is(a,o.v)||(++o.n,La(a)&&function(e){const t=Ra.get(e);(null==t?void 0:t[0])&&(t[0]=!1,t[1].forEach(e=>e()))}(a))},ts=(e,t)=>Na((0,is(e)[14])(e,t)),ns=(e,t,...n)=>{const r=is(e),o=r[12],i=r[13],a=r[16];try{return a(e,t,...n)}finally{i(e),o(e)}},rs=(e,t,n)=>{const r=is(e),o=r[12],i=r[18],a=r[19],s=i(e,t).l;return s.add(n),o(e),()=>{s.delete(n),a(e,t),o(e)}},os=new WeakMap,is=e=>{const t=os.get(e);if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};let as,ss=0;function ls(e,t){const n="atom"+ ++ss,r={toString(){return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&this.debugLabel?n+":"+this.debugLabel:n}};return"function"==typeof e?r.read=e:(r.init=e,r.read=us,r.write=cs),t&&(r.write=t),r}function us(e){return e(this)}function cs(e,t,n){return t(this,"function"==typeof n?n(e(this)):n)}function ds(){return function(...e){const t={get:e=>(0,is(t)[21])(t,e),set:(e,...n)=>(0,is(t)[22])(t,e,...n),sub:(e,n)=>(0,is(t)[23])(t,e,n)},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},ja,$a,za,Ha,Va,Wa,qa,Ka,Ya,Za,Xa,Qa,Ja,es,ts,ns,rs,void 0].map((t,n)=>e[n]||t);return os.set(t,Object.freeze(n)),t}()}const ps=Ta.createContext(void 0);function fs(e){const t=Ta.useContext(ps);return(null==e?void 0:e.store)||t||(as||(as=ds(),"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=as),globalThis.__JOTAI_DEFAULT_STORE__!==as&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),as)}const hs=e=>"function"==typeof(null==e?void 0:e.then),gs=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},ms=Da.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(gs(e),e)}),vs=new WeakMap,ys=(e,t)=>{let n=vs.get(e);return n||(n=new Promise((r,o)=>{let i=e;const a=e=>t=>{i===e&&r(t)},s=e=>t=>{i===e&&o(t)},l=()=>{try{const e=t();hs(e)?(vs.set(e,n),i=e,e.then(a(e),s(e)),Fa(e,l)):r(e)}catch(e){o(e)}};e.then(a(e),s(e)),Fa(e,l)}),vs.set(e,n)),n};function bs(e,t){const{delay:n,unstable_promiseStatus:r=!Da.use}=t||{},o=fs(t),[[i,a,s],l]=Ta.useReducer(t=>{const n=o.get(e);return Object.is(t[0],n)&&t[1]===o&&t[2]===e?t:[n,o,e]},void 0,()=>[o.get(e),o,e]);let u=i;if(a===o&&s===e||(l(),u=o.get(e)),Ta.useEffect(()=>{const t=o.sub(e,()=>{if(r)try{const t=o.get(e);hs(t)&&gs(ys(t,()=>o.get(e)))}catch(e){}"number"!=typeof n?l():setTimeout(l,n)});return l(),t},[o,e,n,r]),Ta.useDebugValue(u),hs(u)){const t=ys(u,()=>o.get(e));return r&&gs(t),ms(t)}return u}function ws(e,t){const n=fs(t);return Ta.useCallback((...t)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("write"in e))throw new Error("not writable atom");return n.set(e,...t)},[n,e])}import.meta.env&&import.meta.env.MODE;!function(e=()=>{try{return window.localStorage}catch(e){return void("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&"undefined"!=typeof window&&console.warn(e))}},t){var n;let r,o;const i={getItem:(n,i)=>{var a,s;const l=e=>{if(r!==(e=e||"")){try{o=JSON.parse(e,null==t?void 0:t.reviver)}catch(e){return i}r=e}return o},u=null!=(s=null==(a=e())?void 0:a.getItem(n))?s:null;return"function"==typeof(null==(c=u)?void 0:c.then)?u.then(l):l(u);var c},setItem:(t,n)=>{var r;return null==(r=e())?void 0:r.setItem(t,JSON.stringify(n,void 0))},removeItem:t=>{var n;return null==(n=e())?void 0:n.removeItem(t)}};let a;try{a=null==(n=e())?void 0:n.subscribe}catch(e){}var s;!a&&"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(a=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};const r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener("storage",r),()=>{window.removeEventListener("storage",r)}}),a&&(i.subscribe=(s=a,(e,t,n)=>s(e,e=>{let r;try{r=JSON.parse(e||"")}catch(e){r=n}t(r)})))}();const Es=new WeakMap;const _s=e=>{let t=Es.get(e);return t||(t=new WeakSet,Es.set(e,t)),t};var xs,ks=Object.defineProperty,Cs=Object.defineProperties,Ss=Object.getOwnPropertyDescriptors,Ts=Object.getOwnPropertySymbols,Ds=Object.prototype.hasOwnProperty,As=Object.prototype.propertyIsEnumerable,Os=(e,t,n)=>t in e?ks(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ps=(e,t)=>{for(var n in t||(t={}))Ds.call(t,n)&&Os(e,n,t[n]);if(Ts)for(var n of Ts(t))As.call(t,n)&&Os(e,n,t[n]);return e},Is=(e,t)=>Cs(e,Ss(t)),Ns=(e,t)=>{var n={};for(var r in e)Ds.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ts)for(var r of Ts(e))t.indexOf(r)<0&&As.call(e,r)&&(n[r]=e[r]);return n},Rs=e=>"function"==typeof e?{__fn:e}:e,Bs=e=>{const t=ls(Rs(e));return ls(e=>{return(n=e(t))&&"object"==typeof n&&"__fn"in n?n.__fn:n;var n},(e,n,r)=>n(t,Rs(r)))},Fs=(e,t,n={})=>{const r=[];for(const n of Object.keys(e)){const o=t[n];void 0!==o&&r.push([e[n],o])}!function(e,t){const n=fs(t),r=_s(n);for(const[o,...i]of e)r.has(o)&&!(null==t?void 0:t.dangerouslyForceHydrate)||(r.add(o),n.set(o,...i))}(r,n)},Ls=(e,t)=>`${e}:${t}`,Ms="provider",Us=Da.createContext(new Map),js=e=>{var t=e,{initialValues:n,children:r,store:o,atoms:i}=t,a=Ns(t,["initialValues","children","store","atoms"]);return Fs(i,Ps(Ps({},n),a),{store:o}),((e,t,{store:n}={})=>{for(const r of Object.keys(e)){const o=t[r],i=ws(e[r],{store:n});Da.useEffect(()=>{null!=o&&i(o)},[i,o])}})(i,a,{store:o}),Da.createElement(Da.Fragment,null,r)},$s=(e="")=>e.length>0?e[0].toUpperCase()+e.slice(1):"",zs=e=>!!e&&"object"==typeof e&&"read"in e&&"function"==typeof e.read,Hs=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,(e={})=>n(Ps(Ps({},t),e))])),Vs=(e={})=>"string"==typeof e?{scope:e}:e,Ws=(e,{name:t,delay:n,effect:r,extend:o})=>{const i=((e="")=>`${$s(e)}Provider`)(t),a=((e="")=>`use${$s(e)}Store`)(t),s=((e="")=>e.length>0?`${e}Store`:"store")(t),l={},u={},c={};for(const[t,n]of Object.entries(e)){const e=zs(n)?n:Bs(n);l[t]=e;const r="write"in e;c[t]=r,r&&(u[t]=e)}const d=Ps({},l);if(o){const e=o(l);for(const[t,n]of Object.entries(e))d[t]=n,c[t]="write"in n}const p={},f={},h={},g=(e={})=>{const{scope:n,store:r,warnIfNoStore:o=!0}=Vs(e),i=((e,t=Ms,n=!0)=>{var r;const o=Da.useContext(Us),i=null!=(r=o.get(Ls(e,t)))?r:o.get(Ls(e,Ms));return!i&&n&&console.warn(`Tried to access jotai store '${e}' outside of a matching provider.`),i})(t,n,!r&&o);return null!=r?r:i},m=(e,t)=>{var r;const o=Vs(t);return bs(e,{store:g(Ps({warnIfNoStore:!1},o)),delay:null!=(r=o.delay)?r:n})},v=(e,t)=>ws(e,{store:g(t)}),y=(e,t)=>{const r=g(t),{delay:o=n}=Vs(t);return function(e,t){return[bs(e,t),ws(e,t)]}(e,{store:r,delay:o})};for(const e of Object.keys(d)){const t=d[e],n=c[e];p[e]=(e={})=>m(t,e),n&&(f[e]=(e={})=>v(t,e),h[e]=(e={})=>y(t,e))}const b=((e,t,n={})=>{const r=n.effect;return n=>{var o=n,{store:i,scope:a,children:s,resetKey:l}=o,u=Ns(o,["store","scope","children","resetKey"]);const[c,d]=Da.useState(ds());Da.useEffect(()=>{l&&d(ds())},[l]);const p=Da.useContext(Us),f=Da.useMemo(()=>{const t=new Map(p);return a&&t.set(Ls(e,a),c),t.set(Ls(e,Ms),c),t},[p,a,c]);return Da.createElement(Us.Provider,{value:f},Da.createElement(js,Ps({store:c,atoms:t},u),!!r&&Da.createElement(r,null),s))}})(t,u,{effect:r}),w={atom:d,name:t};return{[i]:b,[a]:(e={})=>({get:Is(Ps({},Hs(p,Vs(e))),{atom:(t,n)=>m(t,Ps(Ps({},Vs(e)),Vs(n)))}),set:Is(Ps({},Hs(f,Vs(e))),{atom:(t,n)=>v(t,Ps(Ps({},Vs(e)),Vs(n)))}),use:Is(Ps({},Hs(h,Vs(e))),{atom:(t,n)=>y(t,Ps(Ps({},Vs(e)),Vs(n)))}),store:t=>g(Ps(Ps({},Vs(e)),Vs(t)))}),[s]:w,name:t}},qs={exports:{}},Gs={};qs.exports=function(){if(xs)return Gs;xs=1;var e=Ta,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},u=null,c=null;for(s in void 0!==a&&(u=""+a),void 0!==n.key&&(u=""+n.key),void 0!==n.ref&&(c=n.ref),n)r.call(n,s)&&!i.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:u,ref:c,props:l,_owner:o.current}}return Gs.Fragment=n,Gs.jsx=a,Gs.jsxs=a,Gs}();var Ks=qs.exports;function Ys(){return Ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ys.apply(null,arguments)}var Zs=["shift","alt","meta","mod","ctrl"],Xs={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Qs(e){return(e&&Xs[e]||e||"").trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function Js(e,t){return void 0===t&&(t=","),e.split(t)}function el(e,t,n){void 0===t&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(e){return Qs(e)});return Ys({},{alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},{keys:r.filter(function(e){return!Zs.includes(e)}),description:n,hotkey:e})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&rl([Qs(e.key),Qs(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&ol([Qs(e.key),Qs(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){tl.clear()});var tl=new Set;function nl(e){return Array.isArray(e)}function rl(e){var t=Array.isArray(e)?e:[e];tl.has("meta")&&tl.forEach(function(e){return!function(e){return Zs.includes(e)}(e)&&tl.delete(e.toLowerCase())}),t.forEach(function(e){return tl.add(e.toLowerCase())})}function ol(e){var t=Array.isArray(e)?e:[e];"meta"===e?tl.clear():t.forEach(function(e){return tl.delete(e.toLowerCase())})}function il(e,t){void 0===t&&(t=!1);var n=e.target,r=e.composed,o=null;return o=function(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}(n)&&r?e.composedPath()[0]&&e.composedPath()[0].tagName:n&&n.tagName,nl(t)?Boolean(o&&t&&t.some(function(e){var t;return e.toLowerCase()===(null==(t=o)?void 0:t.toLowerCase())})):Boolean(o&&t&&t)}var al=function(e,t,n){void 0===n&&(n=!1);var r,o,i=t.alt,a=t.meta,s=t.mod,l=t.shift,u=t.ctrl,c=t.keys,d=e.key,p=e.code,f=e.ctrlKey,h=e.metaKey,g=e.shiftKey,m=e.altKey,v=Qs(p),y=d.toLowerCase();if(!(null!=c&&c.includes(v)||null!=c&&c.includes(y)||["ctrl","control","unknown","meta","alt","shift","os"].includes(v)))return!1;if(!n){if(i===!m&&"alt"!==y)return!1;if(l===!g&&"shift"!==y)return!1;if(s){if(!h&&!f)return!1}else{if(a===!h&&"meta"!==y&&"os"!==y)return!1;if(u===!f&&"ctrl"!==y&&"control"!==y)return!1}}return!(!c||1!==c.length||!c.includes(y)&&!c.includes(v))||(c?(void 0===o&&(o=","),(nl(r=c)?r:r.split(o)).every(function(e){return tl.has(e.trim().toLowerCase())})):!c)},sl=Ta.createContext(void 0);function ll(e,t){return e&&t&&"object"==typeof e&&"object"==typeof t?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&ll(e[r],t[r])},!0):e===t}var ul=Ta.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}});function cl(e){var t=Ta.useRef(void 0);return ll(t.current,e)||(t.current=e),t.current}var dl=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},pl="undefined"!=typeof window?Ta.useLayoutEffect:Ta.useEffect;function fl(e,t,n,r){var o=Ta.useState(null),i=o[0],a=o[1],s=Ta.useRef(!1),l=n instanceof Array?r instanceof Array?void 0:r:n,u=nl(e)?e.join(null==l?void 0:l.splitKey):e,c=n instanceof Array?n:r instanceof Array?r:void 0,d=Ta.useCallback(t,null!=c?c:[]),p=Ta.useRef(d);p.current=c?d:t;var f=cl(l),h=Ta.useContext(ul).enabledScopes,g=Ta.useContext(sl);return pl(function(){if(!1!==(null==f?void 0:f.enabled)&&(e=h,t=null==f?void 0:f.scopes,0===e.length&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),1):!t||e.some(function(e){return t.includes(e)})||e.includes("*"))){var e,t,n=function(e,t){var n;if(void 0===t&&(t=!1),!il(e,["input","textarea","select"])||il(e,null==f?void 0:f.enableOnFormTags)){if(null!==i){var r=i.getRootNode();if((r instanceof Document||r instanceof ShadowRoot)&&r.activeElement!==i&&!i.contains(r.activeElement))return void dl(e)}(null==(n=e.target)||!n.isContentEditable||null!=f&&f.enableOnContentEditable)&&Js(u,null==f?void 0:f.splitKey).forEach(function(n){var r,o=el(n,null==f?void 0:f.combinationKey);if(al(e,o,null==f?void 0:f.ignoreModifiers)||null!=(r=o.keys)&&r.includes("*")){if(null!=f&&null!=f.ignoreEventWhen&&f.ignoreEventWhen(e))return;if(t&&s.current)return;if(function(e,t,n){("function"==typeof n&&n(e,t)||!0===n)&&e.preventDefault()}(e,o,null==f?void 0:f.preventDefault),!function(e,t,n){return"function"==typeof n?n(e,t):!0===n||void 0===n}(e,o,null==f?void 0:f.enabled))return void dl(e);p.current(e,o),t||(s.current=!0)}})}},r=function(e){void 0!==e.key&&(rl(Qs(e.code)),(void 0===(null==f?void 0:f.keydown)&&!0!==(null==f?void 0:f.keyup)||null!=f&&f.keydown)&&n(e))},o=function(e){void 0!==e.key&&(ol(Qs(e.code)),s.current=!1,null!=f&&f.keyup&&n(e,!0))},a=i||(null==l?void 0:l.document)||document;return a.addEventListener("keyup",o,null==l?void 0:l.eventListenerOptions),a.addEventListener("keydown",r,null==l?void 0:l.eventListenerOptions),g&&Js(u,null==f?void 0:f.splitKey).forEach(function(e){return g.addHotkey(el(e,null==f?void 0:f.combinationKey,null==f?void 0:f.description))}),function(){a.removeEventListener("keyup",o,null==l?void 0:l.eventListenerOptions),a.removeEventListener("keydown",r,null==l?void 0:l.eventListenerOptions),g&&Js(u,null==f?void 0:f.splitKey).forEach(function(e){return g.removeHotkey(el(e,null==f?void 0:f.combinationKey,null==f?void 0:f.description))})}}},[i,u,f,h]),a}var hl=Symbol.for("immer-nothing"),gl=Symbol.for("immer-draftable"),ml=Symbol.for("immer-state");function vl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var yl=Object.getPrototypeOf;function bl(e){return!!e&&!!e[ml]}function wl(e){return!!e&&(xl(e)||Array.isArray(e)||!!e[gl]||!!e.constructor?.[gl]||Dl(e)||Al(e))}var El=Object.prototype.constructor.toString(),_l=new WeakMap;function xl(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);if(null===t||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if("function"!=typeof n)return!1;let r=_l.get(n);return void 0===r&&(r=Function.toString.call(n),_l.set(n,r)),r===El}function kl(e,t,n=!0){if(0===Cl(e)){(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)})}else e.forEach((n,r)=>t(r,n,e))}function Cl(e){const t=e[ml];return t?t.type_:Array.isArray(e)?1:Dl(e)?2:Al(e)?3:0}function Sl(e,t){return 2===Cl(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Tl(e,t,n){const r=Cl(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Dl(e){return e instanceof Map}function Al(e){return e instanceof Set}function Ol(e){return e.copy_||e.base_}function Pl(e,t){if(Dl(e))return new Map(e);if(Al(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=xl(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[ml];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(yl(e),t)}{const t=yl(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Il(e,t=!1){return Rl(e)||bl(e)||!wl(e)||(Cl(e)>1&&Object.defineProperties(e,{set:Nl,add:Nl,clear:Nl,delete:Nl}),Object.freeze(e),t&&Object.values(e).forEach(e=>Il(e,!0))),e}var Nl={value:function(){vl(2)}};function Rl(e){return null===e||"object"!=typeof e||Object.isFrozen(e)}var Bl,Fl={};function Ll(e){const t=Fl[e];return t||vl(0),t}function Ml(){return Bl}function Ul(e,t){t&&(Ll("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function jl(e){$l(e),e.drafts_.forEach(Hl),e.drafts_=null}function $l(e){e===Bl&&(Bl=e.parent_)}function zl(e){return Bl={drafts_:[],parent_:Bl,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Hl(e){const t=e[ml];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Vl(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[ml].modified_&&(jl(t),vl(4)),wl(e)&&(e=Wl(t,e),t.parent_||Gl(t,e)),t.patches_&&Ll("Patches").generateReplacementPatches_(n[ml].base_,e,t.patches_,t.inversePatches_)):e=Wl(t,n,[]),jl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==hl?e:void 0}function Wl(e,t,n){if(Rl(t))return t;const r=e.immer_.shouldUseStrictIteration(),o=t[ml];if(!o)return kl(t,(r,i)=>ql(e,o,t,r,i,n),r),t;if(o.scope_!==e)return t;if(!o.modified_)return Gl(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let i=t,a=!1;3===o.type_&&(i=new Set(t),t.clear(),a=!0),kl(i,(r,i)=>ql(e,o,t,r,i,n,a),r),Gl(e,t,!1),n&&e.patches_&&Ll("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function ql(e,t,n,r,o,i,a){if(null==o)return;if("object"!=typeof o&&!a)return;const s=Rl(o);if(!s||a){if(bl(o)){const a=Wl(e,o,i&&t&&3!==t.type_&&!Sl(t.assigned_,r)?i.concat(r):void 0);if(Tl(n,r,a),!bl(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(wl(o)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;if(t&&t.base_&&t.base_[r]===o&&s)return;Wl(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!(Dl(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))||Gl(e,o)}}}function Gl(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Il(t,n)}var Kl={get(e,t){if(t===ml)return e;const n=Ol(e);if(!Sl(n,t))return function(e,t,n){const r=Xl(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!wl(r)?r:r===Zl(e.base_,t)?(Jl(e),e.copy_[t]=eu(r,e)):r},has:(e,t)=>t in Ol(e),ownKeys:e=>Reflect.ownKeys(Ol(e)),set(e,t,n){const r=Xl(Ol(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Zl(Ol(e),t),a=r?.[ml];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||Sl(e.base_,t)))return!0;Jl(e),Ql(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Zl(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Jl(e),Ql(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Ol(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){vl(11)},getPrototypeOf:e=>yl(e.base_),setPrototypeOf(){vl(12)}},Yl={};function Zl(e,t){const n=e[ml];return(n?Ol(n):e)[t]}function Xl(e,t){if(!(t in e))return;let n=yl(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=yl(n)}}function Ql(e){e.modified_||(e.modified_=!0,e.parent_&&Ql(e.parent_))}function Jl(e){e.copy_||(e.copy_=Pl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}kl(Kl,(e,t)=>{Yl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Yl.deleteProperty=function(e,t){return Yl.set.call(this,e,t,void 0)},Yl.set=function(e,t,n){return Kl.set.call(this,e[0],t,n,e[0])};function eu(e,t){const n=Dl(e)?Ll("MapSet").proxyMap_(e,t):Al(e)?Ll("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Ml(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Kl;n&&(o=[r],i=Yl);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=a,s}(e,t);return(t?t.scope_:Ml()).drafts_.push(n),n}function tu(e){if(!wl(e)||Rl(e))return e;const t=e[ml];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Pl(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Pl(e,!0);return kl(n,(e,t)=>{Tl(n,e,tu(t))},r),t&&(t.finalized_=!1),n}function nu(){class e extends Map{constructor(e,t){super(),this[ml]={type_:2,parent_:t,scope_:t?t.scope_:Ml(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:e,draft_:this,isManual_:!1,revoked_:!1}}get size(){return Ol(this[ml]).size}has(e){return Ol(this[ml]).has(e)}set(e,n){const r=this[ml];return o(r),Ol(r).has(e)&&Ol(r).get(e)===n||(t(r),Ql(r),r.assigned_.set(e,!0),r.copy_.set(e,n),r.assigned_.set(e,!0)),this}delete(e){if(!this.has(e))return!1;const n=this[ml];return o(n),t(n),Ql(n),n.base_.has(e)?n.assigned_.set(e,!1):n.assigned_.delete(e),n.copy_.delete(e),!0}clear(){const e=this[ml];o(e),Ol(e).size&&(t(e),Ql(e),e.assigned_=new Map,kl(e.base_,t=>{e.assigned_.set(t,!1)}),e.copy_.clear())}forEach(e,t){Ol(this[ml]).forEach((n,r,o)=>{e.call(t,this.get(r),r,this)})}get(e){const n=this[ml];o(n);const r=Ol(n).get(e);if(n.finalized_||!wl(r))return r;if(r!==n.base_.get(e))return r;const i=eu(r,n);return t(n),n.copy_.set(e,i),i}keys(){return Ol(this[ml]).keys()}values(){const e=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const t=e.next();if(t.done)return t;return{done:!1,value:this.get(t.value)}}}}entries(){const e=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const t=e.next();if(t.done)return t;const n=this.get(t.value);return{done:!1,value:[t.value,n]}}}}[Symbol.iterator](){return this.entries()}}function t(e){e.copy_||(e.assigned_=new Map,e.copy_=new Map(e.base_))}class n extends Set{constructor(e,t){super(),this[ml]={type_:3,parent_:t,scope_:t?t.scope_:Ml(),modified_:!1,finalized_:!1,copy_:void 0,base_:e,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return Ol(this[ml]).size}has(e){const t=this[ml];return o(t),t.copy_?!!t.copy_.has(e)||!(!t.drafts_.has(e)||!t.copy_.has(t.drafts_.get(e))):t.base_.has(e)}add(e){const t=this[ml];return o(t),this.has(e)||(r(t),Ql(t),t.copy_.add(e)),this}delete(e){if(!this.has(e))return!1;const t=this[ml];return o(t),r(t),Ql(t),t.copy_.delete(e)||!!t.drafts_.has(e)&&t.copy_.delete(t.drafts_.get(e))}clear(){const e=this[ml];o(e),Ol(e).size&&(r(e),Ql(e),e.copy_.clear())}values(){const e=this[ml];return o(e),r(e),e.copy_.values()}entries(){const e=this[ml];return o(e),r(e),e.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(e,t){const n=this.values();let r=n.next();for(;!r.done;)e.call(t,r.value,r.value,this),r=n.next()}}function r(e){e.copy_||(e.copy_=new Set,e.base_.forEach(t=>{if(wl(t)){const n=eu(t,e);e.drafts_.set(t,n),e.copy_.add(n)}else e.copy_.add(t)}))}function o(e){e.revoked_&&vl(3,JSON.stringify(Ol(e)))}var i,a;a={proxyMap_:function(t,n){return new e(t,n)},proxySet_:function(e,t){return new n(e,t)}},Fl[i="MapSet"]||(Fl[i]=a)}var ru,ou,iu=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,e=>t.call(this,e,...o))}}let r;if("function"!=typeof t&&vl(6),void 0!==n&&"function"!=typeof n&&vl(7),wl(e)){const o=zl(this),i=eu(e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?jl(o):$l(o)}return Ul(o,n),Vl(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===hl&&(r=void 0),this.autoFreeze_&&Il(r,!0),n){const t=[],o=[];Ll("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}vl(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){wl(e)||vl(8),bl(e)&&(e=function(e){bl(e)||vl(10);return tu(e)}(e));const t=zl(this),n=eu(e,void 0);return n[ml].isManual_=!0,$l(t),n}finishDraft(e,t){const n=e&&e[ml];n&&n.isManual_||vl(9);const{scope_:r}=n;return Ul(r,t),Vl(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Ll("Patches").applyPatches_;return bl(e)?r(e,t):this.produce(e,e=>r(e,t))}},au=iu.produce,su=iu.setAutoFreeze.bind(iu),lu={exports:{}},uu={};function cu(){return ou||(ou=1,lu.exports=(ru||(ru=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,a=i>>>1;r<a;){var s=2*(r+1)-1,l=e[s],u=s+1,c=e[u];if(0>o(l,n))u<i&&0>o(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(u<i&&0>o(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,p=3,f=!1,h=!1,g=!1,m="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var o=n(u);null!==o;){if(null===o.callback)r(u);else{if(!(o.startTime<=e))break;r(u),o.sortIndex=o.expirationTime,t(l,o)}o=n(u)}}function w(e){if(g=!1,b(e),!h)if(null!==n(l))h=!0,I(E);else{var t=n(u);null!==t&&N(w,t.startTime-e)}}function E(t,o){h=!1,g&&(g=!1,v(C),C=-1),f=!0;var i=p;try{for(b(o),d=n(l);null!==d&&(!(d.expirationTime>o)||t&&!D());){var a=d.callback;if("function"==typeof a){d.callback=null,p=d.priorityLevel;var s=a(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),b(o)}else r(l);d=n(l)}if(null!==d)var c=!0;else{var m=n(u);null!==m&&N(w,m.startTime-o),c=!1}return c}finally{d=null,p=i,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var _,x=!1,k=null,C=-1,S=5,T=-1;function D(){return!(e.unstable_now()-T<S)}function A(){if(null!==k){var t=e.unstable_now();T=t;var n=!0;try{n=k(!0,t)}finally{n?_():(x=!1,k=null)}}else x=!1}if("function"==typeof y)_=function(){y(A)};else if("undefined"!=typeof MessageChannel){var O=new MessageChannel,P=O.port2;O.port1.onmessage=A,_=function(){P.postMessage(null)}}else _=function(){m(A,0)};function I(e){k=e,x||(x=!0,_())}function N(t,n){C=m(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){h||f||(h=!0,I(E))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):S=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},e.unstable_scheduleCallback=function(r,o,i){var a=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:c++,callback:o,priorityLevel:r,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>a?(r.sortIndex=i,t(u,r),null===n(l)&&r===n(u)&&(g?(v(C),C=-1):g=!0,N(w,i-a))):(r.sortIndex=s,t(l,r),h||f||(h=!0,I(E))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}}(uu)),uu)),lu.exports}var du,pu={exports:{}},fu={};!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),pu.exports=function(){if(du)return fu;du=1;var e=Ta,t=cu();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function i(e,t){a(e,t),a(e+"Capture",t)}function a(e,t){for(o[e]=t,e=0;e<t.length;e++)r.add(t[e])}var s=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,c={},d={};function p(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var f={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){f[e]=new p(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];f[t]=new p(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){f[e]=new p(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){f[e]=new p(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){f[e]=new p(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){f[e]=new p(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){f[e]=new p(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){f[e]=new p(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){f[e]=new p(e,5,!1,e.toLowerCase(),null,!1,!1)});var h=/[\-:]([a-z])/g;function g(e){return e[1].toUpperCase()}function m(e,t,n,r){var o=f.hasOwnProperty(t)?f[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!l.call(d,e)||!l.call(c,e)&&(u.test(e)?d[e]=!0:(c[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(h,g);f[t]=new p(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(h,g);f[t]=new p(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(h,g);f[t]=new p(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){f[e]=new p(e,1,!1,e.toLowerCase(),null,!1,!1)}),f.xlinkHref=new p("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){f[e]=new p(e,1,!1,e.toLowerCase(),null,!0,!0)});var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,y=Symbol.for("react.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),k=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),P=Symbol.iterator;function I(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=P&&e[P]||e["@@iterator"])?e:null}var N,R=Object.assign;function B(e){if(void 0===N)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);N=t&&t[1]||""}return"\n"+N+e}var F=!1;function L(e,t){if(!e||F)return"";F=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var o=t.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,s=i.length-1;1<=a&&0<=s&&o[a]!==i[s];)s--;for(;1<=a&&0<=s;a--,s--)if(o[a]!==i[s]){if(1!==a||1!==s)do{if(a--,0>--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{F=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?B(e):""}function M(e){switch(e.tag){case 5:return B(e.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return L(e.type,!1);case 11:return L(e.type.render,!1);case 1:return L(e.type,!0);default:return""}}function U(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case w:return"Fragment";case b:return"Portal";case _:return"Profiler";case E:return"StrictMode";case S:return"Suspense";case T:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case k:return(e.displayName||"Context")+".Consumer";case x:return(e._context.displayName||"Context")+".Provider";case C:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case D:return null!==(t=e.displayName||null)?t:U(e.type)||"Memo";case A:t=e._payload,e=e._init;try{return U(e(t))}catch(e){}}return null}function j(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U(t);case 8:return t===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function $(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function z(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function H(e){e._valueTracker||(e._valueTracker=function(e){var t=z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function V(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=z(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function W(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function q(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function G(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=$(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function K(e,t){null!=(t=t.checked)&&m(e,"checked",t,!1)}function Y(e,t){K(e,t);var n=$(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?X(e,t.type,n):t.hasOwnProperty("defaultValue")&&X(e,t.type,$(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Z(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function X(e,t,n){"number"===t&&W(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Q=Array.isArray;function J(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function ee(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(n(91));return R({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function te(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(n(92));if(Q(r)){if(1<r.length)throw Error(n(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:$(r)}}function ne(e,t){var n=$(t.value),r=$(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function re(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function oe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ie(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?oe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ae,se,le=(se=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ae=ae||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ae.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return se(e,t)})}:se);function ue(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ce={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},de=["Webkit","ms","Moz","O"];function pe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ce.hasOwnProperty(e)&&ce[e]?(""+t).trim():t+"px"}function fe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=pe(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(ce).forEach(function(e){de.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ce[t]=ce[e]})});var he=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ge(e,t){if(t){if(he[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(n(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(n(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(n(62))}}function me(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ve=null;function ye(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var be=null,we=null,Ee=null;function _e(e){if(e=ho(e)){if("function"!=typeof be)throw Error(n(280));var t=e.stateNode;t&&(t=mo(t),be(e.stateNode,e.type,t))}}function xe(e){we?Ee?Ee.push(e):Ee=[e]:we=e}function ke(){if(we){var e=we,t=Ee;if(Ee=we=null,_e(e),t)for(e=0;e<t.length;e++)_e(t[e])}}function Ce(e,t){return e(t)}function Se(){}var Te=!1;function De(e,t,n){if(Te)return e(t,n);Te=!0;try{return Ce(e,t,n)}finally{Te=!1,(null!==we||null!==Ee)&&(Se(),ke())}}function Ae(e,t){var r=e.stateNode;if(null===r)return null;var o=mo(r);if(null===o)return null;r=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(o=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(n(231,t,typeof r));return r}var Oe=!1;if(s)try{var Pe={};Object.defineProperty(Pe,"passive",{get:function(){Oe=!0}}),window.addEventListener("test",Pe,Pe),window.removeEventListener("test",Pe,Pe)}catch(se){Oe=!1}function Ie(e,t,n,r,o,i,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var Ne=!1,Re=null,Be=!1,Fe=null,Le={onError:function(e){Ne=!0,Re=e}};function Me(e,t,n,r,o,i,a,s,l){Ne=!1,Re=null,Ie.apply(Le,arguments)}function Ue(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function je(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function $e(e){if(Ue(e)!==e)throw Error(n(188))}function ze(e){return e=function(e){var t=e.alternate;if(!t){if(null===(t=Ue(e)))throw Error(n(188));return t!==e?null:e}for(var r=e,o=t;;){var i=r.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(o=i.return)){r=o;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return $e(i),e;if(a===o)return $e(i),t;a=a.sibling}throw Error(n(188))}if(r.return!==o.return)r=i,o=a;else{for(var s=!1,l=i.child;l;){if(l===r){s=!0,r=i,o=a;break}if(l===o){s=!0,o=i,r=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===r){s=!0,r=a,o=i;break}if(l===o){s=!0,o=a,r=i;break}l=l.sibling}if(!s)throw Error(n(189))}}if(r.alternate!==o)throw Error(n(190))}if(3!==r.tag)throw Error(n(188));return r.stateNode.current===r?e:t}(e),null!==e?He(e):null}function He(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=He(e);if(null!==t)return t;e=e.sibling}return null}var Ve=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,qe=t.unstable_shouldYield,Ge=t.unstable_requestPaint,Ke=t.unstable_now,Ye=t.unstable_getCurrentPriorityLevel,Ze=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Qe=t.unstable_NormalPriority,Je=t.unstable_LowPriority,et=t.unstable_IdlePriority,tt=null,nt=null,rt=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(ot(e)/it|0)|0},ot=Math.log,it=Math.LN2,at=64,st=4194304;function lt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ut(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=lt(s):0!==(i&=a)&&(r=lt(i))}else 0!==(a=n&~o)?r=lt(a):0!==i&&(r=lt(i));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&4194240&i))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-rt(t)),r|=e[n],t&=~o;return r}function ct(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function dt(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function pt(){var e=at;return!(4194240&(at<<=1))&&(at=64),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-rt(t)]=n}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-rt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var mt=0;function vt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var yt,bt,wt,Et,_t,xt=!1,kt=[],Ct=null,St=null,Tt=null,Dt=new Map,At=new Map,Ot=[],Pt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function It(e,t){switch(e){case"focusin":case"focusout":Ct=null;break;case"dragenter":case"dragleave":St=null;break;case"mouseover":case"mouseout":Tt=null;break;case"pointerover":case"pointerout":Dt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":At.delete(t.pointerId)}}function Nt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&null!==(t=ho(t))&&bt(t),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Rt(e){var t=fo(e.target);if(null!==t){var n=Ue(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=je(n)))return e.blockedOn=t,void _t(e.priority,function(){wt(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Bt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=qt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ho(n))&&bt(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);ve=r,n.target.dispatchEvent(r),ve=null,t.shift()}return!0}function Ft(e,t,n){Bt(e)&&n.delete(t)}function Lt(){xt=!1,null!==Ct&&Bt(Ct)&&(Ct=null),null!==St&&Bt(St)&&(St=null),null!==Tt&&Bt(Tt)&&(Tt=null),Dt.forEach(Ft),At.forEach(Ft)}function Mt(e,n){e.blockedOn===n&&(e.blockedOn=null,xt||(xt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lt)))}function Ut(e){function t(t){return Mt(t,e)}if(0<kt.length){Mt(kt[0],e);for(var n=1;n<kt.length;n++){var r=kt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Ct&&Mt(Ct,e),null!==St&&Mt(St,e),null!==Tt&&Mt(Tt,e),Dt.forEach(t),At.forEach(t),n=0;n<Ot.length;n++)(r=Ot[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Ot.length&&null===(n=Ot[0]).blockedOn;)Rt(n),null===n.blockedOn&&Ot.shift()}var jt=v.ReactCurrentBatchConfig,$t=!0;function zt(e,t,n,r){var o=mt,i=jt.transition;jt.transition=null;try{mt=1,Vt(e,t,n,r)}finally{mt=o,jt.transition=i}}function Ht(e,t,n,r){var o=mt,i=jt.transition;jt.transition=null;try{mt=4,Vt(e,t,n,r)}finally{mt=o,jt.transition=i}}function Vt(e,t,n,r){if($t){var o=qt(e,t,n,r);if(null===o)Mr(e,t,r,Wt,n),It(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Ct=Nt(Ct,e,t,n,r,o),!0;case"dragenter":return St=Nt(St,e,t,n,r,o),!0;case"mouseover":return Tt=Nt(Tt,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Dt.set(i,Nt(Dt.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,At.set(i,Nt(At.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(It(e,r),4&t&&-1<Pt.indexOf(e)){for(;null!==o;){var i=ho(o);if(null!==i&&yt(i),null===(i=qt(e,t,n,r))&&Mr(e,t,r,Wt,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else Mr(e,t,r,null,n)}}var Wt=null;function qt(e,t,n,r){if(Wt=null,null!==(e=fo(e=ye(r))))if(null===(t=Ue(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=je(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Wt=e,null}function Gt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ye()){case Ze:return 1;case Xe:return 4;case Qe:case Je:return 16;case et:return 536870912;default:return 16}default:return 16}}var Kt=null,Yt=null,Zt=null;function Xt(){if(Zt)return Zt;var e,t,n=Yt,r=n.length,o="value"in Kt?Kt.value:Kt.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return Zt=o.slice(e,1<t?1-t:void 0)}function Qt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Jt(){return!0}function en(){return!1}function tn(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?Jt:en,this.isPropagationStopped=en,this}return R(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Jt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Jt)},persist:function(){},isPersistent:Jt}),t}var nn,rn,on,an={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sn=tn(an),ln=R({},an,{view:0,detail:0}),un=tn(ln),cn=R({},ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:En,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==on&&(on&&"mousemove"===e.type?(nn=e.screenX-on.screenX,rn=e.screenY-on.screenY):rn=nn=0,on=e),nn)},movementY:function(e){return"movementY"in e?e.movementY:rn}}),dn=tn(cn),pn=tn(R({},cn,{dataTransfer:0})),fn=tn(R({},ln,{relatedTarget:0})),hn=tn(R({},an,{animationName:0,elapsedTime:0,pseudoElement:0})),gn=tn(R({},an,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),mn=tn(R({},an,{data:0})),vn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},bn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=bn[e])&&!!t[e]}function En(){return wn}var _n=tn(R({},ln,{key:function(e){if(e.key){var t=vn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Qt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?yn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:En,charCode:function(e){return"keypress"===e.type?Qt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Qt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),xn=tn(R({},cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),kn=tn(R({},ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:En})),Cn=tn(R({},an,{propertyName:0,elapsedTime:0,pseudoElement:0})),Sn=tn(R({},cn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Tn=[9,13,27,32],Dn=s&&"CompositionEvent"in window,An=null;s&&"documentMode"in document&&(An=document.documentMode);var On=s&&"TextEvent"in window&&!An,Pn=s&&(!Dn||An&&8<An&&11>=An),In=String.fromCharCode(32),Nn=!1;function Rn(e,t){switch(e){case"keyup":return-1!==Tn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Fn=!1,Ln={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Mn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Ln[e.type]:"textarea"===t}function Un(e,t,n,r){xe(r),0<(t=jr(t,"onChange")).length&&(n=new sn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var jn=null,$n=null;function zn(e){Ir(e,0)}function Hn(e){if(V(go(e)))return e}function Vn(e,t){if("change"===e)return t}var Wn=!1;if(s){var qn;if(s){var Gn="oninput"in document;if(!Gn){var Kn=document.createElement("div");Kn.setAttribute("oninput","return;"),Gn="function"==typeof Kn.oninput}qn=Gn}else qn=!1;Wn=qn&&(!document.documentMode||9<document.documentMode)}function Yn(){jn&&(jn.detachEvent("onpropertychange",Zn),$n=jn=null)}function Zn(e){if("value"===e.propertyName&&Hn($n)){var t=[];Un(t,$n,e,ye(e)),De(zn,t)}}function Xn(e,t,n){"focusin"===e?(Yn(),$n=n,(jn=t).attachEvent("onpropertychange",Zn)):"focusout"===e&&Yn()}function Qn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Hn($n)}function Jn(e,t){if("click"===e)return Hn(t)}function er(e,t){if("input"===e||"change"===e)return Hn(t)}var tr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function nr(e,t){if(tr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!l.call(t,o)||!tr(e[o],t[o]))return!1}return!0}function rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function or(e,t){var n,r=rr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=rr(r)}}function ir(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ir(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function ar(){for(var e=window,t=W();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=W((e=t.contentWindow).document)}return t}function sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function lr(e){var t=ar(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ir(n.ownerDocument.documentElement,n)){if(null!==r&&sr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=or(n,i);var a=or(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ur=s&&"documentMode"in document&&11>=document.documentMode,cr=null,dr=null,pr=null,fr=!1;function hr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;fr||null==cr||cr!==W(r)||(r="selectionStart"in(r=cr)&&sr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},pr&&nr(pr,r)||(pr=r,0<(r=jr(dr,"onSelect")).length&&(t=new sn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=cr)))}function gr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var mr={animationend:gr("Animation","AnimationEnd"),animationiteration:gr("Animation","AnimationIteration"),animationstart:gr("Animation","AnimationStart"),transitionend:gr("Transition","TransitionEnd")},vr={},yr={};function br(e){if(vr[e])return vr[e];if(!mr[e])return e;var t,n=mr[e];for(t in n)if(n.hasOwnProperty(t)&&t in yr)return vr[e]=n[t];return e}s&&(yr=document.createElement("div").style,"AnimationEvent"in window||(delete mr.animationend.animation,delete mr.animationiteration.animation,delete mr.animationstart.animation),"TransitionEvent"in window||delete mr.transitionend.transition);var wr=br("animationend"),Er=br("animationiteration"),_r=br("animationstart"),xr=br("transitionend"),kr=new Map,Cr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Sr(e,t){kr.set(e,t),i(t,[e])}for(var Tr=0;Tr<Cr.length;Tr++){var Dr=Cr[Tr];Sr(Dr.toLowerCase(),"on"+(Dr[0].toUpperCase()+Dr.slice(1)))}Sr(wr,"onAnimationEnd"),Sr(Er,"onAnimationIteration"),Sr(_r,"onAnimationStart"),Sr("dblclick","onDoubleClick"),Sr("focusin","onFocus"),Sr("focusout","onBlur"),Sr(xr,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ar="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Or=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ar));function Pr(e,t,r){var o=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,o,i,a,s,l,u){if(Me.apply(this,arguments),Ne){if(!Ne)throw Error(n(198));var c=Re;Ne=!1,Re=null,Be||(Be=!0,Fe=c)}}(o,t,void 0,e),e.currentTarget=null}function Ir(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==i&&o.isPropagationStopped())break e;Pr(o,s,u),i=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,u=s.currentTarget,s=s.listener,l!==i&&o.isPropagationStopped())break e;Pr(o,s,u),i=l}}}if(Be)throw e=Fe,Be=!1,Fe=null,e}function Nr(e,t){var n=t[uo];void 0===n&&(n=t[uo]=new Set);var r=e+"__bubble";n.has(r)||(Lr(t,e,2,!1),n.add(r))}function Rr(e,t,n){var r=0;t&&(r|=4),Lr(n,e,r,t)}var Br="_reactListening"+Math.random().toString(36).slice(2);function Fr(e){if(!e[Br]){e[Br]=!0,r.forEach(function(t){"selectionchange"!==t&&(Or.has(t)||Rr(t,!1,e),Rr(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Br]||(t[Br]=!0,Rr("selectionchange",!1,t))}}function Lr(e,t,n,r){switch(Gt(t)){case 1:var o=zt;break;case 4:o=Ht;break;default:o=Vt}n=o.bind(null,t,n,e),o=void 0,!Oe||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Mr(e,t,n,r,o){var i=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===o||8===l.nodeType&&l.parentNode===o))return;a=a.return}for(;null!==s;){if(null===(a=fo(s)))return;if(5===(l=a.tag)||6===l){r=i=a;continue e}s=s.parentNode}}r=r.return}De(function(){var r=i,o=ye(n),a=[];e:{var s=kr.get(e);if(void 0!==s){var l=sn,u=e;switch(e){case"keypress":if(0===Qt(n))break e;case"keydown":case"keyup":l=_n;break;case"focusin":u="focus",l=fn;break;case"focusout":u="blur",l=fn;break;case"beforeblur":case"afterblur":l=fn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=dn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=pn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=kn;break;case wr:case Er:case _r:l=hn;break;case xr:l=Cn;break;case"scroll":l=un;break;case"wheel":l=Sn;break;case"copy":case"cut":case"paste":l=gn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=xn}var c=!!(4&t),d=!c&&"scroll"===e,p=c?null!==s?s+"Capture":null:s;c=[];for(var f,h=r;null!==h;){var g=(f=h).stateNode;if(5===f.tag&&null!==g&&(f=g,null!==p&&null!=(g=Ae(h,p))&&c.push(Ur(h,g,f))),d)break;h=h.return}0<c.length&&(s=new l(s,u,null,n,o),a.push({event:s,listeners:c}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===ve||!(u=n.relatedTarget||n.fromElement)||!fo(u)&&!u[lo])&&(l||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(u=(u=n.relatedTarget||n.toElement)?fo(u):null)&&(u!==(d=Ue(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=dn,g="onMouseLeave",p="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=xn,g="onPointerLeave",p="onPointerEnter",h="pointer"),d=null==l?s:go(l),f=null==u?s:go(u),(s=new c(g,h+"leave",l,n,o)).target=d,s.relatedTarget=f,g=null,fo(o)===r&&((c=new c(p,h+"enter",u,n,o)).target=f,c.relatedTarget=d,g=c),d=g,l&&u)e:{for(p=u,h=0,f=c=l;f;f=$r(f))h++;for(f=0,g=p;g;g=$r(g))f++;for(;0<h-f;)c=$r(c),h--;for(;0<f-h;)p=$r(p),f--;for(;h--;){if(c===p||null!==p&&c===p.alternate)break e;c=$r(c),p=$r(p)}c=null}else c=null;null!==l&&zr(a,s,l,c,!1),null!==u&&null!==d&&zr(a,d,u,c,!0)}if("select"===(l=(s=r?go(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var m=Vn;else if(Mn(s))if(Wn)m=er;else{m=Qn;var v=Xn}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(m=Jn);switch(m&&(m=m(e,r))?Un(a,m,n,o):(v&&v(e,s,r),"focusout"===e&&(v=s._wrapperState)&&v.controlled&&"number"===s.type&&X(s,"number",s.value)),v=r?go(r):window,e){case"focusin":(Mn(v)||"true"===v.contentEditable)&&(cr=v,dr=r,pr=null);break;case"focusout":pr=dr=cr=null;break;case"mousedown":fr=!0;break;case"contextmenu":case"mouseup":case"dragend":fr=!1,hr(a,n,o);break;case"selectionchange":if(ur)break;case"keydown":case"keyup":hr(a,n,o)}var y;if(Dn)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Fn?Rn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Pn&&"ko"!==n.locale&&(Fn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Fn&&(y=Xt()):(Yt="value"in(Kt=o)?Kt.value:Kt.textContent,Fn=!0)),0<(v=jr(r,b)).length&&(b=new mn(b,e,null,n,o),a.push({event:b,listeners:v}),(y||null!==(y=Bn(n)))&&(b.data=y))),(y=On?function(e,t){switch(e){case"compositionend":return Bn(t);case"keypress":return 32!==t.which?null:(Nn=!0,In);case"textInput":return(e=t.data)===In&&Nn?null:e;default:return null}}(e,n):function(e,t){if(Fn)return"compositionend"===e||!Dn&&Rn(e,t)?(e=Xt(),Zt=Yt=Kt=null,Fn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Pn&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(r=jr(r,"onBeforeInput")).length&&(o=new mn("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=y)}Ir(a,t)})}function Ur(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jr(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=Ae(e,n))&&r.unshift(Ur(e,i,o)),null!=(i=Ae(e,t))&&r.push(Ur(e,i,o))),e=e.return}return r}function $r(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function zr(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==u&&(s=u,o?null!=(l=Ae(n,i))&&a.unshift(Ur(n,l,s)):o||null!=(l=Ae(n,i))&&a.push(Ur(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Hr=/\r\n?/g,Vr=/\u0000|\uFFFD/g;function Wr(e){return("string"==typeof e?e:""+e).replace(Hr,"\n").replace(Vr,"")}function qr(e,t,r){if(t=Wr(t),Wr(e)!==t&&r)throw Error(n(425))}function Gr(){}var Kr=null,Yr=null;function Zr(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Xr="function"==typeof setTimeout?setTimeout:void 0,Qr="function"==typeof clearTimeout?clearTimeout:void 0,Jr="function"==typeof Promise?Promise:void 0,eo="function"==typeof queueMicrotask?queueMicrotask:void 0!==Jr?function(e){return Jr.resolve(null).then(e).catch(to)}:Xr;function to(e){setTimeout(function(){throw e})}function no(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void Ut(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);Ut(t)}function ro(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function oo(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var io=Math.random().toString(36).slice(2),ao="__reactFiber$"+io,so="__reactProps$"+io,lo="__reactContainer$"+io,uo="__reactEvents$"+io,co="__reactListeners$"+io,po="__reactHandles$"+io;function fo(e){var t=e[ao];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lo]||n[ao]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=oo(e);null!==e;){if(n=e[ao])return n;e=oo(e)}return t}n=(e=n).parentNode}return null}function ho(e){return!(e=e[ao]||e[lo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function go(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(n(33))}function mo(e){return e[so]||null}var vo=[],yo=-1;function bo(e){return{current:e}}function wo(e){0>yo||(e.current=vo[yo],vo[yo]=null,yo--)}function Eo(e,t){yo++,vo[yo]=e.current,e.current=t}var _o={},xo=bo(_o),ko=bo(!1),Co=_o;function So(e,t){var n=e.type.contextTypes;if(!n)return _o;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function To(e){return null!=e.childContextTypes}function Do(){wo(ko),wo(xo)}function Ao(e,t,r){if(xo.current!==_o)throw Error(n(168));Eo(xo,t),Eo(ko,r)}function Oo(e,t,r){var o=e.stateNode;if(t=t.childContextTypes,"function"!=typeof o.getChildContext)return r;for(var i in o=o.getChildContext())if(!(i in t))throw Error(n(108,j(e)||"Unknown",i));return R({},r,o)}function Po(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_o,Co=xo.current,Eo(xo,e),Eo(ko,ko.current),!0}function Io(e,t,r){var o=e.stateNode;if(!o)throw Error(n(169));r?(e=Oo(e,t,Co),o.__reactInternalMemoizedMergedChildContext=e,wo(ko),wo(xo),Eo(xo,e)):wo(ko),Eo(ko,r)}var No=null,Ro=!1,Bo=!1;function Fo(e){null===No?No=[e]:No.push(e)}function Lo(){if(!Bo&&null!==No){Bo=!0;var e=0,t=mt;try{var n=No;for(mt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}No=null,Ro=!1}catch(t){throw null!==No&&(No=No.slice(e+1)),Ve(Ze,Lo),t}finally{mt=t,Bo=!1}}return null}var Mo=[],Uo=0,jo=null,$o=0,zo=[],Ho=0,Vo=null,Wo=1,qo="";function Go(e,t){Mo[Uo++]=$o,Mo[Uo++]=jo,jo=e,$o=t}function Ko(e,t,n){zo[Ho++]=Wo,zo[Ho++]=qo,zo[Ho++]=Vo,Vo=e;var r=Wo;e=qo;var o=32-rt(r)-1;r&=~(1<<o),n+=1;var i=32-rt(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Wo=1<<32-rt(t)+o|n<<o|r,qo=i+e}else Wo=1<<i|n<<o|r,qo=e}function Yo(e){null!==e.return&&(Go(e,1),Ko(e,1,0))}function Zo(e){for(;e===jo;)jo=Mo[--Uo],Mo[Uo]=null,$o=Mo[--Uo],Mo[Uo]=null;for(;e===Vo;)Vo=zo[--Ho],zo[Ho]=null,qo=zo[--Ho],zo[Ho]=null,Wo=zo[--Ho],zo[Ho]=null}var Xo=null,Qo=null,Jo=!1,ei=null;function ti(e,t){var n=Ou(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function ni(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,Xo=e,Qo=ro(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,Xo=e,Qo=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Vo?{id:Wo,overflow:qo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Ou(18,null,null,0)).stateNode=t,n.return=e,e.child=n,Xo=e,Qo=null,!0);default:return!1}}function ri(e){return!(!(1&e.mode)||128&e.flags)}function oi(e){if(Jo){var t=Qo;if(t){var r=t;if(!ni(e,t)){if(ri(e))throw Error(n(418));t=ro(r.nextSibling);var o=Xo;t&&ni(e,t)?ti(o,r):(e.flags=-4097&e.flags|2,Jo=!1,Xo=e)}}else{if(ri(e))throw Error(n(418));e.flags=-4097&e.flags|2,Jo=!1,Xo=e}}}function ii(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Xo=e}function ai(e){if(e!==Xo)return!1;if(!Jo)return ii(e),Jo=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!Zr(e.type,e.memoizedProps)),t&&(t=Qo)){if(ri(e))throw si(),Error(n(418));for(;t;)ti(e,t),t=ro(t.nextSibling)}if(ii(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(n(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){Qo=ro(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}Qo=null}}else Qo=Xo?ro(e.stateNode.nextSibling):null;return!0}function si(){for(var e=Qo;e;)e=ro(e.nextSibling)}function li(){Qo=Xo=null,Jo=!1}function ui(e){null===ei?ei=[e]:ei.push(e)}var ci=v.ReactCurrentBatchConfig;function di(e,t){if(e&&e.defaultProps){for(var n in t=R({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var pi=bo(null),fi=null,hi=null,gi=null;function mi(){gi=hi=fi=null}function vi(e){var t=pi.current;wo(pi),e._currentValue=t}function yi(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function bi(e,t){fi=e,gi=hi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(gs=!0),e.firstContext=null)}function wi(e){var t=e._currentValue;if(gi!==e)if(e={context:e,memoizedValue:t,next:null},null===hi){if(null===fi)throw Error(n(308));hi=e,fi.dependencies={lanes:0,firstContext:e}}else hi=hi.next=e;return t}var Ei=null;function _i(e){null===Ei?Ei=[e]:Ei.push(e)}function xi(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,_i(t)):(n.next=o.next,o.next=n),t.interleaved=n,ki(e,r)}function ki(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ci=!1;function Si(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ti(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Di(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ai(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&kl){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ki(e,n)}return null===(o=r.interleaved)?(t.next=t,_i(r)):(t.next=o.next,o.next=t),r.interleaved=t,ki(e,n)}function Oi(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,gt(e,n)}}function Pi(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ii(e,t,n,r){var o=e.updateQueue;Ci=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,u=l.next;l.next=null,null===a?i=u:a.next=u,a=l;var c=e.alternate;null!==c&&(s=(c=c.updateQueue).lastBaseUpdate)!==a&&(null===s?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l)}if(null!==i){var d=o.baseState;for(a=0,c=u=l=null,s=i;;){var p=s.lane,f=s.eventTime;if((r&p)===p){null!==c&&(c=c.next={eventTime:f,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var h=e,g=s;switch(p=t,f=n,g.tag){case 1:if("function"==typeof(h=g.payload)){d=h.call(f,d,p);break e}d=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(p="function"==typeof(h=g.payload)?h.call(f,d,p):h))break e;d=R({},d,p);break e;case 2:Ci=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(p=o.effects)?o.effects=[s]:p.push(s))}else f={eventTime:f,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===c?(u=c=f,l=d):c=c.next=f,a|=p;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(p=s).next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}if(null===c&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,null!==(t=o.shared.interleaved)){o=t;do{a|=o.lane,o=o.next}while(o!==t)}else null===i&&(o.shared.lanes=0);Il|=a,e.lanes=a,e.memoizedState=d}}function Ni(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var o=e[t],i=o.callback;if(null!==i){if(o.callback=null,o=r,"function"!=typeof i)throw Error(n(191,i));i.call(o)}}}var Ri=(new e.Component).refs;function Bi(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:R({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Fi={isMounted:function(e){return!!(e=e._reactInternals)&&Ue(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Zl(),o=Xl(e),i=Di(r,o);i.payload=t,null!=n&&(i.callback=n),null!==(t=Ai(e,i,o))&&(Ql(t,e,o,r),Oi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Zl(),o=Xl(e),i=Di(r,o);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=Ai(e,i,o))&&(Ql(t,e,o,r),Oi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Zl(),r=Xl(e),o=Di(n,r);o.tag=2,null!=t&&(o.callback=t),null!==(t=Ai(e,o,r))&&(Ql(t,e,r,n),Oi(t,e,r))}};function Li(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!(t.prototype&&t.prototype.isPureReactComponent&&nr(n,r)&&nr(o,i))}function Mi(e,t,n){var r=!1,o=_o,i=t.contextType;return"object"==typeof i&&null!==i?i=wi(i):(o=To(t)?Co:xo.current,i=(r=null!=(r=t.contextTypes))?So(e,o):_o),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Fi,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Ui(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Fi.enqueueReplaceState(t,t.state,null)}function ji(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=Ri,Si(e);var i=t.contextType;"object"==typeof i&&null!==i?o.context=wi(i):(i=To(t)?Co:xo.current,o.context=So(e,i)),o.state=e.memoizedState,"function"==typeof(i=t.getDerivedStateFromProps)&&(Bi(e,t,i,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&Fi.enqueueReplaceState(o,o.state,null),Ii(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function $i(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(n(309));var o=r.stateNode}if(!o)throw Error(n(147,e));var i=o,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=i.refs;t===Ri&&(t=i.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(n(284));if(!r._owner)throw Error(n(290,e))}return e}function zi(e,t){throw e=Object.prototype.toString.call(t),Error(n(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Hi(e){return(0,e._init)(e._payload)}function Vi(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function r(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function o(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Iu(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Fu(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){var o=n.type;return o===w?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===A&&Hi(o)===t.type)?((r=i(t,n.props)).ref=$i(e,t,n),r.return=e,r):((r=Nu(n.type,n.key,n.props,null,e.mode,r)).ref=$i(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Lu(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Ru(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function p(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Fu(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case y:return(n=Nu(t.type,t.key,t.props,null,e.mode,n)).ref=$i(e,null,t),n.return=e,n;case b:return(t=Lu(t,e.mode,n)).return=e,t;case A:return p(e,(0,t._init)(t._payload),n)}if(Q(t)||I(t))return(t=Ru(t,e.mode,n,null)).return=e,t;zi(e,t)}return null}function f(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case y:return n.key===o?u(e,t,n,r):null;case b:return n.key===o?c(e,t,n,r):null;case A:return f(e,t,(o=n._init)(n._payload),r)}if(Q(n)||I(n))return null!==o?null:d(e,t,n,r,null);zi(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case y:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case b:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case A:return h(e,t,n,(0,r._init)(r._payload),o)}if(Q(r)||I(r))return d(t,e=e.get(n)||null,r,o,null);zi(t,r)}return null}function g(n,i,s,l){for(var u=null,c=null,d=i,g=i=0,m=null;null!==d&&g<s.length;g++){d.index>g?(m=d,d=null):m=d.sibling;var v=f(n,d,s[g],l);if(null===v){null===d&&(d=m);break}e&&d&&null===v.alternate&&t(n,d),i=a(v,i,g),null===c?u=v:c.sibling=v,c=v,d=m}if(g===s.length)return r(n,d),Jo&&Go(n,g),u;if(null===d){for(;g<s.length;g++)null!==(d=p(n,s[g],l))&&(i=a(d,i,g),null===c?u=d:c.sibling=d,c=d);return Jo&&Go(n,g),u}for(d=o(n,d);g<s.length;g++)null!==(m=h(d,n,g,s[g],l))&&(e&&null!==m.alternate&&d.delete(null===m.key?g:m.key),i=a(m,i,g),null===c?u=m:c.sibling=m,c=m);return e&&d.forEach(function(e){return t(n,e)}),Jo&&Go(n,g),u}function m(i,s,l,u){var c=I(l);if("function"!=typeof c)throw Error(n(150));if(null==(l=c.call(l)))throw Error(n(151));for(var d=c=null,g=s,m=s=0,v=null,y=l.next();null!==g&&!y.done;m++,y=l.next()){g.index>m?(v=g,g=null):v=g.sibling;var b=f(i,g,y.value,u);if(null===b){null===g&&(g=v);break}e&&g&&null===b.alternate&&t(i,g),s=a(b,s,m),null===d?c=b:d.sibling=b,d=b,g=v}if(y.done)return r(i,g),Jo&&Go(i,m),c;if(null===g){for(;!y.done;m++,y=l.next())null!==(y=p(i,y.value,u))&&(s=a(y,s,m),null===d?c=y:d.sibling=y,d=y);return Jo&&Go(i,m),c}for(g=o(i,g);!y.done;m++,y=l.next())null!==(y=h(g,i,m,y.value,u))&&(e&&null!==y.alternate&&g.delete(null===y.key?m:y.key),s=a(y,s,m),null===d?c=y:d.sibling=y,d=y);return e&&g.forEach(function(e){return t(i,e)}),Jo&&Go(i,m),c}return function e(n,o,a,l){if("object"==typeof a&&null!==a&&a.type===w&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case y:e:{for(var u=a.key,c=o;null!==c;){if(c.key===u){if((u=a.type)===w){if(7===c.tag){r(n,c.sibling),(o=i(c,a.props.children)).return=n,n=o;break e}}else if(c.elementType===u||"object"==typeof u&&null!==u&&u.$$typeof===A&&Hi(u)===c.type){r(n,c.sibling),(o=i(c,a.props)).ref=$i(n,c,a),o.return=n,n=o;break e}r(n,c);break}t(n,c),c=c.sibling}a.type===w?((o=Ru(a.props.children,n.mode,l,a.key)).return=n,n=o):((l=Nu(a.type,a.key,a.props,null,n.mode,l)).ref=$i(n,o,a),l.return=n,n=l)}return s(n);case b:e:{for(c=a.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===a.containerInfo&&o.stateNode.implementation===a.implementation){r(n,o.sibling),(o=i(o,a.children||[])).return=n,n=o;break e}r(n,o);break}t(n,o),o=o.sibling}(o=Lu(a,n.mode,l)).return=n,n=o}return s(n);case A:return e(n,o,(c=a._init)(a._payload),l)}if(Q(a))return g(n,o,a,l);if(I(a))return m(n,o,a,l);zi(n,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==o&&6===o.tag?(r(n,o.sibling),(o=i(o,a)).return=n,n=o):(r(n,o),(o=Fu(a,n.mode,l)).return=n,n=o),s(n)):r(n,o)}}var Wi=Vi(!0),qi=Vi(!1),Gi={},Ki=bo(Gi),Yi=bo(Gi),Zi=bo(Gi);function Xi(e){if(e===Gi)throw Error(n(174));return e}function Qi(e,t){switch(Eo(Zi,t),Eo(Yi,e),Eo(Ki,Gi),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ie(null,"");break;default:t=ie(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}wo(Ki),Eo(Ki,t)}function Ji(){wo(Ki),wo(Yi),wo(Zi)}function ea(e){Xi(Zi.current);var t=Xi(Ki.current),n=ie(t,e.type);t!==n&&(Eo(Yi,e),Eo(Ki,n))}function ta(e){Yi.current===e&&(wo(Ki),wo(Yi))}var na=bo(0);function ra(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oa=[];function ia(){for(var e=0;e<oa.length;e++)oa[e]._workInProgressVersionPrimary=null;oa.length=0}var aa=v.ReactCurrentDispatcher,sa=v.ReactCurrentBatchConfig,la=0,ua=null,ca=null,da=null,pa=!1,fa=!1,ha=0,ga=0;function ma(){throw Error(n(321))}function va(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!tr(e[n],t[n]))return!1;return!0}function ya(e,t,r,o,i,a){if(la=a,ua=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,aa.current=null===e||null===e.memoizedState?ns:rs,e=r(o,i),fa){a=0;do{if(fa=!1,ha=0,25<=a)throw Error(n(301));a+=1,da=ca=null,t.updateQueue=null,aa.current=os,e=r(o,i)}while(fa)}if(aa.current=ts,t=null!==ca&&null!==ca.next,la=0,da=ca=ua=null,pa=!1,t)throw Error(n(300));return e}function ba(){var e=0!==ha;return ha=0,e}function wa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===da?ua.memoizedState=da=e:da=da.next=e,da}function Ea(){if(null===ca){var e=ua.alternate;e=null!==e?e.memoizedState:null}else e=ca.next;var t=null===da?ua.memoizedState:da.next;if(null!==t)da=t,ca=e;else{if(null===e)throw Error(n(310));e={memoizedState:(ca=e).memoizedState,baseState:ca.baseState,baseQueue:ca.baseQueue,queue:ca.queue,next:null},null===da?ua.memoizedState=da=e:da=da.next=e}return da}function _a(e,t){return"function"==typeof t?t(e):t}function xa(e){var t=Ea(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var o=ca,i=o.baseQueue,a=r.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}o.baseQueue=i=a,r.pending=null}if(null!==i){a=i.next,o=o.baseState;var l=s=null,u=null,c=a;do{var d=c.lane;if((la&d)===d)null!==u&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),o=c.hasEagerState?c.eagerState:e(o,c.action);else{var p={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===u?(l=u=p,s=o):u=u.next=p,ua.lanes|=d,Il|=d}c=c.next}while(null!==c&&c!==a);null===u?s=o:u.next=l,tr(o,t.memoizedState)||(gs=!0),t.memoizedState=o,t.baseState=s,t.baseQueue=u,r.lastRenderedState=o}if(null!==(e=r.interleaved)){i=e;do{a=i.lane,ua.lanes|=a,Il|=a,i=i.next}while(i!==e)}else null===i&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function ka(e){var t=Ea(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var o=r.dispatch,i=r.pending,a=t.memoizedState;if(null!==i){r.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);tr(a,t.memoizedState)||(gs=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,o]}function Ca(){}function Sa(e,t){var r=ua,o=Ea(),i=t(),a=!tr(o.memoizedState,i);if(a&&(o.memoizedState=i,gs=!0),o=o.queue,Ua(Oa.bind(null,r,o,e),[e]),o.getSnapshot!==t||a||null!==da&&1&da.memoizedState.tag){if(r.flags|=2048,Ra(9,Aa.bind(null,r,o,i,t),void 0,null),null===Cl)throw Error(n(349));30&la||Da(r,t,i)}return i}function Da(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ua.updateQueue)?(t={lastEffect:null,stores:null},ua.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Aa(e,t,n,r){t.value=n,t.getSnapshot=r,Pa(t)&&Ia(e)}function Oa(e,t,n){return n(function(){Pa(t)&&Ia(e)})}function Pa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!tr(e,n)}catch(e){return!0}}function Ia(e){var t=ki(e,1);null!==t&&Ql(t,e,1,-1)}function Na(e){var t=wa();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:e},t.queue=e,e=e.dispatch=Xa.bind(null,ua,e),[t.memoizedState,e]}function Ra(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ua.updateQueue)?(t={lastEffect:null,stores:null},ua.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ba(){return Ea().memoizedState}function Fa(e,t,n,r){var o=wa();ua.flags|=e,o.memoizedState=Ra(1|t,n,void 0,void 0===r?null:r)}function La(e,t,n,r){var o=Ea();r=void 0===r?null:r;var i=void 0;if(null!==ca){var a=ca.memoizedState;if(i=a.destroy,null!==r&&va(r,a.deps))return void(o.memoizedState=Ra(t,n,i,r))}ua.flags|=e,o.memoizedState=Ra(1|t,n,i,r)}function Ma(e,t){return Fa(8390656,8,e,t)}function Ua(e,t){return La(2048,8,e,t)}function ja(e,t){return La(4,2,e,t)}function $a(e,t){return La(4,4,e,t)}function za(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ha(e,t,n){return n=null!=n?n.concat([e]):null,La(4,4,za.bind(null,t,e),n)}function Va(){}function Wa(e,t){var n=Ea();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&va(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qa(e,t){var n=Ea();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&va(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ga(e,t,n){return 21&la?(tr(n,t)||(n=pt(),ua.lanes|=n,Il|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,gs=!0),e.memoizedState=n)}function Ka(e,t){var n=mt;mt=0!==n&&4>n?n:4,e(!0);var r=sa.transition;sa.transition={};try{e(!1),t()}finally{mt=n,sa.transition=r}}function Ya(){return Ea().memoizedState}function Za(e,t,n){var r=Xl(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qa(e)?Ja(t,n):null!==(n=xi(e,t,n,r))&&(Ql(n,e,r,Zl()),es(n,t,r))}function Xa(e,t,n){var r=Xl(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qa(e))Ja(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,tr(s,a)){var l=t.interleaved;return null===l?(o.next=o,_i(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(e){}null!==(n=xi(e,t,o,r))&&(Ql(n,e,r,o=Zl()),es(n,t,r))}}function Qa(e){var t=e.alternate;return e===ua||null!==t&&t===ua}function Ja(e,t){fa=pa=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function es(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,gt(e,n)}}var ts={readContext:wi,useCallback:ma,useContext:ma,useEffect:ma,useImperativeHandle:ma,useInsertionEffect:ma,useLayoutEffect:ma,useMemo:ma,useReducer:ma,useRef:ma,useState:ma,useDebugValue:ma,useDeferredValue:ma,useTransition:ma,useMutableSource:ma,useSyncExternalStore:ma,useId:ma,unstable_isNewReconciler:!1},ns={readContext:wi,useCallback:function(e,t){return wa().memoizedState=[e,void 0===t?null:t],e},useContext:wi,useEffect:Ma,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Fa(4194308,4,za.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fa(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fa(4,2,e,t)},useMemo:function(e,t){var n=wa();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=wa();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Za.bind(null,ua,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},wa().memoizedState=e},useState:Na,useDebugValue:Va,useDeferredValue:function(e){return wa().memoizedState=e},useTransition:function(){var e=Na(!1),t=e[0];return e=Ka.bind(null,e[1]),wa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var o=ua,i=wa();if(Jo){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===Cl)throw Error(n(349));30&la||Da(o,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,Ma(Oa.bind(null,o,a,e),[e]),o.flags|=2048,Ra(9,Aa.bind(null,o,a,r,t),void 0,null),r},useId:function(){var e=wa(),t=Cl.identifierPrefix;if(Jo){var n=qo;t=":"+t+"R"+(n=(Wo&~(1<<32-rt(Wo)-1)).toString(32)+n),0<(n=ha++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ga++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rs={readContext:wi,useCallback:Wa,useContext:wi,useEffect:Ua,useImperativeHandle:Ha,useInsertionEffect:ja,useLayoutEffect:$a,useMemo:qa,useReducer:xa,useRef:Ba,useState:function(){return xa(_a)},useDebugValue:Va,useDeferredValue:function(e){return Ga(Ea(),ca.memoizedState,e)},useTransition:function(){return[xa(_a)[0],Ea().memoizedState]},useMutableSource:Ca,useSyncExternalStore:Sa,useId:Ya,unstable_isNewReconciler:!1},os={readContext:wi,useCallback:Wa,useContext:wi,useEffect:Ua,useImperativeHandle:Ha,useInsertionEffect:ja,useLayoutEffect:$a,useMemo:qa,useReducer:ka,useRef:Ba,useState:function(){return ka(_a)},useDebugValue:Va,useDeferredValue:function(e){var t=Ea();return null===ca?t.memoizedState=e:Ga(t,ca.memoizedState,e)},useTransition:function(){return[ka(_a)[0],Ea().memoizedState]},useMutableSource:Ca,useSyncExternalStore:Sa,useId:Ya,unstable_isNewReconciler:!1};function is(e,t){try{var n="",r=t;do{n+=M(r),r=r.return}while(r);var o=n}catch(e){o="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:o,digest:null}}function as(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ss(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var ls="function"==typeof WeakMap?WeakMap:Map;function us(e,t,n){(n=Di(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){jl||(jl=!0,$l=r),ss(0,t)},n}function cs(e,t,n){(n=Di(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){ss(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){ss(0,t),"function"!=typeof r&&(null===zl?zl=new Set([this]):zl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ds(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ls;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=ku.bind(null,e,t,n),t.then(e,e))}function ps(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function fs(e,t,n,r,o){return 1&e.mode?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Di(-1,1)).tag=2,Ai(n,t,1))),n.lanes|=1),e)}var hs=v.ReactCurrentOwner,gs=!1;function ms(e,t,n,r){t.child=null===e?qi(t,null,n,r):Wi(t,e.child,n,r)}function vs(e,t,n,r,o){n=n.render;var i=t.ref;return bi(t,o),r=ya(e,t,n,r,i,o),n=ba(),null===e||gs?(Jo&&n&&Yo(t),t.flags|=1,ms(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,js(e,t,o))}function ys(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||Pu(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Nu(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,bs(e,t,i,r,o))}if(i=e.child,0===(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:nr)(a,r)&&e.ref===t.ref)return js(e,t,o)}return t.flags|=1,(e=Iu(i,r)).ref=t.ref,e.return=t,t.child=e}function bs(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(nr(i,r)&&e.ref===t.ref){if(gs=!1,t.pendingProps=r=i,0===(e.lanes&o))return t.lanes=e.lanes,js(e,t,o);131072&e.flags&&(gs=!0)}}return _s(e,t,n,r,o)}function ws(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Eo(Al,Dl),Dl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,Eo(Al,Dl),Dl|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Eo(Al,Dl),Dl|=n;else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,Eo(Al,Dl),Dl|=r;return ms(e,t,o,n),t.child}function Es(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function _s(e,t,n,r,o){var i=To(n)?Co:xo.current;return i=So(t,i),bi(t,o),n=ya(e,t,n,r,i,o),r=ba(),null===e||gs?(Jo&&r&&Yo(t),t.flags|=1,ms(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,js(e,t,o))}function xs(e,t,n,r,o){if(To(n)){var i=!0;Po(t)}else i=!1;if(bi(t,o),null===t.stateNode)Us(e,t),Mi(t,n,r),ji(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;u="object"==typeof u&&null!==u?wi(u):So(t,u=To(n)?Co:xo.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==u)&&Ui(t,a,r,u),Ci=!1;var p=t.memoizedState;a.state=p,Ii(t,r,a,o),l=t.memoizedState,s!==r||p!==l||ko.current||Ci?("function"==typeof c&&(Bi(t,n,c,r),l=t.memoizedState),(s=Ci||Li(t,n,s,r,p,l,u))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ti(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:di(t.type,s),a.props=u,d=t.pendingProps,p=a.context,l="object"==typeof(l=n.contextType)&&null!==l?wi(l):So(t,l=To(n)?Co:xo.current);var f=n.getDerivedStateFromProps;(c="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||p!==l)&&Ui(t,a,r,l),Ci=!1,p=t.memoizedState,a.state=p,Ii(t,r,a,o);var h=t.memoizedState;s!==d||p!==h||ko.current||Ci?("function"==typeof f&&(Bi(t,n,f,r),h=t.memoizedState),(u=Ci||Li(t,n,u,r,p,h,l)||!1)?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return ks(e,t,n,r,i,o)}function ks(e,t,n,r,o,i){Es(e,t);var a=!!(128&t.flags);if(!r&&!a)return o&&Io(t,n,!1),js(e,t,i);r=t.stateNode,hs.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Wi(t,e.child,null,i),t.child=Wi(t,null,s,i)):ms(e,t,s,i),t.memoizedState=r.state,o&&Io(t,n,!0),t.child}function Cs(e){var t=e.stateNode;t.pendingContext?Ao(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ao(0,t.context,!1),Qi(e,t.containerInfo)}function Ss(e,t,n,r,o){return li(),ui(o),t.flags|=256,ms(e,t,n,r),t.child}var Ts,Ds,As,Os,Ps={dehydrated:null,treeContext:null,retryLane:0};function Is(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ns(e,t,r){var o,i=t.pendingProps,a=na.current,s=!1,l=!!(128&t.flags);if((o=l)||(o=(null===e||null!==e.memoizedState)&&!!(2&a)),o?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Eo(na,1&a),null===e)return oi(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=i.children,e=i.fallback,s?(i=t.mode,s=t.child,l={mode:"hidden",children:l},1&i||null===s?s=Bu(l,i,0,null):(s.childLanes=0,s.pendingProps=l),e=Ru(e,i,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Is(r),t.memoizedState=Ps,e):Rs(t,l));if(null!==(a=e.memoizedState)&&null!==(o=a.dehydrated))return function(e,t,r,o,i,a,s){if(r)return 256&t.flags?(t.flags&=-257,Bs(e,t,s,o=as(Error(n(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=o.fallback,i=t.mode,o=Bu({mode:"visible",children:o.children},i,0,null),(a=Ru(a,i,s,null)).flags|=2,o.return=t,a.return=t,o.sibling=a,t.child=o,1&t.mode&&Wi(t,e.child,null,s),t.child.memoizedState=Is(s),t.memoizedState=Ps,a);if(!(1&t.mode))return Bs(e,t,s,null);if("$!"===i.data){if(o=i.nextSibling&&i.nextSibling.dataset)var l=o.dgst;return o=l,Bs(e,t,s,o=as(a=Error(n(419)),o,void 0))}if(l=0!==(s&e.childLanes),gs||l){if(null!==(o=Cl)){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(o.suspendedLanes|s))?0:i)&&i!==a.retryLane&&(a.retryLane=i,ki(e,i),Ql(o,e,i,-1))}return hu(),Bs(e,t,s,o=as(Error(n(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Su.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Qo=ro(i.nextSibling),Xo=t,Jo=!0,ei=null,null!==e&&(zo[Ho++]=Wo,zo[Ho++]=qo,zo[Ho++]=Vo,Wo=e.id,qo=e.overflow,Vo=t),(t=Rs(t,o.children)).flags|=4096,t)}(e,t,l,i,o,a,r);if(s){s=i.fallback,l=t.mode,o=(a=e.child).sibling;var u={mode:"hidden",children:i.children};return 1&l||t.child===a?(i=Iu(a,u)).subtreeFlags=14680064&a.subtreeFlags:((i=t.child).childLanes=0,i.pendingProps=u,t.deletions=null),null!==o?s=Iu(o,s):(s=Ru(s,l,r,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,l=null===(l=e.child.memoizedState)?Is(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~r,t.memoizedState=Ps,i}return e=(s=e.child).sibling,i=Iu(s,{mode:"visible",children:i.children}),!(1&t.mode)&&(i.lanes=r),i.return=t,i.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Rs(e,t){return(t=Bu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Bs(e,t,n,r){return null!==r&&ui(r),Wi(t,e.child,null,n),(e=Rs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Fs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),yi(e.return,t,n)}function Ls(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Ms(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(ms(e,t,r.children,n),2&(r=na.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Fs(e,n,t);else if(19===e.tag)Fs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Eo(na,r),1&t.mode)switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===ra(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ls(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ra(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ls(t,!0,n,null,i);break;case"together":Ls(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Us(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function js(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Il|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=Iu(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Iu(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function $s(e,t){if(!Jo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Hs(e,t,r){var i=t.pendingProps;switch(Zo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zs(t),null;case 1:case 17:return To(t.type)&&Do(),zs(t),null;case 3:return i=t.stateNode,Ji(),wo(ko),wo(xo),ia(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),null!==e&&null!==e.child||(ai(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==ei&&(nu(ei),ei=null))),Ds(e,t),zs(t),null;case 5:ta(t);var a=Xi(Zi.current);if(r=t.type,null!==e&&null!=t.stateNode)As(e,t,r,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(null===t.stateNode)throw Error(n(166));return zs(t),null}if(e=Xi(Ki.current),ai(t)){i=t.stateNode,r=t.type;var s=t.memoizedProps;switch(i[ao]=t,i[so]=s,e=!!(1&t.mode),r){case"dialog":Nr("cancel",i),Nr("close",i);break;case"iframe":case"object":case"embed":Nr("load",i);break;case"video":case"audio":for(a=0;a<Ar.length;a++)Nr(Ar[a],i);break;case"source":Nr("error",i);break;case"img":case"image":case"link":Nr("error",i),Nr("load",i);break;case"details":Nr("toggle",i);break;case"input":G(i,s),Nr("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},Nr("invalid",i);break;case"textarea":te(i,s),Nr("invalid",i)}for(var l in ge(r,s),a=null,s)if(s.hasOwnProperty(l)){var u=s[l];"children"===l?"string"==typeof u?i.textContent!==u&&(!0!==s.suppressHydrationWarning&&qr(i.textContent,u,e),a=["children",u]):"number"==typeof u&&i.textContent!==""+u&&(!0!==s.suppressHydrationWarning&&qr(i.textContent,u,e),a=["children",""+u]):o.hasOwnProperty(l)&&null!=u&&"onScroll"===l&&Nr("scroll",i)}switch(r){case"input":H(i),Z(i,s,!0);break;case"textarea":H(i),re(i);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(i.onclick=Gr)}i=a,t.updateQueue=i,null!==i&&(t.flags|=4)}else{l=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=oe(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof i.is?e=l.createElement(r,{is:i.is}):(e=l.createElement(r),"select"===r&&(l=e,i.multiple?l.multiple=!0:i.size&&(l.size=i.size))):e=l.createElementNS(e,r),e[ao]=t,e[so]=i,Ts(e,t,!1,!1),t.stateNode=e;e:{switch(l=me(r,i),r){case"dialog":Nr("cancel",e),Nr("close",e),a=i;break;case"iframe":case"object":case"embed":Nr("load",e),a=i;break;case"video":case"audio":for(a=0;a<Ar.length;a++)Nr(Ar[a],e);a=i;break;case"source":Nr("error",e),a=i;break;case"img":case"image":case"link":Nr("error",e),Nr("load",e),a=i;break;case"details":Nr("toggle",e),a=i;break;case"input":G(e,i),a=q(e,i),Nr("invalid",e);break;case"option":default:a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=R({},i,{value:void 0}),Nr("invalid",e);break;case"textarea":te(e,i),a=ee(e,i),Nr("invalid",e)}for(s in ge(r,a),u=a)if(u.hasOwnProperty(s)){var c=u[s];"style"===s?fe(e,c):"dangerouslySetInnerHTML"===s?null!=(c=c?c.__html:void 0)&&le(e,c):"children"===s?"string"==typeof c?("textarea"!==r||""!==c)&&ue(e,c):"number"==typeof c&&ue(e,""+c):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(o.hasOwnProperty(s)?null!=c&&"onScroll"===s&&Nr("scroll",e):null!=c&&m(e,s,c,l))}switch(r){case"input":H(e),Z(e,i,!1);break;case"textarea":H(e),re(e);break;case"option":null!=i.value&&e.setAttribute("value",""+$(i.value));break;case"select":e.multiple=!!i.multiple,null!=(s=i.value)?J(e,!!i.multiple,s,!1):null!=i.defaultValue&&J(e,!!i.multiple,i.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=Gr)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return zs(t),null;case 6:if(e&&null!=t.stateNode)Os(e,t,e.memoizedProps,i);else{if("string"!=typeof i&&null===t.stateNode)throw Error(n(166));if(r=Xi(Zi.current),Xi(Ki.current),ai(t)){if(i=t.stateNode,r=t.memoizedProps,i[ao]=t,(s=i.nodeValue!==r)&&null!==(e=Xo))switch(e.tag){case 3:qr(i.nodeValue,r,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&qr(i.nodeValue,r,!!(1&e.mode))}s&&(t.flags|=4)}else(i=(9===r.nodeType?r:r.ownerDocument).createTextNode(i))[ao]=t,t.stateNode=i}return zs(t),null;case 13:if(wo(na),i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(Jo&&null!==Qo&&1&t.mode&&!(128&t.flags))si(),li(),t.flags|=98560,s=!1;else if(s=ai(t),null!==i&&null!==i.dehydrated){if(null===e){if(!s)throw Error(n(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(n(317));s[ao]=t}else li(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;zs(t),s=!1}else null!==ei&&(nu(ei),ei=null),s=!0;if(!s)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=r,t):((i=null!==i)!=(null!==e&&null!==e.memoizedState)&&i&&(t.child.flags|=8192,1&t.mode&&(null===e||1&na.current?0===Ol&&(Ol=3):hu())),null!==t.updateQueue&&(t.flags|=4),zs(t),null);case 4:return Ji(),Ds(e,t),null===e&&Fr(t.stateNode.containerInfo),zs(t),null;case 10:return vi(t.type._context),zs(t),null;case 19:if(wo(na),null===(s=t.memoizedState))return zs(t),null;if(i=!!(128&t.flags),null===(l=s.rendering))if(i)$s(s,!1);else{if(0!==Ol||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(l=ra(e))){for(t.flags|=128,$s(s,!1),null!==(i=l.updateQueue)&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;null!==r;)e=i,(s=r).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Eo(na,1&na.current|2),t.child}e=e.sibling}null!==s.tail&&Ke()>Ml&&(t.flags|=128,i=!0,$s(s,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=ra(l))){if(t.flags|=128,i=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),$s(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!Jo)return zs(t),null}else 2*Ke()-s.renderingStartTime>Ml&&1073741824!==r&&(t.flags|=128,i=!0,$s(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(r=s.last)?r.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ke(),t.sibling=null,r=na.current,Eo(na,i?1&r|2:1&r),t):(zs(t),null);case 22:case 23:return su(),i=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==i&&(t.flags|=8192),i&&1&t.mode?!!(1073741824&Dl)&&(zs(t),6&t.subtreeFlags&&(t.flags|=8192)):zs(t),null;case 24:case 25:return null}throw Error(n(156,t.tag))}function Vs(e,t){switch(Zo(t),t.tag){case 1:return To(t.type)&&Do(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Ji(),wo(ko),wo(xo),ia(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return ta(t),null;case 13:if(wo(na),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));li()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return wo(na),null;case 4:return Ji(),null;case 10:return vi(t.type._context),null;case 22:case 23:return su(),null;default:return null}}Ts=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ds=function(){},As=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Xi(Ki.current);var a,s=null;switch(n){case"input":i=q(e,i),r=q(e,r),s=[];break;case"select":i=R({},i,{value:void 0}),r=R({},r,{value:void 0}),s=[];break;case"textarea":i=ee(e,i),r=ee(e,r),s=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=Gr)}for(c in ge(n,r),n=null,i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&null!=i[c])if("style"===c){var l=i[c];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(o.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var u=r[c];if(l=null!=i?i[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(null!=u||null!=l))if("style"===c)if(l){for(a in l)!l.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&l[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(s||(s=[]),s.push(c,n)),n=u;else"dangerouslySetInnerHTML"===c?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(s=s||[]).push(c,u)):"children"===c?"string"!=typeof u&&"number"!=typeof u||(s=s||[]).push(c,""+u):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(o.hasOwnProperty(c)?(null!=u&&"onScroll"===c&&Nr("scroll",e),s||l===u||(s=[])):(s=s||[]).push(c,u))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}},Os=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ws=!1,qs=!1,Gs="function"==typeof WeakSet?WeakSet:Set,Ks=null;function Ys(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){xu(e,t,n)}else n.current=null}function Zs(e,t,n){try{n()}catch(n){xu(e,t,n)}}var Xs=!1;function Qs(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&Zs(t,n,i)}o=o.next}while(o!==r)}}function Js(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function el(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function tl(e){var t=e.alternate;null!==t&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&(delete t[ao],delete t[so],delete t[uo],delete t[co],delete t[po]),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nl(e){return 5===e.tag||3===e.tag||4===e.tag}function rl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ol(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Gr));else if(4!==r&&null!==(e=e.child))for(ol(e,t,n),e=e.sibling;null!==e;)ol(e,t,n),e=e.sibling}function il(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(il(e,t,n),e=e.sibling;null!==e;)il(e,t,n),e=e.sibling}var al=null,sl=!1;function ll(e,t,n){for(n=n.child;null!==n;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(nt&&"function"==typeof nt.onCommitFiberUnmount)try{nt.onCommitFiberUnmount(tt,n)}catch(e){}switch(n.tag){case 5:qs||Ys(n,t);case 6:var r=al,o=sl;al=null,ll(e,t,n),sl=o,null!==(al=r)&&(sl?(e=al,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):al.removeChild(n.stateNode));break;case 18:null!==al&&(sl?(e=al,n=n.stateNode,8===e.nodeType?no(e.parentNode,n):1===e.nodeType&&no(e,n),Ut(e)):no(al,n.stateNode));break;case 4:r=al,o=sl,al=n.stateNode.containerInfo,sl=!0,ll(e,t,n),al=r,sl=o;break;case 0:case 11:case 14:case 15:if(!qs&&null!==(r=n.updateQueue)&&null!==(r=r.lastEffect)){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(2&i||4&i)&&Zs(n,t,a),o=o.next}while(o!==r)}ll(e,t,n);break;case 1:if(!qs&&(Ys(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){xu(n,t,e)}ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:1&n.mode?(qs=(r=qs)||null!==n.memoizedState,ll(e,t,n),qs=r):ll(e,t,n);break;default:ll(e,t,n)}}function cl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Gs),t.forEach(function(t){var r=Tu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function dl(e,t){var r=t.deletions;if(null!==r)for(var o=0;o<r.length;o++){var i=r[o];try{var a=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:al=l.stateNode,sl=!1;break e;case 3:case 4:al=l.stateNode.containerInfo,sl=!0;break e}l=l.return}if(null===al)throw Error(n(160));ul(a,s,i),al=null,sl=!1;var u=i.alternate;null!==u&&(u.return=null),i.return=null}catch(e){xu(i,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)pl(t,e),t=t.sibling}function pl(e,t){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dl(t,e),fl(e),4&o){try{Qs(3,e,e.return),Js(3,e)}catch(t){xu(e,e.return,t)}try{Qs(5,e,e.return)}catch(t){xu(e,e.return,t)}}break;case 1:dl(t,e),fl(e),512&o&&null!==r&&Ys(r,r.return);break;case 5:if(dl(t,e),fl(e),512&o&&null!==r&&Ys(r,r.return),32&e.flags){var i=e.stateNode;try{ue(i,"")}catch(t){xu(e,e.return,t)}}if(4&o&&null!=(i=e.stateNode)){var a=e.memoizedProps,s=null!==r?r.memoizedProps:a,l=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===l&&"radio"===a.type&&null!=a.name&&K(i,a),me(l,s);var c=me(l,a);for(s=0;s<u.length;s+=2){var d=u[s],p=u[s+1];"style"===d?fe(i,p):"dangerouslySetInnerHTML"===d?le(i,p):"children"===d?ue(i,p):m(i,d,p,c)}switch(l){case"input":Y(i,a);break;case"textarea":ne(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var h=a.value;null!=h?J(i,!!a.multiple,h,!1):f!==!!a.multiple&&(null!=a.defaultValue?J(i,!!a.multiple,a.defaultValue,!0):J(i,!!a.multiple,a.multiple?[]:"",!1))}i[so]=a}catch(t){xu(e,e.return,t)}}break;case 6:if(dl(t,e),fl(e),4&o){if(null===e.stateNode)throw Error(n(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(t){xu(e,e.return,t)}}break;case 3:if(dl(t,e),fl(e),4&o&&null!==r&&r.memoizedState.isDehydrated)try{Ut(t.containerInfo)}catch(t){xu(e,e.return,t)}break;case 4:default:dl(t,e),fl(e);break;case 13:dl(t,e),fl(e),8192&(i=e.child).flags&&(a=null!==i.memoizedState,i.stateNode.isHidden=a,!a||null!==i.alternate&&null!==i.alternate.memoizedState||(Ll=Ke())),4&o&&cl(e);break;case 22:if(d=null!==r&&null!==r.memoizedState,1&e.mode?(qs=(c=qs)||d,dl(t,e),qs=c):dl(t,e),fl(e),8192&o){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!d&&1&e.mode)for(Ks=e,d=e.child;null!==d;){for(p=Ks=d;null!==Ks;){switch(h=(f=Ks).child,f.tag){case 0:case 11:case 14:case 15:Qs(4,f,f.return);break;case 1:Ys(f,f.return);var g=f.stateNode;if("function"==typeof g.componentWillUnmount){o=f,r=f.return;try{t=o,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(e){xu(o,r,e)}}break;case 5:Ys(f,f.return);break;case 22:if(null!==f.memoizedState){vl(p);continue}}null!==h?(h.return=f,Ks=h):vl(p)}d=d.sibling}e:for(d=null,p=e;;){if(5===p.tag){if(null===d){d=p;try{i=p.stateNode,c?"function"==typeof(a=i.style).setProperty?a.setProperty("display","none","important"):a.display="none":(l=p.stateNode,s=null!=(u=p.memoizedProps.style)&&u.hasOwnProperty("display")?u.display:null,l.style.display=pe("display",s))}catch(t){xu(e,e.return,t)}}}else if(6===p.tag){if(null===d)try{p.stateNode.nodeValue=c?"":p.memoizedProps}catch(t){xu(e,e.return,t)}}else if((22!==p.tag&&23!==p.tag||null===p.memoizedState||p===e)&&null!==p.child){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;null===p.sibling;){if(null===p.return||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:dl(t,e),fl(e),4&o&&cl(e);case 21:}}function fl(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(nl(r)){var o=r;break e}r=r.return}throw Error(n(160))}switch(o.tag){case 5:var i=o.stateNode;32&o.flags&&(ue(i,""),o.flags&=-33),il(e,rl(e),i);break;case 3:case 4:var a=o.stateNode.containerInfo;ol(e,rl(e),a);break;default:throw Error(n(161))}}catch(t){xu(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function hl(e,t,n){Ks=e,gl(e)}function gl(e,t,n){for(var r=!!(1&e.mode);null!==Ks;){var o=Ks,i=o.child;if(22===o.tag&&r){var a=null!==o.memoizedState||Ws;if(!a){var s=o.alternate,l=null!==s&&null!==s.memoizedState||qs;s=Ws;var u=qs;if(Ws=a,(qs=l)&&!u)for(Ks=o;null!==Ks;)l=(a=Ks).child,22===a.tag&&null!==a.memoizedState?yl(o):null!==l?(l.return=a,Ks=l):yl(o);for(;null!==i;)Ks=i,gl(i),i=i.sibling;Ks=o,Ws=s,qs=u}ml(e)}else 8772&o.subtreeFlags&&null!==i?(i.return=o,Ks=i):ml(e)}}function ml(e){for(;null!==Ks;){var t=Ks;if(8772&t.flags){var r=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:qs||Js(5,t);break;case 1:var o=t.stateNode;if(4&t.flags&&!qs)if(null===r)o.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:di(t.type,r.memoizedProps);o.componentDidUpdate(i,r.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&Ni(t,a,o);break;case 3:var s=t.updateQueue;if(null!==s){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}Ni(t,s,r)}break;case 5:var l=t.stateNode;if(null===r&&4&t.flags){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var d=c.memoizedState;if(null!==d){var p=d.dehydrated;null!==p&&Ut(p)}}}break;default:throw Error(n(163))}qs||512&t.flags&&el(t)}catch(e){xu(t,t.return,e)}}if(t===e){Ks=null;break}if(null!==(r=t.sibling)){r.return=t.return,Ks=r;break}Ks=t.return}}function vl(e){for(;null!==Ks;){var t=Ks;if(t===e){Ks=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Ks=n;break}Ks=t.return}}function yl(e){for(;null!==Ks;){var t=Ks;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Js(4,t)}catch(e){xu(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(e){xu(t,o,e)}}var i=t.return;try{el(t)}catch(e){xu(t,i,e)}break;case 5:var a=t.return;try{el(t)}catch(e){xu(t,a,e)}}}catch(e){xu(t,t.return,e)}if(t===e){Ks=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Ks=s;break}Ks=t.return}}var bl,wl=Math.ceil,El=v.ReactCurrentDispatcher,_l=v.ReactCurrentOwner,xl=v.ReactCurrentBatchConfig,kl=0,Cl=null,Sl=null,Tl=0,Dl=0,Al=bo(0),Ol=0,Pl=null,Il=0,Nl=0,Rl=0,Bl=null,Fl=null,Ll=0,Ml=1/0,Ul=null,jl=!1,$l=null,zl=null,Hl=!1,Vl=null,Wl=0,ql=0,Gl=null,Kl=-1,Yl=0;function Zl(){return 6&kl?Ke():-1!==Kl?Kl:Kl=Ke()}function Xl(e){return 1&e.mode?2&kl&&0!==Tl?Tl&-Tl:null!==ci.transition?(0===Yl&&(Yl=pt()),Yl):0!==(e=mt)?e:e=void 0===(e=window.event)?16:Gt(e.type):1}function Ql(e,t,r,o){if(50<ql)throw ql=0,Gl=null,Error(n(185));ht(e,r,o),2&kl&&e===Cl||(e===Cl&&(!(2&kl)&&(Nl|=r),4===Ol&&ru(e,Tl)),Jl(e,o),1===r&&0===kl&&!(1&t.mode)&&(Ml=Ke()+500,Ro&&Lo()))}function Jl(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-rt(i),s=1<<a,l=o[a];-1===l?0!==(s&n)&&0===(s&r)||(o[a]=ct(s,t)):l<=t&&(e.expiredLanes|=s),i&=~s}}(e,t);var r=ut(e,e===Cl?Tl:0);if(0===r)null!==n&&We(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&We(n),1===t)0===e.tag?function(e){Ro=!0,Fo(e)}(ou.bind(null,e)):Fo(ou.bind(null,e)),eo(function(){!(6&kl)&&Lo()}),n=null;else{switch(vt(r)){case 1:n=Ze;break;case 4:n=Xe;break;case 16:default:n=Qe;break;case 536870912:n=et}n=Du(n,eu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function eu(e,t){if(Kl=-1,Yl=0,6&kl)throw Error(n(327));var r=e.callbackNode;if(Eu()&&e.callbackNode!==r)return null;var o=ut(e,e===Cl?Tl:0);if(0===o)return null;if(30&o||0!==(o&e.expiredLanes)||t)t=gu(e,o);else{t=o;var i=kl;kl|=2;var a=pu();for(Cl===e&&Tl===t||(Ul=null,Ml=Ke()+500,lu(e,t));;)try{vu();break}catch(t){uu(e,t)}mi(),El.current=a,kl=i,null!==Sl?t=0:(Cl=null,Tl=0,t=Ol)}if(0!==t){if(2===t&&0!==(i=dt(e))&&(o=i,t=tu(e,i)),1===t)throw r=Pl,lu(e,0),ru(e,o),Jl(e,Ke()),r;if(6===t)ru(e,o);else{if(i=e.current.alternate,!(30&o||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!tr(i(),o))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)||(t=gu(e,o),2===t&&(a=dt(e),0!==a&&(o=a,t=tu(e,a))),1!==t)))throw r=Pl,lu(e,0),ru(e,o),Jl(e,Ke()),r;switch(e.finishedWork=i,e.finishedLanes=o,t){case 0:case 1:throw Error(n(345));case 2:case 5:wu(e,Fl,Ul);break;case 3:if(ru(e,o),(130023424&o)===o&&10<(t=Ll+500-Ke())){if(0!==ut(e,0))break;if(((i=e.suspendedLanes)&o)!==o){Zl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Xr(wu.bind(null,e,Fl,Ul),t);break}wu(e,Fl,Ul);break;case 4:if(ru(e,o),(4194240&o)===o)break;for(t=e.eventTimes,i=-1;0<o;){var s=31-rt(o);a=1<<s,(s=t[s])>i&&(i=s),o&=~a}if(o=i,10<(o=(120>(o=Ke()-o)?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*wl(o/1960))-o)){e.timeoutHandle=Xr(wu.bind(null,e,Fl,Ul),o);break}wu(e,Fl,Ul);break;default:throw Error(n(329))}}}return Jl(e,Ke()),e.callbackNode===r?eu.bind(null,e):null}function tu(e,t){var n=Bl;return e.current.memoizedState.isDehydrated&&(lu(e,t).flags|=256),2!==(e=gu(e,t))&&(t=Fl,Fl=n,null!==t&&nu(t)),e}function nu(e){null===Fl?Fl=e:Fl.push.apply(Fl,e)}function ru(e,t){for(t&=~Rl,t&=~Nl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-rt(t),r=1<<n;e[n]=-1,t&=~r}}function ou(e){if(6&kl)throw Error(n(327));Eu();var t=ut(e,0);if(!(1&t))return Jl(e,Ke()),null;var r=gu(e,t);if(0!==e.tag&&2===r){var o=dt(e);0!==o&&(t=o,r=tu(e,o))}if(1===r)throw r=Pl,lu(e,0),ru(e,t),Jl(e,Ke()),r;if(6===r)throw Error(n(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,wu(e,Fl,Ul),Jl(e,Ke()),null}function iu(e,t){var n=kl;kl|=1;try{return e(t)}finally{0===(kl=n)&&(Ml=Ke()+500,Ro&&Lo())}}function au(e){null!==Vl&&0===Vl.tag&&!(6&kl)&&Eu();var t=kl;kl|=1;var n=xl.transition,r=mt;try{if(xl.transition=null,mt=1,e)return e()}finally{mt=r,xl.transition=n,!(6&(kl=t))&&Lo()}}function su(){Dl=Al.current,wo(Al)}function lu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Qr(n)),null!==Sl)for(n=Sl.return;null!==n;){var r=n;switch(Zo(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Do();break;case 3:Ji(),wo(ko),wo(xo),ia();break;case 5:ta(r);break;case 4:Ji();break;case 13:case 19:wo(na);break;case 10:vi(r.type._context);break;case 22:case 23:su()}n=n.return}if(Cl=e,Sl=e=Iu(e.current,null),Tl=Dl=t,Ol=0,Pl=null,Rl=Nl=Il=0,Fl=Bl=null,null!==Ei){for(t=0;t<Ei.length;t++)if(null!==(r=(n=Ei[t]).interleaved)){n.interleaved=null;var o=r.next,i=n.pending;if(null!==i){var a=i.next;i.next=o,r.next=a}n.pending=r}Ei=null}return e}function uu(e,t){for(;;){var r=Sl;try{if(mi(),aa.current=ts,pa){for(var o=ua.memoizedState;null!==o;){var i=o.queue;null!==i&&(i.pending=null),o=o.next}pa=!1}if(la=0,da=ca=ua=null,fa=!1,ha=0,_l.current=null,null===r||null===r.return){Ol=1,Pl=t,Sl=null;break}e:{var a=e,s=r.return,l=r,u=t;if(t=Tl,l.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var c=u,d=l,p=d.tag;if(!(1&d.mode||0!==p&&11!==p&&15!==p)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=ps(s);if(null!==h){h.flags&=-257,fs(h,s,l,0,t),1&h.mode&&ds(a,c,t),u=c;var g=(t=h).updateQueue;if(null===g){var m=new Set;m.add(u),t.updateQueue=m}else g.add(u);break e}if(!(1&t)){ds(a,c,t),hu();break e}u=Error(n(426))}else if(Jo&&1&l.mode){var v=ps(s);if(null!==v){!(65536&v.flags)&&(v.flags|=256),fs(v,s,l,0,t),ui(is(u,l));break e}}a=u=is(u,l),4!==Ol&&(Ol=2),null===Bl?Bl=[a]:Bl.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Pi(a,us(0,u,t));break e;case 1:l=u;var y=a.type,b=a.stateNode;if(!(128&a.flags||"function"!=typeof y.getDerivedStateFromError&&(null===b||"function"!=typeof b.componentDidCatch||null!==zl&&zl.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t,Pi(a,cs(a,l,t));break e}}a=a.return}while(null!==a)}bu(r)}catch(e){t=e,Sl===r&&null!==r&&(Sl=r=r.return);continue}break}}function pu(){var e=El.current;return El.current=ts,null===e?ts:e}function hu(){0!==Ol&&3!==Ol&&2!==Ol||(Ol=4),null===Cl||!(268435455&Il)&&!(268435455&Nl)||ru(Cl,Tl)}function gu(e,t){var r=kl;kl|=2;var o=pu();for(Cl===e&&Tl===t||(Ul=null,lu(e,t));;)try{mu();break}catch(t){uu(e,t)}if(mi(),kl=r,El.current=o,null!==Sl)throw Error(n(261));return Cl=null,Tl=0,Ol}function mu(){for(;null!==Sl;)yu(Sl)}function vu(){for(;null!==Sl&&!qe();)yu(Sl)}function yu(e){var t=bl(e.alternate,e,Dl);e.memoizedProps=e.pendingProps,null===t?bu(e):Sl=t,_l.current=null}function bu(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Vs(n,t)))return n.flags&=32767,void(Sl=n);if(null===e)return Ol=6,void(Sl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Hs(n,t,Dl)))return void(Sl=n);if(null!==(t=t.sibling))return void(Sl=t);Sl=t=e}while(null!==t);0===Ol&&(Ol=5)}function wu(e,t,r){var o=mt,i=xl.transition;try{xl.transition=null,mt=1,function(e,t,r,o){do{Eu()}while(null!==Vl);if(6&kl)throw Error(n(327));r=e.finishedWork;var i=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(n(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-rt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}(e,a),e===Cl&&(Sl=Cl=null,Tl=0),!(2064&r.subtreeFlags)&&!(2064&r.flags)||Hl||(Hl=!0,Du(Qe,function(){return Eu(),null})),a=!!(15990&r.flags),15990&r.subtreeFlags||a){a=xl.transition,xl.transition=null;var s=mt;mt=1;var l=kl;kl|=4,_l.current=null,function(e,t){if(Kr=$t,sr(e=ar())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var o=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(o&&0!==o.rangeCount){r=o.anchorNode;var i=o.anchorOffset,a=o.focusNode;o=o.focusOffset;try{r.nodeType,a.nodeType}catch(e){r=null;break e}var s=0,l=-1,u=-1,c=0,d=0,p=e,f=null;t:for(;;){for(var h;p!==r||0!==i&&3!==p.nodeType||(l=s+i),p!==a||0!==o&&3!==p.nodeType||(u=s+o),3===p.nodeType&&(s+=p.nodeValue.length),null!==(h=p.firstChild);)f=p,p=h;for(;;){if(p===e)break t;if(f===r&&++c===i&&(l=s),f===a&&++d===o&&(u=s),null!==(h=p.nextSibling))break;f=(p=f).parentNode}p=h}r=-1===l||-1===u?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Yr={focusedElem:e,selectionRange:r},$t=!1,Ks=t;null!==Ks;)if(e=(t=Ks).child,1028&t.subtreeFlags&&null!==e)e.return=t,Ks=e;else for(;null!==Ks;){t=Ks;try{var g=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var m=g.memoizedProps,v=g.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:di(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;1===w.nodeType?w.textContent="":9===w.nodeType&&w.documentElement&&w.removeChild(w.documentElement);break;default:throw Error(n(163))}}catch(e){xu(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Ks=e;break}Ks=t.return}g=Xs,Xs=!1}(e,r),pl(r,e),lr(Yr),$t=!!Kr,Yr=Kr=null,e.current=r,hl(r),Ge(),kl=l,mt=s,xl.transition=a}else e.current=r;if(Hl&&(Hl=!1,Vl=e,Wl=i),0===(a=e.pendingLanes)&&(zl=null),function(e){if(nt&&"function"==typeof nt.onCommitFiberRoot)try{nt.onCommitFiberRoot(tt,e,void 0,!(128&~e.current.flags))}catch(e){}}(r.stateNode),Jl(e,Ke()),null!==t)for(o=e.onRecoverableError,r=0;r<t.length;r++)o((i=t[r]).value,{componentStack:i.stack,digest:i.digest});if(jl)throw jl=!1,e=$l,$l=null,e;!!(1&Wl)&&0!==e.tag&&Eu(),1&(a=e.pendingLanes)?e===Gl?ql++:(ql=0,Gl=e):ql=0,Lo()}(e,t,r,o)}finally{xl.transition=i,mt=o}return null}function Eu(){if(null!==Vl){var e=vt(Wl),t=xl.transition,r=mt;try{if(xl.transition=null,mt=16>e?16:e,null===Vl)var o=!1;else{if(e=Vl,Vl=null,Wl=0,6&kl)throw Error(n(331));var i=kl;for(kl|=4,Ks=e.current;null!==Ks;){var a=Ks,s=a.child;if(16&Ks.flags){var l=a.deletions;if(null!==l){for(var u=0;u<l.length;u++){var c=l[u];for(Ks=c;null!==Ks;){var d=Ks;switch(d.tag){case 0:case 11:case 15:Qs(8,d,a)}var p=d.child;if(null!==p)p.return=d,Ks=p;else for(;null!==Ks;){var f=(d=Ks).sibling,h=d.return;if(tl(d),d===c){Ks=null;break}if(null!==f){f.return=h,Ks=f;break}Ks=h}}}var g=a.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(null!==m)}}Ks=a}}if(2064&a.subtreeFlags&&null!==s)s.return=a,Ks=s;else e:for(;null!==Ks;){if(2048&(a=Ks).flags)switch(a.tag){case 0:case 11:case 15:Qs(9,a,a.return)}var y=a.sibling;if(null!==y){y.return=a.return,Ks=y;break e}Ks=a.return}}var b=e.current;for(Ks=b;null!==Ks;){var w=(s=Ks).child;if(2064&s.subtreeFlags&&null!==w)w.return=s,Ks=w;else e:for(s=b;null!==Ks;){if(2048&(l=Ks).flags)try{switch(l.tag){case 0:case 11:case 15:Js(9,l)}}catch(e){xu(l,l.return,e)}if(l===s){Ks=null;break e}var E=l.sibling;if(null!==E){E.return=l.return,Ks=E;break e}Ks=l.return}}if(kl=i,Lo(),nt&&"function"==typeof nt.onPostCommitFiberRoot)try{nt.onPostCommitFiberRoot(tt,e)}catch(e){}o=!0}return o}finally{mt=r,xl.transition=t}}return!1}function _u(e,t,n){e=Ai(e,t=us(0,t=is(n,t),1),1),t=Zl(),null!==e&&(ht(e,1,t),Jl(e,t))}function xu(e,t,n){if(3===e.tag)_u(e,e,n);else for(;null!==t;){if(3===t.tag){_u(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===zl||!zl.has(r))){t=Ai(t,e=cs(t,e=is(n,e),1),1),e=Zl(),null!==t&&(ht(t,1,e),Jl(t,e));break}}t=t.return}}function ku(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Zl(),e.pingedLanes|=e.suspendedLanes&n,Cl===e&&(Tl&n)===n&&(4===Ol||3===Ol&&(130023424&Tl)===Tl&&500>Ke()-Ll?lu(e,0):Rl|=n),Jl(e,t)}function Cu(e,t){0===t&&(1&e.mode?(t=st,!(130023424&(st<<=1))&&(st=4194304)):t=1);var n=Zl();null!==(e=ki(e,t))&&(ht(e,t,n),Jl(e,n))}function Su(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Cu(e,n)}function Tu(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(n(314))}null!==o&&o.delete(t),Cu(e,r)}function Du(e,t){return Ve(e,t)}function Au(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ou(e,t,n,r){return new Au(e,t,n,r)}function Pu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Iu(e,t){var n=e.alternate;return null===n?((n=Ou(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Nu(e,t,r,o,i,a){var s=2;if(o=e,"function"==typeof e)Pu(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case w:return Ru(r.children,i,a,t);case E:s=8,i|=8;break;case _:return(e=Ou(12,r,t,2|i)).elementType=_,e.lanes=a,e;case S:return(e=Ou(13,r,t,i)).elementType=S,e.lanes=a,e;case T:return(e=Ou(19,r,t,i)).elementType=T,e.lanes=a,e;case O:return Bu(r,i,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case x:s=10;break e;case k:s=9;break e;case C:s=11;break e;case D:s=14;break e;case A:s=16,o=null;break e}throw Error(n(130,null==e?e:typeof e,""))}return(t=Ou(s,r,t,i)).elementType=e,t.type=o,t.lanes=a,t}function Ru(e,t,n,r){return(e=Ou(7,e,r,t)).lanes=n,e}function Bu(e,t,n,r){return(e=Ou(22,e,r,t)).elementType=O,e.lanes=n,e.stateNode={isHidden:!1},e}function Fu(e,t,n){return(e=Ou(6,e,null,t)).lanes=n,e}function Lu(e,t,n){return(t=Ou(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mu(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ft(0),this.expirationTimes=ft(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Uu(e,t,n,r,o,i,a,s,l){return e=new Mu(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=Ou(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Si(i),e}function ju(e){if(!e)return _o;e:{if(Ue(e=e._reactInternals)!==e||1!==e.tag)throw Error(n(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(To(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(n(171))}if(1===e.tag){var r=e.type;if(To(r))return Oo(e,r,t)}return t}function $u(e,t,n,r,o,i,a,s,l){return(e=Uu(n,r,!0,e,0,i,0,s,l)).context=ju(null),n=e.current,(i=Di(r=Zl(),o=Xl(n))).callback=null!=t?t:null,Ai(n,i,o),e.current.lanes=o,ht(e,o,r),Jl(e,r),e}function zu(e,t,n,r){var o=t.current,i=Zl(),a=Xl(o);return n=ju(n),null===t.context?t.context=n:t.pendingContext=n,(t=Di(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Ai(o,t,a))&&(Ql(e,o,a,i),Oi(e,o,a)),a}function Hu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Vu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Wu(e,t){Vu(e,t),(e=e.alternate)&&Vu(e,t)}bl=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||ko.current)gs=!0;else{if(0===(e.lanes&r)&&!(128&t.flags))return gs=!1,function(e,t,n){switch(t.tag){case 3:Cs(t),li();break;case 5:ea(t);break;case 1:To(t.type)&&Po(t);break;case 4:Qi(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Eo(pi,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Eo(na,1&na.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Ns(e,t,n):(Eo(na,1&na.current),null!==(e=js(e,t,n))?e.sibling:null);Eo(na,1&na.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return Ms(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),Eo(na,na.current),r)break;return null;case 22:case 23:return t.lanes=0,ws(e,t,n)}return js(e,t,n)}(e,t,r);gs=!!(131072&e.flags)}else gs=!1,Jo&&1048576&t.flags&&Ko(t,$o,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Us(e,t),e=t.pendingProps;var i=So(t,xo.current);bi(t,r),i=ya(null,t,o,e,i,r);var a=ba();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,To(o)?(a=!0,Po(t)):a=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Si(t),i.updater=Fi,t.stateNode=i,i._reactInternals=t,ji(t,o,e,r),t=ks(null,t,o,!0,a,r)):(t.tag=0,Jo&&a&&Yo(t),ms(null,t,i,r),t=t.child),t;case 16:o=t.elementType;e:{switch(Us(e,t),e=t.pendingProps,o=(i=o._init)(o._payload),t.type=o,i=t.tag=function(e){if("function"==typeof e)return Pu(e)?1:0;if(null!=e){if((e=e.$$typeof)===C)return 11;if(e===D)return 14}return 2}(o),e=di(o,e),i){case 0:t=_s(null,t,o,e,r);break e;case 1:t=xs(null,t,o,e,r);break e;case 11:t=vs(null,t,o,e,r);break e;case 14:t=ys(null,t,o,di(o.type,e),r);break e}throw Error(n(306,o,""))}return t;case 0:return o=t.type,i=t.pendingProps,_s(e,t,o,i=t.elementType===o?i:di(o,i),r);case 1:return o=t.type,i=t.pendingProps,xs(e,t,o,i=t.elementType===o?i:di(o,i),r);case 3:e:{if(Cs(t),null===e)throw Error(n(387));o=t.pendingProps,i=(a=t.memoizedState).element,Ti(e,t),Ii(t,o,null,r);var s=t.memoizedState;if(o=s.element,a.isDehydrated){if(a={element:o,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Ss(e,t,o,r,i=is(Error(n(423)),t));break e}if(o!==i){t=Ss(e,t,o,r,i=is(Error(n(424)),t));break e}for(Qo=ro(t.stateNode.containerInfo.firstChild),Xo=t,Jo=!0,ei=null,r=qi(t,null,o,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(li(),o===i){t=js(e,t,r);break e}ms(e,t,o,r)}t=t.child}return t;case 5:return ea(t),null===e&&oi(t),o=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,Zr(o,i)?s=null:null!==a&&Zr(o,a)&&(t.flags|=32),Es(e,t),ms(e,t,s,r),t.child;case 6:return null===e&&oi(t),null;case 13:return Ns(e,t,r);case 4:return Qi(t,t.stateNode.containerInfo),o=t.pendingProps,null===e?t.child=Wi(t,null,o,r):ms(e,t,o,r),t.child;case 11:return o=t.type,i=t.pendingProps,vs(e,t,o,i=t.elementType===o?i:di(o,i),r);case 7:return ms(e,t,t.pendingProps,r),t.child;case 8:case 12:return ms(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(o=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,Eo(pi,o._currentValue),o._currentValue=s,null!==a)if(tr(a.value,s)){if(a.children===i.children&&!ko.current){t=js(e,t,r);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){s=a.child;for(var u=l.firstContext;null!==u;){if(u.context===o){if(1===a.tag){(u=Di(-1,r&-r)).tag=2;var c=a.updateQueue;if(null!==c){var d=(c=c.shared).pending;null===d?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}a.lanes|=r,null!==(u=a.alternate)&&(u.lanes|=r),yi(a.return,r,t),l.lanes|=r;break}u=u.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(n(341));s.lanes|=r,null!==(l=s.alternate)&&(l.lanes|=r),yi(s,r,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}ms(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,o=t.pendingProps.children,bi(t,r),o=o(i=wi(i)),t.flags|=1,ms(e,t,o,r),t.child;case 14:return i=di(o=t.type,t.pendingProps),ys(e,t,o,i=di(o.type,i),r);case 15:return bs(e,t,t.type,t.pendingProps,r);case 17:return o=t.type,i=t.pendingProps,i=t.elementType===o?i:di(o,i),Us(e,t),t.tag=1,To(o)?(e=!0,Po(t)):e=!1,bi(t,r),Mi(t,o,i),ji(t,o,i,r),ks(null,t,o,!0,e,r);case 19:return Ms(e,t,r);case 22:return ws(e,t,r)}throw Error(n(156,t.tag))};var qu="function"==typeof reportError?reportError:function(e){console.error(e)};function Gu(e){this._internalRoot=e}function Ku(e){this._internalRoot=e}function Yu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Zu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Xu(){}function Qu(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if("function"==typeof o){var s=o;o=function(){var e=Hu(a);s.call(e)}}zu(t,a,e,o)}else a=function(e,t,n,r,o){if(o){if("function"==typeof r){var i=r;r=function(){var e=Hu(a);i.call(e)}}var a=$u(t,r,e,0,null,!1,0,"",Xu);return e._reactRootContainer=a,e[lo]=a.current,Fr(8===e.nodeType?e.parentNode:e),au(),a}for(;o=e.lastChild;)e.removeChild(o);if("function"==typeof r){var s=r;r=function(){var e=Hu(l);s.call(e)}}var l=Uu(e,0,!1,null,0,!1,0,"",Xu);return e._reactRootContainer=l,e[lo]=l.current,Fr(8===e.nodeType?e.parentNode:e),au(function(){zu(t,l,n,r)}),l}(n,t,e,o,r);return Hu(a)}Ku.prototype.render=Gu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(n(409));zu(e,t,null,null)},Ku.prototype.unmount=Gu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;au(function(){zu(null,e,null,null)}),t[lo]=null}},Ku.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ot.length&&0!==t&&t<Ot[n].priority;n++);Ot.splice(n,0,e),0===n&&Rt(e)}},yt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=lt(t.pendingLanes);0!==n&&(gt(t,1|n),Jl(t,Ke()),!(6&kl)&&(Ml=Ke()+500,Lo()))}break;case 13:au(function(){var t=ki(e,1);if(null!==t){var n=Zl();Ql(t,e,1,n)}}),Wu(e,1)}},bt=function(e){if(13===e.tag){var t=ki(e,134217728);null!==t&&Ql(t,e,134217728,Zl()),Wu(e,134217728)}},wt=function(e){if(13===e.tag){var t=Xl(e),n=ki(e,t);null!==n&&Ql(n,e,t,Zl()),Wu(e,t)}},Et=function(){return mt},_t=function(e,t){var n=mt;try{return mt=e,t()}finally{mt=n}},be=function(e,t,r){switch(t){case"input":if(Y(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var o=r[t];if(o!==e&&o.form===e.form){var i=mo(o);if(!i)throw Error(n(90));V(o),Y(o,i)}}}break;case"textarea":ne(e,r);break;case"select":null!=(t=r.value)&&J(e,!!r.multiple,t,!1)}},Ce=iu,Se=au;var Ju={usingClientEntryPoint:!1,Events:[ho,go,mo,xe,ke,iu]},ec={findFiberByHostInstance:fo,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},tc={bundleType:ec.bundleType,version:ec.version,rendererPackageName:ec.rendererPackageName,rendererConfig:ec.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:v.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=ze(e))?null:e.stateNode},findFiberByHostInstance:ec.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nc.isDisabled&&nc.supportsFiber)try{tt=nc.inject(tc),nt=nc}catch(se){}}return fu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ju,fu.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Yu(t))throw Error(n(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:b,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,r)},fu.createRoot=function(e,t){if(!Yu(e))throw Error(n(299));var r=!1,o="",i=qu;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(o=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Uu(e,1,!1,null,0,r,0,o,i),e[lo]=t.current,Fr(8===e.nodeType?e.parentNode:e),new Gu(t)},fu.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(n(188));throw e=Object.keys(e).join(","),Error(n(268,e))}return null===(e=ze(t))?null:e.stateNode},fu.flushSync=function(e){return au(e)},fu.hydrate=function(e,t,r){if(!Zu(t))throw Error(n(200));return Qu(null,e,t,!0,r)},fu.hydrateRoot=function(e,t,r){if(!Yu(e))throw Error(n(405));var o=null!=r&&r.hydratedSources||null,i=!1,a="",s=qu;if(null!=r&&(!0===r.unstable_strictMode&&(i=!0),void 0!==r.identifierPrefix&&(a=r.identifierPrefix),void 0!==r.onRecoverableError&&(s=r.onRecoverableError)),t=$u(t,null,e,1,null!=r?r:null,i,0,a,s),e[lo]=t.current,Fr(e),o)for(e=0;e<o.length;e++)i=(i=(r=o[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Ku(t)},fu.render=function(e,t,r){if(!Zu(t))throw Error(n(200));return Qu(null,e,t,!1,r)},fu.unmountComponentAtNode=function(e){if(!Zu(e))throw Error(n(40));return!!e._reactRootContainer&&(au(function(){Qu(null,null,e,!1,function(){e._reactRootContainer=null,e[lo]=null})}),!0)},fu.unstable_batchedUpdates=iu,fu.unstable_renderSubtreeIntoContainer=function(e,t,r,o){if(!Zu(r))throw Error(n(200));if(null==e||void 0===e._reactInternals)throw Error(n(38));return Qu(e,t,r,!1,o)},fu.version="18.2.0-next-9e3b772b8-20220608",fu}();var hu=Bn(pu.exports);const gu=Symbol(),mu=Symbol(),vu="a",yu="f",bu="n",wu="g",Eu="w";const _u=Object.getPrototypeOf,xu=new WeakMap,ku=e=>e&&(xu.has(e)?xu.get(e):_u(e)===Object.prototype||_u(e)===Array.prototype),Cu=e=>"object"==typeof e&&null!==e,Su=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(e=>{e.configurable=!0}),Object.create(_u(e),t)},Tu=(e,t)=>{const n={[yu]:t};let r=!1;const o=(t,o)=>{if(!r){let r=n[vu].get(e);if(r||(r={},n[vu].set(e,r)),t===Eu)r[Eu]=!0;else{let e=r[t];e||(e=new Set,r[t]=e),e.add(o)}}},i={get:(t,r)=>r===mu?e:(o("k",r),Au(Reflect.get(t,r),n[vu],n.c,n.t)),has:(t,i)=>i===gu?(r=!0,n[vu].delete(e),!0):(o("h",i),Reflect.has(t,i)),getOwnPropertyDescriptor:(e,t)=>(o("o",t),Reflect.getOwnPropertyDescriptor(e,t)),ownKeys:e=>(o(Eu),Reflect.ownKeys(e))};return t&&(i.set=i.deleteProperty=()=>!1),[i,n]},Du=e=>e[mu]||e,Au=(e,t,n,r)=>{if(!ku(e))return e;let o=r&&r.get(e);if(!o){const t=Du(e);o=(e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(e=>!e.configurable&&!e.writable))(t)?[t,Su(t)]:[t],null==r||r.set(e,o)}const[i,a]=o;let s=n&&n.get(i);return s&&s[1].f===!!a||(s=Tu(i,!!a),s[1].p=((e,t)=>new Proxy(e,t))(a||i,s[0]),n&&n.set(i,s)),s[1][vu]=t,s[1].c=n,s[1].t=r,s[1].p},Ou=(e,t,n,r,o=Object.is)=>{if(o(e,t))return!1;if(!Cu(e)||!Cu(t))return!0;const i=n.get(Du(e));if(!i)return!0;if(r){const n=r.get(e);if(n&&n.n===t)return n.g;r.set(e,{[bu]:t,[wu]:!1})}let a=null;try{for(const n of i.h||[])if(a=Reflect.has(e,n)!==Reflect.has(t,n),a)return a;if(!0===i[Eu]){if(a=((e,t)=>{const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some((e,t)=>e!==r[t])})(e,t),a)return a}else for(const n of i.o||[]){const r=!!Reflect.getOwnPropertyDescriptor(e,n);if(a=r!==!!Reflect.getOwnPropertyDescriptor(t,n),a)return a}for(const s of i.k||[])if(a=Ou(e[s],t[s],n,r,o),a)return a;return null===a&&(a=!0),a}finally{r&&r.set(e,{[bu]:t,[wu]:a})}},Pu=(e,t=!0)=>{xu.set(e,t)},Iu=new Map,Nu=e=>{const t=Iu.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},Ru=(e,t={})=>(n,r,o)=>{const{enabled:i,anonymousActionType:a,store:s,...l}=t;let u;try{u=(null!=i?i:"production"!==(import.meta.env?import.meta.env.MODE:void 0))&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(e){}if(!u)return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&i&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,o);const{connection:c,...d}=((e,t,n)=>{if(void 0===e)return{type:"untracked",connection:t.connect(n)};const r=Iu.get(n.name);if(r)return{type:"tracked",store:e,...r};const o={connection:t.connect(n),stores:{}};return Iu.set(n.name,o),{type:"tracked",store:e,...o}})(s,u,l);let p=!0;o.setState=(e,t,i)=>{const u=n(e,t);if(!p)return u;const d=void 0===i?{type:a||"anonymous"}:"string"==typeof i?{type:i}:i;return void 0===s?(null==c||c.send(d,r()),u):(null==c||c.send({...d,type:`${s}/${d.type}`},{...Nu(l.name),[s]:o.getState()}),u)};const f=(...e)=>{const t=p;p=!1,n(...e),p=t},h=e(o.setState,r,o);if("untracked"===d.type?null==c||c.init(h):(d.stores[d.store]=o,null==c||c.init(Object.fromEntries(Object.entries(d.stores).map(([e,t])=>[e,e===d.store?h:t.getState()])))),o.dispatchFromDevtools&&"function"==typeof o.dispatch){let e=!1;const t=o.dispatch;o.dispatch=(...n)=>{"production"===(import.meta.env?import.meta.env.MODE:void 0)||"__setState"!==n[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...n)}}return c.subscribe(e=>{var t;switch(e.type){case"ACTION":return"string"!=typeof e.payload?void console.error("[zustand devtools middleware] Unsupported action format"):Bu(e.payload,e=>{if("__setState"===e.type){if(void 0===s)return void f(e.state);1!==Object.keys(e.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format. \n When using \'store\' option in devtools(), the \'state\' should have only one key, which is a value of \'store\' that was passed in devtools(),\n and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }\n ');const t=e.state[s];if(null==t)return;return void(JSON.stringify(o.getState())!==JSON.stringify(t)&&f(t))}o.dispatchFromDevtools&&"function"==typeof o.dispatch&&o.dispatch(e)});case"DISPATCH":switch(e.payload.type){case"RESET":return f(h),void 0===s?null==c?void 0:c.init(o.getState()):null==c?void 0:c.init(Nu(l.name));case"COMMIT":return void 0===s?void(null==c||c.init(o.getState())):null==c?void 0:c.init(Nu(l.name));case"ROLLBACK":return Bu(e.state,e=>{if(void 0===s)return f(e),void(null==c||c.init(o.getState()));f(e[s]),null==c||c.init(Nu(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Bu(e.state,e=>{void 0!==s?JSON.stringify(o.getState())!==JSON.stringify(e[s])&&f(e[s]):f(e)});case"IMPORT_STATE":{const{nextLiftedState:n}=e.payload,r=null==(t=n.computedStates.slice(-1)[0])?void 0:t.state;if(!r)return;return f(void 0===s?r:r[s]),void(null==c||c.send(null,n))}case"PAUSE_RECORDING":return p=!p}return}}),h},Bu=(e,t)=>{let n;try{n=JSON.parse(e)}catch(e){console.error("[zustand devtools middleware] Could not parse the received json",e)}void 0!==n&&t(n)};function Fu(e,t){let n;try{n=e()}catch(e){return}const r={getItem:e=>{var t;const r=e=>null===e?null:JSON.parse(e,void 0),o=null!=(t=n.getItem(e))?t:null;return o instanceof Promise?o.then(r):r(o)},setItem:(e,t)=>n.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>n.removeItem(e)};return r}const Lu=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>Lu(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>Lu(t)(e)}}},Mu=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1;const s=new Set,l=new Set;let u;try{u=i.getStorage()}catch(e){}if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)},r,o);const c=Lu(i.serialize),d=()=>{const e=i.partialize({...r()});let t;const n=c({state:e,version:i.version}).then(e=>u.setItem(i.name,e)).catch(e=>{t=e});if(t)throw t;return n},p=o.setState;o.setState=(e,t)=>{p(e,t),d()};const f=e((...e)=>{n(...e),d()},r,o);let h;const g=()=>{var e;if(!u)return;a=!1,s.forEach(e=>e(r()));const t=(null==(e=i.onRehydrateStorage)?void 0:e.call(i,r()))||void 0;return Lu(u.getItem.bind(u))(i.name).then(e=>{if(e)return i.deserialize(e)}).then(e=>{if(e){if("number"!=typeof e.version||e.version===i.version)return e.state;if(i.migrate)return i.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return h=i.merge(e,null!=(t=r())?t:f),n(h,!0),d()}).then(()=>{null==t||t(h,void 0),a=!0,l.forEach(e=>e(h))}).catch(e=>{null==t||t(void 0,e)})};return o.persist={setOptions:e=>{i={...i,...e},e.getStorage&&(u=e.getStorage())},clearStorage:()=>{null==u||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>a,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},g(),h||f})(e,t)):((e,t)=>(n,r,o)=>{let i={storage:Fu(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1;const s=new Set,l=new Set;let u=i.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)},r,o);const c=()=>{const e=i.partialize({...r()});return u.setItem(i.name,{state:e,version:i.version})},d=o.setState;o.setState=(e,t)=>{d(e,t),c()};const p=e((...e)=>{n(...e),c()},r,o);let f;o.getInitialState=()=>p;const h=()=>{var e,t;if(!u)return;a=!1,s.forEach(e=>{var t;return e(null!=(t=r())?t:p)});const o=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,null!=(e=r())?e:p))||void 0;return Lu(u.getItem.bind(u))(i.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===i.version)return e.state;if(i.migrate)return i.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return f=i.merge(e,null!=(t=r())?t:p),n(f,!0),c()}).then(()=>{null==o||o(f,void 0),f=r(),a=!0,l.forEach(e=>e(f))}).catch(e=>{null==o||o(void 0,e)})};return o.persist={setOptions:e=>{i={...i,...e},e.storage&&(u=e.storage)},clearStorage:()=>{null==u||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>h(),hasHydrated:()=>a,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},i.skipHydration||h(),f||p})(e,t);var Uu,ju,$u,zu={exports:{}},Hu={},Vu={exports:{}},Wu={};function qu(){return ju||(ju=1,Vu.exports=function(){if(Uu)return Wu;Uu=1;var e=Ta,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var s=t(),l=n({inst:{value:s,getSnapshot:t}}),u=l[0].inst,c=l[1];return o(function(){u.value=s,u.getSnapshot=t,a(u)&&c({inst:u})},[e,s,t]),r(function(){return a(u)&&c({inst:u}),e(function(){a(u)&&c({inst:u})})},[e]),i(s),s};return Wu.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,Wu}()),Vu.exports}
4
+ /**
5
+ * @license React
6
+ * use-sync-external-store-shim/with-selector.production.js
7
+ *
8
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */zu.exports=function(){if($u)return Hu;$u=1;var e=Ta,t=qu(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,s=e.useDebugValue;return Hu.useSyncExternalStoreWithSelector=function(e,t,l,u,c){var d=o(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=a(function(){function e(e){if(!i){if(i=!0,r=e,e=u(e),void 0!==c&&p.hasValue){var t=p.value;if(c(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var a=u(e);return void 0!==c&&c(t,a)?(r=e,t):(r=e,o=a)}var r,o,i=!1,a=void 0===l?null:l;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]},[t,l,u,c]);var f=r(e,d[0],d[1]);return i(function(){p.hasValue=!0,p.value=f},[f]),s(f),f},Hu}();var Gu=Bn(zu.exports);const Ku=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(r,o,i);return i},Yu=e=>e?Ku(e):Ku,{useDebugValue:Zu}=Da,{useSyncExternalStoreWithSelector:Xu}=Gu,Qu=e=>e;var Ju=Object.defineProperty,ec=Object.defineProperties,tc=Object.getOwnPropertyDescriptors,nc=Object.getOwnPropertySymbols,rc=Object.prototype.hasOwnProperty,oc=Object.prototype.propertyIsEnumerable,ic=(e,t,n)=>t in e?Ju(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ac=(e,t)=>{for(var n in t||(t={}))rc.call(t,n)&&ic(e,n,t[n]);if(nc)for(var n of nc(t))oc.call(t,n)&&ic(e,n,t[n]);return e},sc=(e,t)=>ec(e,tc(t)),lc=e=>(t,n,r)=>{const o=(e,n)=>t(au(e),!0,n);return r.setState=o,e(o,n,r)};var uc=e=>sc(ac({},e),{extendSelectors:t=>uc(((e,t)=>{const n=ac({},t.use),r=ac({},t.useTracked),o=ac({},t.get);return Object.keys(e(t.store.getState(),t.get,t)).forEach(i=>{n[i]=(...n)=>t.useStore(r=>(0,e(r,t.get,t)[i])(...n)),r[i]=(...n)=>{const r=t.useTrackedStore();return(0,e(r,t.get,t)[i])(...n)},o[i]=(...n)=>(0,e(t.store.getState(),t.get,t)[i])(...n)}),sc(ac({},t),{get:o,use:n,useTracked:r})})(t,e)),extendActions:t=>uc(((e,t)=>{const n=e(t.set,t.get,t);return sc(ac({},t),{set:ac(ac({},t.set),n)})})(t,e))}),cc=e=>(t,n={})=>{var r,o;const{middlewares:i=[],devtools:a,persist:s,immer:l}=n;su(null!=(r=null==l?void 0:l.enabledAutoFreeze)&&r),(null==l?void 0:l.enableMapSet)&&nu();const u=[lc,...i];if(null==s?void 0:s.enabled){const t=sc(ac({},s),{name:null!=(o=s.name)?o:e});u.push(e=>Mu(e,t))}(null==a?void 0:a.enabled)&&u.push(t=>Ru(t,sc(ac({},a),{name:e}))),u.push(Yu);const c=function(e,...t){return t.reduce((e,t)=>t(e),e)}(()=>t,...u);const d=(e,t)=>function(e,t=Qu,n){const r=Xu(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Zu(r),r}(c,e,t),p=((e,t)=>{const n={};return Object.keys(e.getState()).forEach(r=>{n[r]=n=>{if(e.getState()[r]===n)return;const o=r.replace(/^\S/,e=>e.toUpperCase());e.setState(e=>{e[r]=n},`@@${t}/set${o}`)}}),n})(c,e),f=((e,t)=>{const n={};return Object.keys(t.getState()).forEach(t=>{n[t]=n=>e(e=>e[t],n)}),n})(d,c),h=(e=>{const t={};return Object.keys(e.getState()).forEach(n=>{t[n]=()=>e.getState()[n]}),t})(c),g=(m=d,()=>{const[,e]=Ta.useReducer(e=>e+1,0),t=new WeakMap,n=Ta.useRef(),r=Ta.useRef(),o=Ta.useRef();Ta.useEffect(()=>{n.current=t,r.current!==o.current&&Ou(r.current,o.current,t,new WeakMap)&&(r.current=o.current,e())});const i=Ta.useCallback(e=>(o.current=e,r.current&&r.current!==e&&n.current&&!Ou(r.current,e,n.current,new WeakMap)?r.current:(r.current=e,e)),[]),a=m(i),s=Ta.useMemo(()=>new WeakMap,[]);return Au(a,t,s)});var m;const v=((e,t)=>{const n={};return Object.keys(t.getState()).forEach(t=>{n[t]=()=>e()[t]}),n})(g,c),y={get:ac({state:c.getState},h),name:e,set:ac({state:(t,n)=>{c.setState(t,n||`@@${e}/setState`)},mergeState:(t,n)=>{c.setState(e=>{Object.assign(e,t)},n||`@@${e}/mergeState`)}},p),store:c,use:f,useTracked:v,useStore:d,useTrackedStore:g,extendSelectors:()=>y,extendActions:()=>y};return uc(y)},dc={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Ec.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},pc={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=wd.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},fc={transform(e,t){var{current:n,affinity:r}=e;if(null!=n){var o=Dc.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},hc=new WeakMap,gc=new WeakMap,mc=new WeakMap,vc=new WeakMap,yc=new WeakMap,bc=new WeakMap,wc=new WeakMap,Ec={ancestors(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=Ec.levels(e,t);return r=n?r.slice(1):r.slice(0,-1)},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var o=e[r];if(o!==t[r])break;n.push(o)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return Ec.equals(r,o)&&i>a},endsAt(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return Ec.equals(r,o)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return Ec.equals(r,o)&&i<a},equals:(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),hasPrevious:e=>e[e.length-1]>0,isAfter:(e,t)=>1===Ec.compare(e,t),isAncestor:(e,t)=>e.length<t.length&&0===Ec.compare(e,t),isBefore:(e,t)=>-1===Ec.compare(e,t),isChild:(e,t)=>e.length===t.length+1&&0===Ec.compare(e,t),isCommon:(e,t)=>e.length<=t.length&&0===Ec.compare(e,t),isDescendant:(e,t)=>e.length>t.length&&0===Ec.compare(e,t),isParent:(e,t)=>e.length+1===t.length&&0===Ec.compare(e,t),isPath:e=>Array.isArray(e)&&e.every(e=>"number"==typeof e),isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&Ec.equals(n,r)},levels(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative(e,t){if(!Ec.isAncestor(t,e)&&!Ec.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:o="forward"}=n;if(0===e.length)return r;switch(t.type){case"insert_node":var{path:i}=t;(Ec.equals(i,r)||Ec.endsBefore(i,r)||Ec.isAncestor(i,r))&&(r[i.length-1]+=1);break;case"remove_node":var{path:a}=t;if(Ec.equals(a,r)||Ec.isAncestor(a,r))return null;Ec.endsBefore(a,r)&&(r[a.length-1]-=1);break;case"merge_node":var{path:s,position:l}=t;Ec.equals(s,r)||Ec.endsBefore(s,r)?r[s.length-1]-=1:Ec.isAncestor(s,r)&&(r[s.length-1]-=1,r[s.length]+=l);break;case"split_node":var{path:u,position:c}=t;if(Ec.equals(u,r)){if("forward"===o)r[r.length-1]+=1;else if("backward"!==o)return null}else Ec.endsBefore(u,r)?r[u.length-1]+=1:Ec.isAncestor(u,r)&&e[u.length]>=c&&(r[u.length-1]+=1,r[u.length]-=c);break;case"move_node":var{path:d,newPath:p}=t;if(Ec.equals(d,p))return r;if(Ec.isAncestor(d,r)||Ec.equals(d,r)){var f=p.slice();return Ec.endsBefore(d,p)&&d.length<p.length&&(f[d.length-1]-=1),f.concat(r.slice(d.length))}Ec.isSibling(d,p)&&(Ec.isAncestor(p,r)||Ec.equals(p,r))?Ec.endsBefore(d,r)?r[d.length-1]-=1:r[d.length-1]+=1:Ec.endsBefore(p,r)||Ec.equals(p,r)||Ec.isAncestor(p,r)?(Ec.endsBefore(d,r)&&(r[d.length-1]-=1),r[p.length-1]+=1):Ec.endsBefore(d,r)&&(Ec.equals(p,r)&&(r[p.length-1]+=1),r[d.length-1]-=1)}return r}};function _c(e){return _c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_c(e)}function xc(e){var t=function(e,t){if("object"!==_c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==_c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===_c(t)?t:String(t)}function kc(e,t,n){return(t=xc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cc(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Sc=["anchor","focus"];function Tc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var Dc={edges(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{reverse:n=!1}=t,{anchor:r,focus:o}=e;return Dc.isBackward(e)===n?[r,o]:[o,r]},end(e){var[,t]=Dc.edges(e);return t},equals:(e,t)=>wd.equals(e.anchor,t.anchor)&&wd.equals(e.focus,t.focus),surrounds(e,t){var n=Dc.intersection(e,t);return!!n&&Dc.equals(n,t)},includes(e,t){if(vd.isRange(t)){if(Dc.includes(e,t.anchor)||Dc.includes(e,t.focus))return!0;var[n,r]=Dc.edges(e),[o,i]=Dc.edges(t);return wd.isBefore(n,o)&&wd.isAfter(r,i)}var[a,s]=Dc.edges(e),l=!1,u=!1;return vd.isPoint(t)?(l=wd.compare(t,a)>=0,u=wd.compare(t,s)<=0):(l=Ec.compare(t,a.path)>=0,u=Ec.compare(t,s.path)<=0),l&&u},intersection(e,t){var n=Cc(e,Sc),[r,o]=Dc.edges(e),[i,a]=Dc.edges(t),s=wd.isBefore(r,i)?i:r,l=wd.isBefore(o,a)?o:a;return wd.isBefore(l,s)?null:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tc(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({anchor:s,focus:l},n)},isBackward(e){var{anchor:t,focus:n}=e;return wd.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return wd.equals(t,n)},isExpanded:e=>!Dc.isCollapsed(e),isForward:e=>!Dc.isBackward(e),isRange:e=>jc(e)&&wd.isPoint(e.anchor)&&wd.isPoint(e.focus),*points(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start(e){var[t]=Dc.edges(e);return t},transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var r,o,{affinity:i="inward"}=n;if("inward"===i){var a=Dc.isCollapsed(e);Dc.isForward(e)?(r="forward",o=a?r:"backward"):(r="backward",o=a?r:"forward")}else"outward"===i?Dc.isForward(e)?(r="backward",o="forward"):(r="forward",o="backward"):(r=i,o=i);var s=wd.transform(e.anchor,t,{affinity:r}),l=wd.transform(e.focus,t,{affinity:o});return s&&l?{anchor:s,focus:l}:null}},Ac=function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!jc(e)&&("function"!=typeof e.apply&&(t?Bc.isNodeList(e.children):Array.isArray(e.children)))},Oc={isAncestor(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return jc(e)&&Bc.isNodeList(e.children,{deep:t})},isElement:Ac,isElementList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>Oc.isElement(e,{deep:t}))},isElementProps:e=>void 0!==e.children,isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return Ac(e)&&e[n]===t},matches(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},Pc=["text"],Ic=["children"];function Nc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Rc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nc(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Bc={ancestor(e,t){var n=Bc.get(e,t);if(Bc.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(_d.stringify(n)));return n},ancestors(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of Ec.ancestors(t,n)){var o=[Bc.ancestor(e,r),r];yield o}}()},child(e,t){if(Bc.isText(e))throw new Error("Cannot get the child of a text node: ".concat(_d.stringify(e)));var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(_d.stringify(e)));return n},children(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,o=Bc.ancestor(e,t),{children:i}=o,a=r?i.length-1:0;r?a>=0:a<i.length;){var s=Bc.child(o,a),l=t.concat(a);yield[s,l],a=r?a-1:a+1}}()},common(e,t,n){var r=Ec.common(t,n);return[Bc.get(e,r),r]},descendant(e,t){var n=Bc.get(e,t);if(Bc.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(_d.stringify(n)));return n},descendants(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Bc.nodes(e,t))0!==r.length&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Bc.nodes(e,t))Bc.isElement(n)&&(yield[n,r])}()},extractProps:e=>Bc.isText(e)?Cc(e,Pc):Cc(e,Ic),first(e,t){for(var n=t.slice(),r=Bc.get(e,n);r&&!Bc.isText(r)&&0!==r.children.length;)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){var n={children:e.children},[r,o]=Dc.edges(t),i=Bc.nodes(n,{reverse:!0,pass:e=>{var[,n]=e;return!Dc.includes(t,n)}}),a=function(){if(!Dc.includes(t,s)){var e=s[s.length-1];Rd(n,Ec.parent(s),t=>Id(t,e,1))}Ec.equals(s,o.path)&&Bd(n,s,e=>{var t=e.text.slice(0,o.offset);return Rc(Rc({},e),{},{text:t})}),Ec.equals(s,r.path)&&Bd(n,s,e=>{var t=e.text.slice(r.offset);return Rc(Rc({},e),{},{text:t})})};for(var[,s]of i)a();return n.children},get(e,t){var n=Bc.getIf(e,t);if(void 0===n)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(_d.stringify(e)));return n},getIf(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(Bc.isText(n)||!n.children[o])return;n=n.children[o]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if(Bc.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isAncestor:e=>!Bc.isText(e),isEditor:e=>"function"==typeof e.apply,isElement:e=>Array.isArray(e.children)&&"function"!=typeof e.apply,isNode(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Td.isText(e)||Oc.isElement(e,{deep:t})||md.isEditor(e,{deep:t})},isNodeList(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.every(e=>Bc.isNode(e,{deep:t}))},isText:e=>"string"==typeof e.text,last(e,t){for(var n=t.slice(),r=Bc.get(e,n);r&&!Bc.isText(r)&&0!==r.children.length;){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf(e,t){var n=Bc.get(e,t);if(!Bc.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(_d.stringify(n)));return n},levels(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r of Ec.levels(t,n)){var o=Bc.get(e,r);yield[o,r]}}()},matches:(e,t)=>Bc.isElement(e)&&Oc.isElementProps(t)&&Oc.matches(e,t)||Bc.isText(e)&&Td.isTextProps(t)&&Td.matches(e,t),nodes(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:o=[],to:i}=t,a=new Set,s=[],l=e;!i||!(r?Ec.isBefore(s,i):Ec.isAfter(s,i));)if(a.has(l)||(yield[l,s]),a.has(l)||Bc.isText(l)||0===l.children.length||null!=n&&!1!==n([l,s])){if(0===s.length)break;if(!r){var u=Ec.next(s);if(Bc.has(e,u)){s=u,l=Bc.get(e,s);continue}}if(r&&0!==s[s.length-1])s=Ec.previous(s),l=Bc.get(e,s);else s=Ec.parent(s),l=Bc.get(e,s),a.add(l)}else{a.add(l);var c=r?l.children.length-1:0;Ec.isAncestor(s,o)&&(c=o[s.length]),s=s.concat(c),l=Bc.get(e,s)}}()},parent(e,t){var n=Ec.parent(t),r=Bc.get(e,n);if(Bc.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string:e=>Bc.isText(e)?e.text:e.children.map(Bc.string).join(""),texts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var[n,r]of Bc.nodes(e,t))Bc.isText(n)&&(yield[n,r])}()}};function Fc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fc(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Mc,Uc={isNodeOperation:e=>Uc.isOperation(e)&&e.type.endsWith("_node"),isOperation(e){if(!jc(e))return!1;switch(e.type){case"insert_node":case"remove_node":return Ec.isPath(e.path)&&Bc.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&Ec.isPath(e.path);case"merge_node":return"number"==typeof e.position&&Ec.isPath(e.path)&&jc(e.properties);case"move_node":return Ec.isPath(e.path)&&Ec.isPath(e.newPath);case"set_node":return Ec.isPath(e.path)&&jc(e.properties)&&jc(e.newProperties);case"set_selection":return null===e.properties&&Dc.isRange(e.newProperties)||null===e.newProperties&&Dc.isRange(e.properties)||jc(e.properties)&&jc(e.newProperties);case"split_node":return Ec.isPath(e.path)&&"number"==typeof e.position&&jc(e.properties);default:return!1}},isOperationList:e=>Array.isArray(e)&&e.every(e=>Uc.isOperation(e)),isSelectionOperation:e=>Uc.isOperation(e)&&e.type.endsWith("_selection"),isTextOperation:e=>Uc.isOperation(e)&&e.type.endsWith("_text"),inverse(e){switch(e.type){case"insert_node":return Lc(Lc({},e),{},{type:"remove_node"});case"insert_text":return Lc(Lc({},e),{},{type:"remove_text"});case"merge_node":return Lc(Lc({},e),{},{type:"split_node",path:Ec.previous(e.path)});case"move_node":var{newPath:t,path:n}=e;if(Ec.equals(t,n))return e;if(Ec.isSibling(n,t))return Lc(Lc({},e),{},{path:t,newPath:n});var r=Ec.transform(n,e),o=Ec.transform(Ec.next(n),e);return Lc(Lc({},e),{},{path:r,newPath:o});case"remove_node":return Lc(Lc({},e),{},{type:"insert_node"});case"remove_text":return Lc(Lc({},e),{},{type:"insert_text"});case"set_node":var{properties:i,newProperties:a}=e;return Lc(Lc({},e),{},{properties:a,newProperties:i});case"set_selection":var{properties:s,newProperties:l}=e;return Lc(Lc({},e),{},null==s?{properties:l,newProperties:null}:null==l?{properties:null,newProperties:s}:{properties:l,newProperties:s});case"split_node":return Lc(Lc({},e),{},{type:"merge_node",path:Ec.next(e.path)})}}},jc=e=>"object"==typeof e&&null!==e,$c=(e,t)=>{for(var n in e){var r=e[n],o=t[n];if(Array.isArray(r)&&Array.isArray(o)){if(r.length!==o.length)return!1;for(var i=0;i<r.length;i++)if(r[i]!==o[i])return!1}else if(jc(r)&&jc(o)){if(!$c(r,o))return!1}else if(r!==o)return!1}for(var a in t)if(void 0===e[a]&&void 0!==t[a])return!1;return!0},zc=e=>e.selection?e.selection:e.children.length>0?md.end(e,[]):[0],Hc=(e,t)=>{var[n]=md.node(e,t);return e=>e===n},Vc=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!t,r=t?Zc(e):e,o=Mc.None,i=Mc.None,a=0,s=null;for(var l of r){var u=l.codePointAt(0);if(!u)break;var c=ld(l,u);if([o,i]=n?[i,c]:[c,o],ud(o,Mc.ZWJ)&&ud(i,Mc.ExtPict)&&!fd(n?e.substring(0,a):e.substring(0,e.length-a)))break;if(ud(o,Mc.RI)&&ud(i,Mc.RI)&&!(s=null!==s?!s:!!n||gd(e.substring(0,e.length-a))))break;if(o!==Mc.None&&i!==Mc.None&&dd(o,i))break;a+=l.length}return a||1},Wc=/\s/,qc=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,Gc=/['\u2018\u2019]/,Kc=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},Yc=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Wc.test(t))return!1;if(Gc.test(t)){var o=Vc(n,r),[i,a]=Kc(n,o,r);if(e(i,a,r))return!0}return!qc.test(t)},Zc=function*(e){for(var t=e.length-1,n=0;n<e.length;n++){var r=e.charAt(t-n);if(Qc(r.charCodeAt(0))){var o=e.charAt(t-n-1);if(Xc(o.charCodeAt(0))){yield o+r,n++;continue}}yield r}},Xc=e=>e>=55296&&e<=56319,Qc=e=>e>=56320&&e<=57343;!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(Mc||(Mc={}));var Jc=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,ed=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,td=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,nd=/^[\u1100-\u115F\uA960-\uA97C]$/,rd=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,od=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,id=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,ad=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,sd=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,ld=(e,t)=>{var n=Mc.Any;return-1!==e.search(Jc)&&(n|=Mc.Extend),8205===t&&(n|=Mc.ZWJ),t>=127462&&t<=127487&&(n|=Mc.RI),-1!==e.search(ed)&&(n|=Mc.Prepend),-1!==e.search(td)&&(n|=Mc.SpacingMark),-1!==e.search(nd)&&(n|=Mc.L),-1!==e.search(rd)&&(n|=Mc.V),-1!==e.search(od)&&(n|=Mc.T),-1!==e.search(id)&&(n|=Mc.LV),-1!==e.search(ad)&&(n|=Mc.LVT),-1!==e.search(sd)&&(n|=Mc.ExtPict),n};function ud(e,t){return 0!==(e&t)}var cd=[[Mc.L,Mc.L|Mc.V|Mc.LV|Mc.LVT],[Mc.LV|Mc.V,Mc.V|Mc.T],[Mc.LVT|Mc.T,Mc.T],[Mc.Any,Mc.Extend|Mc.ZWJ],[Mc.Any,Mc.SpacingMark],[Mc.Prepend,Mc.Any],[Mc.ZWJ,Mc.ExtPict],[Mc.RI,Mc.RI]];function dd(e,t){return-1===cd.findIndex(n=>ud(e,n[0])&&ud(t,n[1]))}var pd=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,fd=e=>-1!==e.search(pd),hd=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,gd=e=>{var t=e.match(hd);return null!==t&&t[0].length/2%2==1},md={above:(e,t)=>e.above(t),addMark(e,t,n){e.addMark(t,n)},after:(e,t,n)=>e.after(t,n),before:(e,t,n)=>e.before(t,n),deleteBackward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteBackward(n)},deleteForward(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{unit:n="character"}=t;e.deleteForward(n)},deleteFragment(e,t){e.deleteFragment(t)},edges:(e,t)=>e.edges(t),elementReadOnly(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:(e,t)=>e.end(t),first:(e,t)=>e.first(t),fragment:(e,t)=>e.fragment(t),hasBlocks:(e,t)=>e.hasBlocks(t),hasInlines:(e,t)=>e.hasInlines(t),hasPath:(e,t)=>e.hasPath(t),hasTexts:(e,t)=>e.hasTexts(t),insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock:(e,t)=>e.isBlock(t),isEdge:(e,t,n)=>e.isEdge(t,n),isEditor:function(e){var{deep:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!jc(e))return!1;var n="function"==typeof e.above&&"function"==typeof e.addMark&&"function"==typeof e.after&&"function"==typeof e.apply&&"function"==typeof e.before&&"function"==typeof e.collapse&&"function"==typeof e.delete&&"function"==typeof e.deleteBackward&&"function"==typeof e.deleteForward&&"function"==typeof e.deleteFragment&&"function"==typeof e.deselect&&"function"==typeof e.edges&&"function"==typeof e.elementReadOnly&&"function"==typeof e.end&&"function"==typeof e.first&&"function"==typeof e.fragment&&"function"==typeof e.getDirtyPaths&&"function"==typeof e.getFragment&&"function"==typeof e.getMarks&&"function"==typeof e.hasBlocks&&"function"==typeof e.hasInlines&&"function"==typeof e.hasPath&&"function"==typeof e.hasTexts&&"function"==typeof e.insertBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertNodes&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertText&&"function"==typeof e.isBlock&&"function"==typeof e.isEdge&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isEmpty&&"function"==typeof e.isEnd&&"function"==typeof e.isInline&&"function"==typeof e.isNormalizing&&"function"==typeof e.isSelectable&&"function"==typeof e.isStart&&"function"==typeof e.isVoid&&"function"==typeof e.last&&"function"==typeof e.leaf&&"function"==typeof e.levels&&"function"==typeof e.liftNodes&&"function"==typeof e.markableVoid&&"function"==typeof e.mergeNodes&&"function"==typeof e.move&&"function"==typeof e.moveNodes&&"function"==typeof e.next&&"function"==typeof e.node&&"function"==typeof e.nodes&&"function"==typeof e.normalize&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.parent&&"function"==typeof e.path&&"function"==typeof e.pathRef&&"function"==typeof e.pathRefs&&"function"==typeof e.point&&"function"==typeof e.pointRef&&"function"==typeof e.pointRefs&&"function"==typeof e.positions&&"function"==typeof e.previous&&"function"==typeof e.range&&"function"==typeof e.rangeRef&&"function"==typeof e.rangeRefs&&"function"==typeof e.removeMark&&"function"==typeof e.removeNodes&&"function"==typeof e.select&&"function"==typeof e.setNodes&&"function"==typeof e.setNormalizing&&"function"==typeof e.setPoint&&"function"==typeof e.setSelection&&"function"==typeof e.shouldMergeNodesRemovePrevNode&&"function"==typeof e.shouldNormalize&&"function"==typeof e.splitNodes&&"function"==typeof e.start&&"function"==typeof e.string&&"function"==typeof e.unhangRange&&"function"==typeof e.unsetNodes&&"function"==typeof e.unwrapNodes&&"function"==typeof e.void&&"function"==typeof e.withoutNormalizing&&"function"==typeof e.wrapNodes&&(null===e.marks||jc(e.marks))&&(null===e.selection||Dc.isRange(e.selection))&&(t?Bc.isNodeList(e.children)&&Uc.isOperationList(e.operations):Array.isArray(e.children)&&Array.isArray(e.operations));return n},isElementReadOnly:(e,t)=>e.isElementReadOnly(t),isEmpty:(e,t)=>e.isEmpty(t),isEnd:(e,t,n)=>e.isEnd(t,n),isInline:(e,t)=>e.isInline(t),isNormalizing:e=>e.isNormalizing(),isSelectable:(e,t)=>e.isSelectable(t),isStart:(e,t,n)=>e.isStart(t,n),isVoid:(e,t)=>e.isVoid(t),last:(e,t)=>e.last(t),leaf:(e,t,n)=>e.leaf(t,n),levels:(e,t)=>e.levels(t),marks:e=>e.getMarks(),next:(e,t)=>e.next(t),node:(e,t,n)=>e.node(t,n),nodes:(e,t)=>e.nodes(t),normalize(e,t){e.normalize(t)},parent:(e,t,n)=>e.parent(t,n),path:(e,t,n)=>e.path(t,n),pathRef:(e,t,n)=>e.pathRef(t,n),pathRefs:e=>e.pathRefs(),point:(e,t,n)=>e.point(t,n),pointRef:(e,t,n)=>e.pointRef(t,n),pointRefs:e=>e.pointRefs(),positions:(e,t)=>e.positions(t),previous:(e,t)=>e.previous(t),range:(e,t,n)=>e.range(t,n),rangeRef:(e,t,n)=>e.rangeRef(t,n),rangeRefs:e=>e.rangeRefs(),removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start:(e,t)=>e.start(t),string:(e,t,n)=>e.string(t,n),unhangRange:(e,t,n)=>e.unhangRange(t,n),void:(e,t)=>e.void(t),withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,n)=>e.shouldMergeNodesRemovePrevNode(t,n)},vd={isLocation:e=>Ec.isPath(e)||wd.isPoint(e)||Dc.isRange(e),isPath:e=>Array.isArray(e),isPoint:e=>"offset"in e,isRange:e=>"anchor"in e,isSpan:e=>Array.isArray(e)&&Array.isArray(e[0])};function yd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yd(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var wd={compare(e,t){var n=Ec.compare(e.path,t.path);return 0===n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:(e,t)=>1===wd.compare(e,t),isBefore:(e,t)=>-1===wd.compare(e,t),equals:(e,t)=>e.offset===t.offset&&Ec.equals(e.path,t.path),isPoint:e=>jc(e)&&"number"==typeof e.offset&&Ec.isPath(e.path),transform(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var{affinity:r="forward"}=n,{path:o,offset:i}=e;switch(t.type){case"insert_node":case"move_node":o=Ec.transform(o,t,n);break;case"insert_text":Ec.equals(t.path,o)&&(t.offset<i||t.offset===i&&"forward"===r)&&(i+=t.text.length);break;case"merge_node":Ec.equals(t.path,o)&&(i+=t.position),o=Ec.transform(o,t,n);break;case"remove_text":Ec.equals(t.path,o)&&t.offset<=i&&(i-=Math.min(i-t.offset,t.text.length));break;case"remove_node":if(Ec.equals(t.path,o)||Ec.isAncestor(t.path,o))return null;o=Ec.transform(o,t,n);break;case"split_node":if(Ec.equals(t.path,o)){if(t.position===i&&null==r)return null;(t.position<i||t.position===i&&"forward"===r)&&(i-=t.position,o=Ec.transform(o,t,bd(bd({},n),{},{affinity:"forward"})))}else o=Ec.transform(o,t,n);break;default:return e}return{path:o,offset:i}}},Ed=void 0,_d={setScrubber(e){Ed=e},stringify:e=>JSON.stringify(e,Ed)},xd=["text"],kd=["anchor","focus","merge"];function Cd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Sd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cd(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Td={equals(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{loose:r=!1}=n;function o(e){return Cc(e,xd)}return $c(r?o(e):e,r?o(t):t)},isText:e=>jc(e)&&"string"==typeof e.text,isTextList:e=>Array.isArray(e)&&e.every(e=>Td.isText(e)),isTextProps:e=>void 0!==e.text,matches(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[{leaf:Sd({},e)}];for(var r of t){var{anchor:o,focus:i,merge:a}=r,s=Cc(r,kd),[l,u]=Dc.edges(r),c=[],d=0,p=l.offset,f=u.offset,h=null!=a?a:Object.assign;for(var{leaf:g}of n){var{length:m}=g.text,v=d;if(d+=m,p<=v&&d<=f)h(g,s),c.push({leaf:g});else if(p!==f&&(p===d||f===v)||p>d||f<v||f===v&&0!==v)c.push({leaf:g});else{var y=g,b=void 0,w=void 0;if(f<d){var E=f-v;w={leaf:Sd(Sd({},y),{},{text:y.text.slice(E)})},y=Sd(Sd({},y),{},{text:y.text.slice(0,E)})}if(p>v){var _=p-v;b={leaf:Sd(Sd({},y),{},{text:y.text.slice(0,_)})},y=Sd(Sd({},y),{},{text:y.text.slice(_)})}h(y,s),b&&c.push(b),c.push({leaf:y}),w&&c.push(w)}}n=c}if(n.length>1){var x=0;for(var[k,C]of n.entries()){var S=x,T=S+C.leaf.text.length,D={start:S,end:T};0===k&&(D.isFirst=!0),k===n.length-1&&(D.isLast=!0),C.position=D,x=T}}return n}};function Dd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ad(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dd(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Od=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return[...e.slice(0,t),...r,...e.slice(t)]},Pd=function(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];return[...e.slice(0,t),...o,...e.slice(t+n)]},Id=Pd,Nd=(e,t,n)=>{if(0===t.length)throw new Error("Cannot modify the editor");for(var r=Bc.get(e,t),o=t.slice(),i=n(r);o.length>1;){var a=o.pop(),s=Bc.get(e,o);i=Ad(Ad({},s),{},{children:Pd(s.children,a,1,i)})}var l=o.pop();e.children=Pd(e.children,l,1,i)},Rd=(e,t,n)=>{0===t.length?e.children=n(e.children):Nd(e,t,e=>{if(Bc.isText(e))throw new Error("Cannot get the element at path [".concat(t,"] because it refers to a leaf node: ").concat(_d.stringify(e)));return Ad(Ad({},e),{},{children:n(e.children)})})},Bd=(e,t,n)=>Nd(e,t,e=>{if(!Bc.isText(e))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(_d.stringify(e)));return n(e)});function Fd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ld(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fd(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Md={transform(e,t){var n=!1;switch(t.type){case"insert_node":var{path:r,node:o}=t;Rd(e,Ec.parent(r),e=>{var t=r[r.length-1];if(t>e.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));return Od(e,t,o)}),n=!0;break;case"insert_text":var{path:i,offset:a,text:s}=t;if(0===s.length)break;Bd(e,i,e=>{var t=e.text.slice(0,a),n=e.text.slice(a);return Ld(Ld({},e),{},{text:t+s+n})}),n=!0;break;case"merge_node":var{path:l}=t,u=l[l.length-1],c=Ec.previous(l),d=c[c.length-1];Rd(e,Ec.parent(l),e=>{var t,n=e[u],r=e[d];if(Bc.isText(n)&&Bc.isText(r))t=Ld(Ld({},r),{},{text:r.text+n.text});else{if(!Bc.isElement(n)||!Bc.isElement(r))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(l,"] to nodes of different interfaces: ").concat(_d.stringify(n)," ").concat(_d.stringify(r)));t=Ld(Ld({},r),{},{children:r.children.concat(n.children)})}return Pd(e,d,2,t)}),n=!0;break;case"move_node":var{path:p,newPath:f}=t,h=p[p.length-1];if(Ec.isAncestor(p,f))throw new Error("Cannot move a path [".concat(p,"] to new path [").concat(f,"] because the destination is inside itself."));var g=Bc.get(e,p);Rd(e,Ec.parent(p),e=>Id(e,h,1));var m=Ec.transform(p,t),v=m[m.length-1];Rd(e,Ec.parent(m),e=>Od(e,v,g)),n=!0;break;case"remove_node":var{path:y}=t,b=y[y.length-1];if(Rd(e,Ec.parent(y),e=>Id(e,b,1)),e.selection){var w=Ld({},e.selection);for(var[E,_]of Dc.points(w)){var x=wd.transform(E,t);if(null!=w&&null!=x)w[_]=x;else{var k=void 0,C=void 0;for(var[S,T]of Bc.texts(e)){if(-1!==Ec.compare(T,y)){C=[S,T];break}k=[S,T]}var D=!1;k&&C&&(D=!Ec.isSibling(k[1],y)&&(!!Ec.equals(C[1],y)||Ec.common(k[1],y).length<Ec.common(C[1],y).length)),k&&!D?w[_]={path:k[1],offset:k[0].text.length}:C?w[_]={path:C[1],offset:0}:w=null}}w&&Dc.equals(w,e.selection)||(e.selection=w)}break;case"remove_text":var{path:A,offset:O,text:P}=t;if(0===P.length)break;Bd(e,A,e=>{var t=e.text.slice(0,O),n=e.text.slice(O+P.length);return Ld(Ld({},e),{},{text:t+n})}),n=!0;break;case"set_node":var{path:I,properties:N,newProperties:R}=t;if(0===I.length)throw new Error("Cannot set properties on the root node!");Nd(e,I,e=>{var t=Ld({},e);for(var n in R){if("children"===n||"text"===n)throw new Error('Cannot set the "'.concat(n,'" property of nodes!'));var r=R[n];null==r?delete t[n]:t[n]=r}for(var o in N)R.hasOwnProperty(o)||delete t[o];return t});break;case"set_selection":var{newProperties:B}=t;if(null==B){e.selection=null;break}if(null==e.selection){if(!B.anchor||!B.focus)throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(_d.stringify(B)," when there is no current selection."));e.selection=Ld({},B);break}var F=Ld({},e.selection);for(var L in B){var M=B[L];if(null==M){if("anchor"===L||"focus"===L)throw new Error('Cannot remove the "'.concat(L,'" selection property'));delete F[L]}else F[L]=M}e.selection=F;break;case"split_node":var{path:U,position:j,properties:$}=t,z=U[U.length-1];if(0===U.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(U,"] because the root node cannot be split."));Rd(e,Ec.parent(U),e=>{var t,n,r=e[z];if(Bc.isText(r)){var o=r.text.slice(0,j),i=r.text.slice(j);t=Ld(Ld({},r),{},{text:o}),n=Ld(Ld({},$),{},{text:i})}else{var a=r.children.slice(0,j),s=r.children.slice(j);t=Ld(Ld({},r),{},{children:a}),n=Ld(Ld({},$),{},{children:s})}return Pd(e,z,1,t,n)}),n=!0}if(n&&e.selection){var H=Ld({},e.selection);for(var[V,W]of Dc.points(H))H[W]=wd.transform(V,t);Dc.equals(H,e.selection)||(e.selection=H)}}},Ud={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},jd={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},$d={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};md.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:o=zc(e)}=n;if(vd.isPath(o)&&(o=md.range(e,o)),vd.isRange(o))if(Dc.isCollapsed(o))o=o.anchor;else{var i=Dc.end(o);if(!r&&md.void(e,{at:i}))return;var a=Dc.start(o),s=md.pointRef(e,a),l=md.pointRef(e,i);Vd.delete(e,{at:o,voids:r});var u=s.unref(),c=l.unref();o=u||c,Vd.setSelection(e,{anchor:o,focus:o})}if(!(!r&&md.void(e,{at:o})||md.elementReadOnly(e,{at:o}))){var{path:d,offset:p}=o;t.length>0&&e.apply({type:"insert_text",path:d,offset:p,text:t})}})}};function zd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zd(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Vd=Hd(Hd(Hd(Hd({},Md),Ud),jd),$d),Wd=new WeakMap;function qd(e,t,n){var r,o,i=hc.get(e)||[],a=gc.get(e)||new Set,s=e=>{if(e){var t=e.join(",");o.has(t)||(o.add(t),r.push(e))}};if(n)for(var l of(r=[],o=new Set,i)){s(n(l))}else r=i,o=a;for(var u of t)s(u);hc.set(e,r),gc.set(e,o)}var Gd=(e,t)=>{for(var n of md.pathRefs(e))dc.transform(n,t);for(var r of md.pointRefs(e))pc.transform(r,t);for(var o of md.rangeRefs(e))fc.transform(o,t);if(!(e=>Wd.get(e)||!1)(e)){var i=Ec.operationCanTransformPath(t)?e=>Ec.transform(e,t):void 0;qd(e,e.getDirtyPaths(t),i)}Vd.transform(e,t),e.operations.push(t),md.normalize(e,{operation:t}),"set_selection"===t.type&&(e.marks=null),mc.get(e)||(mc.set(e,!0),Promise.resolve().then(()=>{mc.set(e,!1),e.onChange({operation:t}),e.operations=[]}))};function Kd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Yd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kd(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zd(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Qd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qd(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ep(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ep(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function np(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?np(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):np(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function op(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var ip=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r,marks:o}=e;if(r){if(o){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?op(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):op(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({text:t},o);Vd.insertNodes(e,i,{at:n.at,voids:n.voids})}else Vd.insertText(e,t,n);e.marks=null}};var ap=["text"],sp=["text"];var lp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{force:n=!1,operation:r}=t,o=e=>hc.get(e)||[],i=e=>{var t=o(e).pop(),n=t.join(",");return(e=>gc.get(e)||new Set)(e).delete(n),t};if(md.isNormalizing(e)){if(n){var a=Array.from(Bc.nodes(e),e=>{var[,t]=e;return t}),s=new Set(a.map(e=>e.join(",")));hc.set(e,a),gc.set(e,s)}0!==o(e).length&&md.withoutNormalizing(e,()=>{for(var t of o(e))if(Bc.has(e,t)){var n=md.node(e,t),[a,s]=n;Bc.isElement(a)&&0===a.children.length&&e.normalizeNode(n,{operation:r})}for(var l=o(e),u=l.length,c=0;0!==l.length;){if(!e.shouldNormalize({dirtyPaths:l,iteration:c,initialDirtyPathsLength:u,operation:r}))return;var d=i(e);if(Bc.has(e,d)){var p=md.node(e,d);e.normalizeNode(p,{operation:r})}c++,l=o(e)}})}};function up(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r="offset",reverse:o=!1,voids:i=!1}=t;if(n){var a=md.range(e,n),[s,l]=Dc.edges(a),u=o?l:s,c=!1,d="",p=0,f=0,h=0,g=[],m=function*(t){var n=g.some(e=>Ec.isAncestor(e,t));function*a(e){n||(yield e)}if(Bc.isElement(v)){if(!e.isSelectable(v)){if(g.push(t),o)return Ec.hasPrevious(t)&&(yield*a(md.end(e,Ec.previous(t)))),0;var m=Ec.next(t);return md.hasPath(e,m)&&(yield*a(md.start(e,m))),0}if(!i&&(e.isVoid(v)||e.isElementReadOnly(v)))return yield*a(md.start(e,t)),0;if(e.isInline(v))return 0;if(md.hasInlines(e,v)){var y=Ec.isAncestor(t,l.path)?l:md.end(e,t),w=Ec.isAncestor(t,s.path)?s:md.start(e,t);d=md.string(e,{anchor:w,focus:y},{voids:i}),c=!0}}if(Bc.isText(v)){var E=Ec.equals(t,u.path);for(E?(f=o?u.offset:v.text.length-u.offset,h=u.offset):(f=v.text.length,h=o?f:0),(E||c||"offset"===r)&&(yield*a({path:t,offset:h}),c=!1);;){if(0===p){if(""===d)break;p=b(d,r,o),d=Kc(d,p,o)[1]}if(h=o?h-p:h+p,(f-=p)<0){p=-f;break}p=0,yield*a({path:t,offset:h})}}};for(var[v,y]of md.nodes(e,{at:n,reverse:o,voids:i}))yield*m(y)}function b(e,t,n){return"character"===t?Vc(e,n):"word"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,r=!1;e.length>0;){var o=Vc(e,t),[i,a]=Kc(e,o,t);if(Yc(i,a,t))r=!0,n+=o;else{if(r)break;n+=o}e=a}return n}(e,n):"line"===t||"block"===t?e.length:1}}()}function cp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var dp=(e,t)=>{var{selection:n}=e;if(n){var r=(t,n)=>{if(!Bc.isText(t))return!1;var[r,o]=md.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},o=Dc.isExpanded(n),i=!1;if(!o){var[a,s]=md.node(e,n);if(a&&r(a,s)){var[l]=md.parent(e,s);i=l&&e.markableVoid(l)}}if(o||i)Vd.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var u=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cp(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},md.marks(e)||{});delete u[t],e.marks=u,mc.get(e)||e.onChange()}}},pp=(e,t)=>{var n=md.isNormalizing(e);md.setNormalizing(e,!1);try{t()}finally{md.setNormalizing(e,n)}md.normalize(e)};function fp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fp(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var gp=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};md.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1,mode:i="lowest",batchDirty:a=!0}=n,{at:s,match:l,select:u}=n;if(Bc.isNode(t)&&(t=[t]),0!==t.length){var[c]=t;if(s||(s=zc(e),!1!==u&&(u=!0)),null==u&&(u=!1),vd.isRange(s))if(r||(s=md.unhangRange(e,s,{voids:o})),Dc.isCollapsed(s))s=s.anchor;else{var[,d]=Dc.edges(s),p=md.pointRef(e,d);Vd.delete(e,{at:s}),s=p.unref()}if(vd.isPoint(s)){null==l&&(l=Bc.isText(c)?e=>Bc.isText(e):e.isInline(c)?t=>Bc.isText(t)||md.isInline(e,t):t=>Bc.isElement(t)&&md.isBlock(e,t));var[f]=md.nodes(e,{at:s.path,match:l,mode:i,voids:o});if(!f)return;var[,h]=f,g=md.pathRef(e,h),m=md.isEnd(e,s,h);Vd.splitNodes(e,{at:s,match:l,mode:i,voids:o});var v=g.unref();s=m?Ec.next(v):v}var y=Ec.parent(s),b=s[s.length-1];if(o||!md.void(e,{at:y})){if(a){var w=[],E=Ec.levels(y);((e,t,n)=>{var r=Wd.get(e)||!1;Wd.set(e,!0);try{t(),n()}finally{Wd.set(e,r)}})(e,()=>{var n=function(){var t=y.concat(b);b++;var n={type:"insert_node",path:t,node:r};e.apply(n),s=Ec.next(s),w.push(n),Bc.isText(r)?E.push(t):E.push(...Array.from(Bc.nodes(r),e=>{var[,n]=e;return t.concat(n)}))};for(var r of t)n()},()=>{qd(e,E,e=>{var t=e;for(var n of w)if(Ec.operationCanTransformPath(n)&&!(t=Ec.transform(t,n)))return null;return t})})}else for(var _ of t){var x=y.concat(b);b++,e.apply({type:"insert_node",path:x,node:_}),s=Ec.next(s)}if(s=Ec.previous(s),u){var k=md.end(e,s);k&&Vd.select(e,k)}}}})},mp=["text"],vp=["children"],yp=(e,t)=>t!==e&&(Bc.isText(t)||md.isVoid(e,t)||1===t.children.length&&yp(e,t.children[0])),bp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};md.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:r=!1,mode:o="lowest"}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=vd.isPath(i)?Hc(e,i):t=>Bc.isElement(t)&&md.isBlock(e,t)),!n&&vd.isRange(i)&&(i=md.unhangRange(e,i,{voids:r}));var s=md.nodes(e,{at:i,match:a,mode:o,voids:r}),l=Array.from(s,t=>{var[,n]=t;return md.pathRef(e,n)});for(var u of l){var c=u.unref();if(c){var[d]=md.node(e,c);e.apply({type:"remove_node",path:c,node:d})}}}})},wp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};md.withoutNormalizing(e,()=>{var{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection,height:a=0,always:s=!1}=t;if(i&&(null==o&&(o=t=>Bc.isElement(t)&&md.isBlock(e,t)),!vd.isRange(i)||(i=((e,t)=>{if(Dc.isCollapsed(t))return t.anchor;var[,n]=Dc.edges(t),r=md.pointRef(e,n);return Vd.delete(e,{at:t}),r.unref()})(e,i),i))){if(vd.isPath(i)){var l=i,u=md.point(e,l),[c]=md.parent(e,l);o=e=>e===c,a=u.path.length-l.length+1,i=u,s=!0}var d,p=md.pointRef(e,i,{affinity:"backward"});try{var[f]=md.nodes(e,{at:i,match:o,mode:n,voids:r});if(!f)return;var h=md.void(e,{at:i,mode:"highest"});if(!r&&h){var[g,m]=h;if(e.isInline(g)){var v=md.after(e,m);if(!v){var y=Ec.next(m);Vd.insertNodes(e,{text:""},{at:y,voids:r}),v=md.point(e,y)}i=v,s=!0}a=i.path.length-m.length+1,s=!0}d=md.pointRef(e,i);var b=i.path.length-a,[,w]=f,E=i.path.slice(0,b),_=0===a?i.offset:i.path[b]+0;for(var[x,k]of md.levels(e,{at:E,reverse:!0,voids:r})){var C=!1;if(k.length<w.length||0===k.length||!r&&Bc.isElement(x)&&md.isVoid(e,x))break;var S=p.current,T=md.isEnd(e,S,k);if(s||!p||!md.isEdge(e,S,k)){C=!0;var D=Bc.extractProps(x);e.apply({type:"split_node",path:k,position:_,properties:D})}_=k[k.length-1]+(C||T?1:0)}if(null==t.at){var A=d.current||md.end(e,[]);Vd.select(e,A)}}finally{var O;p.unref(),null===(O=d)||void 0===O||O.unref()}}})};function Ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ep(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ep(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var xp=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Gd(e,...n)},addMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var{selection:r}=e;if(r){var o=(t,n)=>{if(!Bc.isText(t))return!1;var[r,o]=md.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},i=Dc.isExpanded(r),a=!1;if(!i){var[s,l]=md.node(e,r);if(s&&o(s,l)){var[u]=md.parent(e,l);a=u&&e.markableVoid(u)}}if(i||a)Vd.setNodes(e,{[t]:n},{match:o,split:!0,voids:!0});else{var c=Yd(Yd({},md.marks(e)||{}),{},{[t]:n});e.marks=c,mc.get(e)||e.onChange()}}})(e,...n)},deleteBackward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&Dc.isCollapsed(n)&&Vd.delete(e,{unit:t,reverse:!0})})(e,...n)},deleteForward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;n&&Dc.isCollapsed(n)&&Vd.delete(e,{unit:t})})(e,...n)},deleteFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{direction:t="forward"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e;n&&Dc.isExpanded(n)&&Vd.delete(e,{reverse:"backward"===t})}(e,...n)},getFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;return t?Bc.fragment(e,t):[]})(e,...n)},insertBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{Vd.splitNodes(e,{always:!0})})(e,...n)},insertSoftBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{Vd.splitNodes(e,{always:!0})})(e,...n)},insertFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};md.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:o=!1}=n,{at:i=zc(e),batchDirty:a=!0}=n;if(t.length){if(vd.isRange(i))if(r||(i=md.unhangRange(e,i,{voids:o})),Dc.isCollapsed(i))i=i.anchor;else{var[,s]=Dc.edges(i);if(!o&&md.void(e,{at:s}))return;var l=md.pointRef(e,s);Vd.delete(e,{at:i}),i=l.unref()}else vd.isPath(i)&&(i=md.start(e,i));if(o||!md.void(e,{at:i})){var u=md.above(e,{at:i,match:t=>Bc.isElement(t)&&md.isInline(e,t),mode:"highest",voids:o});if(u){var[,c]=u;md.isEnd(e,i,c)?i=md.after(e,c):md.isStart(e,i,c)&&(i=md.before(e,c))}var d=md.above(e,{match:t=>Bc.isElement(t)&&md.isBlock(e,t),at:i,voids:o}),[,p]=d,f=md.isStart(e,i,p),h=md.isEnd(e,i,p),g=f&&h,[,m]=Bc.first({children:t},[]),[,v]=Bc.last({children:t},[]),y=t=>{var[n,r]=t;return!(0===r.length||!g&&(!f&&Ec.isAncestor(r,m)&&Bc.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)||!h&&Ec.isAncestor(r,v)&&Bc.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)))},b=!0,w=[],E=[],_=[];for(var x of Bc.nodes({children:t},{pass:y})){var[k,C]=x;b&&Bc.isElement(k)&&!e.isInline(k)&&!Ec.isAncestor(C,m)&&(b=!1),y(x)&&(Bc.isElement(k)&&!e.isInline(k)?(b=!1,E.push(k)):b?w.push(k):_.push(k))}var[S]=md.nodes(e,{at:i,match:t=>Bc.isText(t)||md.isInline(e,t),mode:"highest",voids:o}),[,T]=S,D=md.isStart(e,i,T),A=md.isEnd(e,i,T),O=md.pathRef(e,h&&!_.length?Ec.next(p):p),P=md.pathRef(e,A?Ec.next(T):T),I=_.length>0;Vd.splitNodes(e,{at:i,match:t=>I?Bc.isElement(t)&&md.isBlock(e,t):Bc.isText(t)||md.isInline(e,t),mode:I?"lowest":"highest",always:I&&(!f||w.length>0)&&(!h||_.length>0),voids:o});var N,R=md.pathRef(e,!D||D&&A?Ec.next(T):T);if(Vd.insertNodes(e,w,{at:R.current,match:t=>Bc.isText(t)||md.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),g&&!w.length&&E.length&&!_.length&&Vd.delete(e,{at:p,voids:o}),Vd.insertNodes(e,E,{at:O.current,match:t=>Bc.isElement(t)&&md.isBlock(e,t),mode:"lowest",voids:o,batchDirty:a}),Vd.insertNodes(e,_,{at:P.current,match:t=>Bc.isText(t)||md.isInline(e,t),mode:"highest",voids:o,batchDirty:a}),!n.at&&(_.length>0&&P.current?N=Ec.previous(P.current):E.length>0&&O.current?N=Ec.previous(O.current):R.current&&(N=Ec.previous(R.current)),N)){var B=md.end(e,N);Vd.select(e,B)}R.unref(),O.unref(),P.unref()}}})}(e,...n)},insertNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{Vd.insertNodes(e,t,n)})(e,...n)},insertText:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ip(e,...n)},normalizeNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var[r,o]=t;if(!Bc.isText(r)){"children"in r||(r.children=[]);var i=r;if(i!==e&&0===i.children.length&&(Vd.insertNodes(e,{text:""},{at:o.concat(0),voids:!0}),i=Bc.get(e,o)),i!==e&&(e.isInline(i)||Bc.isText(i.children[0])||e.isInline(i.children[0])))for(var a=0;a<i.children.length;a++){var s=i.children[a],l=i.children[a-1];Bc.isText(s)?null!=l&&Bc.isText(l)&&(""===s.text?(Vd.removeNodes(e,{at:o.concat(a),voids:!0}),i=Bc.get(e,o),a--):""===l.text?(Vd.removeNodes(e,{at:o.concat(a-1),voids:!0}),i=Bc.get(e,o),a--):Td.equals(s,l,{loose:!0})&&(Vd.mergeNodes(e,{at:o.concat(a),voids:!0}),i=Bc.get(e,o),a--)):e.isInline(s)?(null!=l&&Bc.isText(l)||(Vd.insertNodes(e,{text:""},{at:o.concat(a),voids:!0}),i=Bc.get(e,o),a++),a===i.children.length-1&&(Vd.insertNodes(e,{text:""},{at:o.concat(a+1),voids:!0}),i=Bc.get(e,o),a++)):(Vd.unwrapNodes(e,{at:o.concat(a),voids:!0}),i=Bc.get(e,o),a--)}else for(var u=0;u<i.children.length;u++){var c=i.children[u];(Bc.isText(c)||e.isInline(c))&&(null!=n&&n.fallbackElement?Vd.wrapNodes(e,n.fallbackElement(),{at:o.concat(u),voids:!0}):Vd.removeNodes(e,{at:o.concat(u),voids:!0}),i=Bc.get(e,o),u--)}}})(e,...n)},removeMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return dp(e,...n)},getDirtyPaths:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{switch(t.type){case"insert_text":case"remove_text":case"set_node":var{path:n}=t;return Ec.levels(n);case"insert_node":var{node:r,path:o}=t,i=Ec.levels(o),a=Bc.isText(r)?[]:Array.from(Bc.nodes(r),e=>{var[,t]=e;return o.concat(t)});return[...i,...a];case"merge_node":var{path:s}=t;return[...Ec.ancestors(s),Ec.previous(s)];case"move_node":var{path:l,newPath:u}=t;if(Ec.equals(l,u))return[];var c=[],d=[];for(var p of Ec.ancestors(l)){var f=Ec.transform(p,t);c.push(f)}for(var h of Ec.ancestors(u)){var g=Ec.transform(h,t);d.push(g)}var m=d[d.length-1],v=u[u.length-1],y=m.concat(v);return[...c,...d,y];case"remove_node":var{path:b}=t;return[...Ec.ancestors(b)];case"split_node":var{path:w}=t;return[...Ec.levels(w),Ec.next(w)];default:return[]}})(e,...n)},shouldNormalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{iteration:n,initialDirtyPathsLength:r}=t,o=42*r;if(n>o)throw new Error("Could not completely normalize the editor after ".concat(o," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0})(e,...n)},above:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{voids:n=!1,mode:r="lowest",at:o=e.selection,match:i}=t;if(o){var a=md.path(e,o);if(!vd.isRange(o)||Ec.equals(o.focus.path,o.anchor.path)){if(0===a.length)return;a=Ec.parent(a)}var s="lowest"===r,[l]=md.levels(e,{at:a,voids:n,match:i,reverse:s});return l}}(e,...n)},after:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:md.point(e,t,{edge:"end"}),focus:md.end(e,[])},{distance:i=1}=r,a=0;for(var s of md.positions(e,Xd(Xd({},r),{},{at:o}))){if(a>i)break;0!==a&&(n=s),a++}return n}(e,...n)},before:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={anchor:md.start(e,[]),focus:md.point(e,t,{edge:"start"})},{distance:i=1}=r,a=0;for(var s of md.positions(e,Jd(Jd({},r),{},{at:o,reverse:!0}))){if(a>i)break;0!==a&&(n=s),a++}return n}(e,...n)},collapse:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{edge:n="anchor"}=t,{selection:r}=e;if(r)if("anchor"===n)Vd.select(e,r.anchor);else if("focus"===n)Vd.select(e,r.focus);else if("start"===n){var[o]=Dc.edges(r);Vd.select(e,o)}else if("end"===n){var[,i]=Dc.edges(r);Vd.select(e,i)}}(e,...n)},delete:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};md.withoutNormalizing(e,()=>{var n,r,{reverse:o=!1,unit:i="character",distance:a=1,voids:s=!1}=t,{at:l=e.selection,hanging:u=!1}=t;if(l){var c=!1;if(vd.isRange(l)&&Dc.isCollapsed(l)&&(c=!0,l=l.anchor),vd.isPoint(l)){var d=md.void(e,{at:l,mode:"highest"});if(!s&&d){var[,p]=d;l=p}else{var f={unit:i,distance:a};l={anchor:l,focus:o?md.before(e,l,f)||md.start(e,[]):md.after(e,l,f)||md.end(e,[])},u=!0}}if(vd.isPath(l))Vd.removeNodes(e,{at:l,voids:s});else if(!Dc.isCollapsed(l)){if(!u){var[,h]=Dc.edges(l),g=md.end(e,[]);wd.equals(h,g)||(l=md.unhangRange(e,l,{voids:s}))}var[m,v]=Dc.edges(l),y=md.above(e,{match:t=>Bc.isElement(t)&&md.isBlock(e,t),at:m,voids:s}),b=md.above(e,{match:t=>Bc.isElement(t)&&md.isBlock(e,t),at:v,voids:s}),w=y&&b&&!Ec.equals(y[1],b[1]),E=Ec.equals(m.path,v.path),_=s?null:null!==(n=md.void(e,{at:m,mode:"highest"}))&&void 0!==n?n:md.elementReadOnly(e,{at:m,mode:"highest"}),x=s?null:null!==(r=md.void(e,{at:v,mode:"highest"}))&&void 0!==r?r:md.elementReadOnly(e,{at:v,mode:"highest"});if(_){var k=md.before(e,m);k&&y&&Ec.isAncestor(y[1],k.path)&&(m=k)}if(x){var C=md.after(e,v);C&&b&&Ec.isAncestor(b[1],C.path)&&(v=C)}var S,T=[];for(var D of md.nodes(e,{at:l,voids:s})){var[A,O]=D;S&&0===Ec.compare(O,S)||(!s&&Bc.isElement(A)&&(md.isVoid(e,A)||md.isElementReadOnly(e,A))||!Ec.isCommon(O,m.path)&&!Ec.isCommon(O,v.path))&&(T.push(D),S=O)}var P=Array.from(T,t=>{var[,n]=t;return md.pathRef(e,n)}),I=md.pointRef(e,m),N=md.pointRef(e,v),R="";if(!E&&!_){var B=I.current,[F]=md.leaf(e,B),{path:L}=B,{offset:M}=m,U=F.text.slice(M);U.length>0&&(e.apply({type:"remove_text",path:L,offset:M,text:U}),R=U)}if(P.reverse().map(e=>e.unref()).filter(e=>null!==e).forEach(t=>Vd.removeNodes(e,{at:t,voids:s})),!x){var j=N.current,[$]=md.leaf(e,j),{path:z}=j,H=E?m.offset:0,V=$.text.slice(H,v.offset);V.length>0&&(e.apply({type:"remove_text",path:z,offset:H,text:V}),R=V)}!E&&w&&N.current&&I.current&&Vd.mergeNodes(e,{at:N.current,hanging:!0,voids:s}),c&&o&&"character"===i&&R.length>1&&R.match(/[\u0980-\u09FF\u0E00-\u0E7F\u1000-\u109F\u0900-\u097F\u1780-\u17FF\u0D00-\u0D7F\u0B00-\u0B7F\u0A00-\u0A7F\u0B80-\u0BFF\u0C00-\u0C7F]+/)&&Vd.insertText(e,R.slice(0,R.length-a));var W=I.unref(),q=N.unref(),G=o?W||q:q||W;null==t.at&&G&&Vd.select(e,G)}}})}(e,...n)},deselect:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var{selection:t}=e;t&&e.apply({type:"set_selection",properties:t,newProperties:null})})(e,...n)},edges:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>[md.start(e,t),md.end(e,t)])(e,...n)},elementReadOnly:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return md.above(e,tp(tp({},t),{},{match:t=>Bc.isElement(t)&&md.isElementReadOnly(e,t)}))}(e,...n)},end:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>md.point(e,t,{edge:"end"}))(e,...n)},first:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=md.path(e,t,{edge:"start"});return md.node(e,n)})(e,...n)},fragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=md.range(e,t);return Bc.fragment(e,n)})(e,...n)},getMarks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var{marks:t,selection:n}=e;if(!n)return null;var{anchor:r,focus:o}=n;if(t)return t;if(Dc.isExpanded(n)){if(Dc.isBackward(n)&&([o,r]=[r,o]),md.isEnd(e,r,r.path)){var i=md.after(e,r);i&&(r=i)}var[a]=md.nodes(e,{match:Bc.isText,at:{anchor:r,focus:o}});if(a){var[s]=a;return Cc(s,ap)}return{}}var{path:l}=r,[u]=md.leaf(e,l);if(0===r.offset){var c=md.previous(e,{at:l,match:Bc.isText}),d=md.above(e,{match:t=>Bc.isElement(t)&&md.isVoid(e,t)&&e.markableVoid(t)});if(!d){var p=md.above(e,{match:t=>Bc.isElement(t)&&md.isBlock(e,t)});if(c&&p){var[f,h]=c,[,g]=p;Ec.isAncestor(g,h)&&(u=f)}}}return Cc(u,sp)}(e,...n)},hasBlocks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some(t=>Bc.isElement(t)&&md.isBlock(e,t)))(e,...n)},hasInlines:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.some(t=>Bc.isText(t)||md.isInline(e,t)))(e,...n)},hasPath:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>Bc.has(e,t))(e,...n)},hasTexts:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>t.children.every(e=>Bc.isText(e)))(e,...n)},insertNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return gp(e,...n)},isBlock:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>!e.isInline(t))(e,...n)},isEdge:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>md.isStart(e,t,n)||md.isEnd(e,t,n))(e,...n)},isEmpty:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{children:n}=t,[r]=n;return 0===n.length||1===n.length&&Bc.isText(r)&&""===r.text&&!e.isVoid(t)})(e,...n)},isEnd:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{var r=md.end(e,n);return wd.equals(t,r)})(e,...n)},isNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=vc.get(e);return void 0===t||t})(e,...n)},isStart:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>{if(0!==t.offset)return!1;var r=md.start(e,n);return wd.equals(t,r)})(e,...n)},last:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var n=md.path(e,t,{edge:"end"});return md.node(e,n)})(e,...n)},leaf:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=md.path(e,t,n);return[Bc.leaf(e,r),r]}(e,...n)},levels:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:o=!1}=t,{match:i}=t;if(null==i&&(i=()=>!0),n){var a=[],s=md.path(e,n);for(var[l,u]of Bc.levels(e,s))if(i(l,u)&&(a.push([l,u]),!o&&Bc.isElement(l)&&md.isVoid(e,l)))break;r&&a.reverse(),yield*a}}()}(e,...n)},liftNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};md.withoutNormalizing(e,()=>{var{at:n=e.selection,mode:r="lowest",voids:o=!1}=t,{match:i}=t;if(n){null==i&&(i=vd.isPath(n)?Hc(e,n):t=>Bc.isElement(t)&&md.isBlock(e,t));var a=md.nodes(e,{at:n,match:i,mode:r,voids:o}),s=Array.from(a,t=>{var[,n]=t;return md.pathRef(e,n)});for(var l of s){var u=l.unref();if(u.length<2)throw new Error("Cannot lift node at a path [".concat(u,"] because it has a depth of less than `2`."));var c=md.node(e,Ec.parent(u)),[d,p]=c,f=u[u.length-1],{length:h}=d.children;if(1===h){var g=Ec.next(p);Vd.moveNodes(e,{at:u,to:g,voids:o}),Vd.removeNodes(e,{at:p,voids:o})}else if(0===f)Vd.moveNodes(e,{at:u,to:p,voids:o});else if(f===h-1){var m=Ec.next(p);Vd.moveNodes(e,{at:u,to:m,voids:o})}else{var v=Ec.next(u),y=Ec.next(p);Vd.splitNodes(e,{at:v,voids:o}),Vd.moveNodes(e,{at:u,to:y,voids:o})}}}})}(e,...n)},mergeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};md.withoutNormalizing(e,()=>{var{match:n,at:r=e.selection}=t,{hanging:o=!1,voids:i=!1,mode:a="lowest"}=t;if(r){if(null==n)if(vd.isPath(r)){var[s]=md.parent(e,r);n=e=>s.children.includes(e)}else n=t=>Bc.isElement(t)&&md.isBlock(e,t);if(!o&&vd.isRange(r)&&(r=md.unhangRange(e,r,{voids:i})),vd.isRange(r))if(Dc.isCollapsed(r))r=r.anchor;else{var[,l]=Dc.edges(r),u=md.pointRef(e,l);Vd.delete(e,{at:r}),r=u.unref(),null==t.at&&Vd.select(e,r)}var[c]=md.nodes(e,{at:r,match:n,voids:i,mode:a}),d=md.previous(e,{at:r,match:n,voids:i,mode:a});if(c&&d){var[p,f]=c,[h,g]=d;if(0!==f.length&&0!==g.length){var m,v,y=Ec.next(g),b=Ec.common(f,g),w=Ec.isSibling(f,g),E=Array.from(md.levels(e,{at:f}),e=>{var[t]=e;return t}).slice(b.length).slice(0,-1),_=md.above(e,{at:f,mode:"highest",match:t=>E.includes(t)&&yp(e,t)}),x=_&&md.pathRef(e,_[1]);if(Bc.isText(p)&&Bc.isText(h)){var k=Cc(p,mp);v=h.text.length,m=k}else{if(!Bc.isElement(p)||!Bc.isElement(h))throw new Error("Cannot merge the node at path [".concat(f,"] with the previous sibling because it is not the same kind: ").concat(_d.stringify(p)," ").concat(_d.stringify(h)));k=Cc(p,vp),v=h.children.length,m=k}w||Vd.moveNodes(e,{at:f,to:y,voids:i}),x&&Vd.removeNodes(e,{at:x.current,voids:i}),md.shouldMergeNodesRemovePrevNode(e,d,c)?Vd.removeNodes(e,{at:g,voids:i}):e.apply({type:"merge_node",path:y,position:v,properties:m}),x&&x.unref()}}}})}(e,...n)},move:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{selection:n}=e,{distance:r=1,unit:o="character",reverse:i=!1}=t,{edge:a=null}=t;if(n){"start"===a&&(a=Dc.isBackward(n)?"focus":"anchor"),"end"===a&&(a=Dc.isBackward(n)?"anchor":"focus");var{anchor:s,focus:l}=n,u={distance:r,unit:o},c={};if(null==a||"anchor"===a){var d=i?md.before(e,s,u):md.after(e,s,u);d&&(c.anchor=d)}if(null==a||"focus"===a){var p=i?md.before(e,l,u):md.after(e,l,u);p&&(c.focus=p)}Vd.setSelection(e,c)}}(e,...n)},moveNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{md.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:o="lowest",voids:i=!1}=t,{match:a}=t;if(r){null==a&&(a=vd.isPath(r)?Hc(e,r):t=>Bc.isElement(t)&&md.isBlock(e,t));var s=md.pathRef(e,n),l=md.nodes(e,{at:r,match:a,mode:o,voids:i}),u=Array.from(l,t=>{var[,n]=t;return md.pathRef(e,n)});for(var c of u){var d=c.unref(),p=s.current;0!==d.length&&e.apply({type:"move_node",path:d,newPath:p}),s.current&&Ec.isSibling(p,d)&&Ec.isAfter(p,d)&&(s.current=Ec.next(s.current))}s.unref()}})})(e,...n)},next:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=md.after(e,i,{voids:r});if(a){var[,s]=md.last(e,[]),l=[a.path,s];if(vd.isPath(i)&&0===i.length)throw new Error("Cannot get the next node from the root node!");if(null==o)if(vd.isPath(i)){var[u]=md.parent(e,i);o=e=>u.children.includes(e)}else o=()=>!0;var[c]=md.nodes(e,{at:l,match:o,mode:n,voids:r});return c}}}(e,...n)},node:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=md.path(e,t,n),o=Bc.get(e,r);return[o,r]}(e,...n)},nodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r="all",universal:o=!1,reverse:i=!1,voids:a=!1,pass:s}=t,{match:l}=t;if(l||(l=()=>!0),n){var u,c;if(vd.isSpan(n))u=n[0],c=n[1];else{var d=md.path(e,n,{edge:"start"}),p=md.path(e,n,{edge:"end"});u=i?p:d,c=i?d:p}var f,h=Bc.nodes(e,{reverse:i,from:u,to:c,pass:t=>{var[n,r]=t;return!(!s||!s([n,r]))||!!Bc.isElement(n)&&!(a||!md.isVoid(e,n)&&!md.isElementReadOnly(e,n))}}),g=[];for(var[m,v]of h){var y=f&&0===Ec.compare(v,f[1]);if("highest"!==r||!y)if(l(m,v))if("lowest"===r&&y)f=[m,v];else{var b="lowest"===r?f:[m,v];b&&(o?g.push(b):yield b),f=[m,v]}else if(o&&!y&&Bc.isText(m))return}"lowest"===r&&f&&(o?g.push(f):yield f),o&&(yield*g)}}()}(e,...n)},normalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return lp(e,...n)},parent:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=md.path(e,t,n),o=Ec.parent(r);return md.node(e,o)}(e,...n)},path:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{depth:r,edge:o}=n;if(vd.isPath(t))if("start"===o){var[,i]=Bc.first(e,t);t=i}else if("end"===o){var[,a]=Bc.last(e,t);t=a}return vd.isRange(t)&&(t="start"===o?Dc.start(t):"end"===o?Dc.end(t):Ec.common(t.anchor.path,t.focus.path)),vd.isPoint(t)&&(t=t.path),null!=r&&(t=t.slice(0,r)),t}(e,...n)},pathRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return md.pathRefs(e).delete(o),o.current=null,t}};return md.pathRefs(e).add(o),o}(e,...n)},pathRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=yc.get(e);return t||(t=new Set,yc.set(e,t)),t})(e,...n)},point:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{edge:r="start"}=n;if(vd.isPath(t)){var o;if("end"===r){var[,i]=Bc.last(e,t);o=i}else{var[,a]=Bc.first(e,t);o=a}var s=Bc.get(e,o);if(!Bc.isText(s))throw new Error("Cannot get the ".concat(r," point in the node at path [").concat(t,"] because it has no ").concat(r," text node."));return{path:o,offset:"end"===r?s.text.length:0}}if(vd.isRange(t)){var[l,u]=Dc.edges(t);return"start"===r?l:u}return t}(e,...n)},pointRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return md.pointRefs(e).delete(o),o.current=null,t}};return md.pointRefs(e).add(o),o}(e,...n)},pointRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=bc.get(e);return t||(t=new Set,bc.set(e,t)),t})(e,...n)},positions:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return up(e,...n)},previous:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{mode:n="lowest",voids:r=!1}=t,{match:o,at:i=e.selection}=t;if(i){var a=md.before(e,i,{voids:r});if(a){var[,s]=md.first(e,[]),l=[a.path,s];if(vd.isPath(i)&&0===i.length)throw new Error("Cannot get the previous node from the root node!");if(null==o)if(vd.isPath(i)){var[u]=md.parent(e,i);o=e=>u.children.includes(e)}else o=()=>!0;var[c]=md.nodes(e,{reverse:!0,at:l,match:o,mode:n,voids:r});return c}}}(e,...n)},range:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t,n)=>vd.isRange(t)&&!n?t:{anchor:md.start(e,t),focus:md.end(e,n||t)})(e,...n)},rangeRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{affinity:r="forward"}=n,o={current:t,affinity:r,unref(){var{current:t}=o;return md.rangeRefs(e).delete(o),o.current=null,t}};return md.rangeRefs(e).add(o),o}(e,...n)},rangeRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=>{var t=wc.get(e);return t||(t=new Set,wc.set(e,t)),t})(e,...n)},removeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return bp(e,...n)},select:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e;if(t=md.range(e,t),n)Vd.setSelection(e,t);else{if(!vd.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(_d.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})}})(e,...n)},setNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};md.withoutNormalizing(e,()=>{var{match:r,at:o=e.selection,compare:i,merge:a}=n,{hanging:s=!1,mode:l="lowest",split:u=!1,voids:c=!1}=n;if(o){if(null==r&&(r=vd.isPath(o)?Hc(e,o):t=>Bc.isElement(t)&&md.isBlock(e,t)),!s&&vd.isRange(o)&&(o=md.unhangRange(e,o,{voids:c})),u&&vd.isRange(o)){if(Dc.isCollapsed(o)&&md.leaf(e,o.anchor)[0].text.length>0)return;var d=md.rangeRef(e,o,{affinity:"inward"}),[p,f]=Dc.edges(o),h="lowest"===l?"lowest":"highest",g=md.isEnd(e,f,f.path);Vd.splitNodes(e,{at:f,match:r,mode:h,voids:c,always:!g});var m=md.isStart(e,p,p.path);Vd.splitNodes(e,{at:p,match:r,mode:h,voids:c,always:!m}),o=d.unref(),null==n.at&&Vd.select(e,o)}for(var[v,y]of(i||(i=(e,t)=>e!==t),md.nodes(e,{at:o,match:r,mode:l,voids:c}))){var b={},w={};if(0!==y.length){var E=!1;for(var _ in t)"children"!==_&&"text"!==_&&i(t[_],v[_])&&(E=!0,v.hasOwnProperty(_)&&(b[_]=v[_]),a?null!=t[_]&&(w[_]=a(v[_],t[_])):null!=t[_]&&(w[_]=t[_]));E&&e.apply({type:"set_node",path:y,properties:b,newProperties:w})}}}})}(e,...n)},setNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{vc.set(e,t)})(e,...n)},setPoint:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{selection:r}=e,{edge:o="both"}=n;if(r){"start"===o&&(o=Dc.isBackward(r)?"focus":"anchor"),"end"===o&&(o=Dc.isBackward(r)?"anchor":"focus");var{anchor:i,focus:a}=r,s="anchor"===o?i:a;Vd.setSelection(e,{["anchor"===o?"anchor":"focus"]:hp(hp({},s),t)})}}(e,...n)},setSelection:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var{selection:n}=e,r={},o={};if(n){for(var i in t)("anchor"===i&&null!=t.anchor&&!wd.equals(t.anchor,n.anchor)||"focus"===i&&null!=t.focus&&!wd.equals(t.focus,n.focus)||"anchor"!==i&&"focus"!==i&&t[i]!==n[i])&&(r[i]=n[i],o[i]=t[i]);Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:o})}})(e,...n)},splitNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return wp(e,...n)},start:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>md.point(e,t,{edge:"start"}))(e,...n)},string:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,o=md.range(e,t),[i,a]=Dc.edges(o),s="";for(var[l,u]of md.nodes(e,{at:o,match:Bc.isText,voids:r})){var c=l.text;Ec.equals(u,a.path)&&(c=c.slice(0,a.offset)),Ec.equals(u,i.path)&&(c=c.slice(i.offset)),s+=c}return s}(e,...n)},unhangRange:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{voids:r=!1}=n,[o,i]=Dc.edges(t);if(0!==o.offset||0!==i.offset||Dc.isCollapsed(t)||Ec.hasPrevious(i.path))return t;var a=md.above(e,{at:i,match:t=>Bc.isElement(t)&&md.isBlock(e,t),voids:r}),s=a?a[1]:[],l={anchor:md.start(e,o),focus:i},u=!0;for(var[c,d]of md.nodes(e,{at:l,match:Bc.isText,reverse:!0,voids:r}))if(u)u=!1;else if(""!==c.text||Ec.isBefore(d,s)){i={path:d,offset:c.text.length};break}return{anchor:o,focus:i}}(e,...n)},unsetNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Array.isArray(t)||(t=[t]);var r={};for(var o of t)r[o]=null;Vd.setNodes(e,r,n)}(e,...n)},unwrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};md.withoutNormalizing(e,()=>{var{mode:n="lowest",split:r=!1,voids:o=!1}=t,{at:i=e.selection,match:a}=t;if(i){null==a&&(a=vd.isPath(i)?Hc(e,i):t=>Bc.isElement(t)&&md.isBlock(e,t)),vd.isPath(i)&&(i=md.range(e,i));var s=vd.isRange(i)?md.rangeRef(e,i):null,l=md.nodes(e,{at:i,match:a,mode:n,voids:o}),u=Array.from(l,t=>{var[,n]=t;return md.pathRef(e,n)}).reverse(),c=function(){var t=d.unref(),[n]=md.node(e,t),i=md.range(e,t);r&&s&&(i=Dc.intersection(s.current,i)),Vd.liftNodes(e,{at:i,match:e=>!Bc.isText(n)&&n.children.includes(e),voids:o})};for(var d of u)c();s&&s.unref()}})}(e,...n)},void:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return md.above(e,rp(rp({},t),{},{match:t=>Bc.isElement(t)&&md.isVoid(e,t)}))}(e,...n)},withoutNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return pp(e,...n)},wrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};md.withoutNormalizing(e,()=>{var{mode:r="lowest",split:o=!1,voids:i=!1}=n,{match:a,at:s=e.selection}=n;if(s){if(null==a&&(a=vd.isPath(s)?Hc(e,s):e.isInline(t)?t=>Bc.isElement(t)&&md.isInline(e,t)||Bc.isText(t):t=>Bc.isElement(t)&&md.isBlock(e,t)),o&&vd.isRange(s)){var[l,u]=Dc.edges(s),c=md.rangeRef(e,s,{affinity:"inward"}),d=t=>{var n=md.above(e,{at:t,match:t=>Bc.isElement(t)&&md.isBlock(e,t)});return n&&md.isEdge(e,t,n[1])};Vd.splitNodes(e,{at:u,match:a,voids:i,always:!d(u)}),Vd.splitNodes(e,{at:l,match:a,voids:i,always:!d(l)}),s=c.unref(),null==n.at&&Vd.select(e,s)}var p=Array.from(md.nodes(e,{at:s,match:e.isInline(t)?t=>Bc.isElement(t)&&md.isBlock(e,t):e=>Bc.isEditor(e),mode:"lowest",voids:i})),f=function(){var n=vd.isRange(s)?Dc.intersection(s,md.range(e,h)):s;if(!n)return 0;var o=Array.from(md.nodes(e,{at:n,match:a,mode:r,voids:i}));if(o.length>0){var[l]=o,u=o[o.length-1],[,c]=l,[,d]=u;if(0===c.length&&0===d.length)return 0;var p=Ec.equals(c,d)?Ec.parent(c):Ec.common(c,d),f=md.range(e,c,d),g=md.node(e,p),[m]=g,v=p.length+1,y=Ec.next(d.slice(0,v)),b=_p(_p({},t),{},{children:[]});Vd.insertNodes(e,b,{at:y,voids:i}),Vd.moveNodes(e,{at:f,match:e=>!Bc.isText(m)&&m.children.includes(e),to:y.concat(0),voids:i})}};for(var[,h]of p)f()}})}(e,...n)},shouldMergeNodesRemovePrevNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return((e,t)=>{var[n,r]=t;return Bc.isElement(n)&&md.isEmpty(e,n)||Bc.isText(n)&&""===n.text&&0!==r[r.length-1]})(e,...n)}};return e};
4
13
  /*!
5
- * tabbable 6.2.0
14
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
15
+ *
16
+ * Copyright (c) 2014-2017, Jon Schlinkert.
17
+ * Released under the MIT License.
18
+ */
19
+ function kp(e){return"[object Object]"===Object.prototype.toString.call(e)}function Cp(e){var t,n;return!1!==kp(e)&&(void 0===(t=e.constructor)||!1!==kp(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}var Sp={isHistory:e=>Cp(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||Uc.isOperationList(e.redos[0].operations))&&(0===e.undos.length||Uc.isOperationList(e.undos[0].operations))},Tp=new WeakMap,Dp=new WeakMap,Ap=new WeakMap,Op={isHistoryEditor:e=>Sp.isHistory(e.history)&&md.isEditor(e),isMerging:e=>Dp.get(e),isSplittingOnce:e=>Ap.get(e),setSplittingOnce(e,t){Ap.set(e,t)},isSaving:e=>Tp.get(e),redo(e){e.redo()},undo(e){e.undo()},withMerging(e,t){var n=Op.isMerging(e);Dp.set(e,!0),t(),Dp.set(e,n)},withNewBatch(e,t){var n=Op.isMerging(e);Dp.set(e,!0),Ap.set(e,!0),t(),Dp.set(e,n),Ap.delete(e)},withoutMerging(e,t){var n=Op.isMerging(e);Dp.set(e,!1),t(),Dp.set(e,n)},withoutSaving(e,t){var n=Op.isSaving(e);Tp.set(e,!1);try{t()}finally{Tp.set(e,n)}}},Pp=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!Ec.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!Ec.equals(e.path,t.path)),Ip=(e,t)=>"set_selection"!==e.type,Np=Object.defineProperty,Rp=Object.defineProperties,Bp=Object.getOwnPropertyDescriptors,Fp=Object.getOwnPropertySymbols,Lp=Object.prototype.hasOwnProperty,Mp=Object.prototype.propertyIsEnumerable,Up=(e,t,n)=>t in e?Np(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jp=(e,t)=>{for(var n in t||(t={}))Lp.call(t,n)&&Up(e,n,t[n]);if(Fp)for(var n of Fp(t))Mp.call(t,n)&&Up(e,n,t[n]);return e},$p=()=>xp(),zp=e=>Oc.isElement(e);var Hp=(e,t,n)=>!n||("object"==typeof n?Object.entries(n).every(([t,n])=>{const r=function(e){return Array.isArray(e)?e:[e]}(n);return r.includes(e[t])}):n(e,t)),Vp=(e,t={})=>{const{match:n,block:r}=t;return o=jp({},t),i={match:n||r?(t,o)=>Hp(t,o,n)&&(!r||((e,t)=>zp(t)&&md.isBlock(e,t))(e,t)):void 0},Rp(o,Bp(i));var o,i},Wp=(e,t)=>md.above(e,Vp(e,t)),qp=(e,t)=>(((e,t,n={})=>{const{voids:r,unhang:o=!0}=n;Dc.isRange(t)&&o&&md.unhangRange(e,t,{voids:r})})(e,null==t?void 0:t.at,t),md.nodes(e,Vp(e,t))),Gp=(e,t)=>{let n=!1;return md.withoutNormalizing(e,()=>{n=!!t()}),n},Kp=e=>Td.isText(e),Yp=(e,t)=>Vd.removeNodes(e,t),Zp=(e,t)=>md.end(e,t),Xp=e=>md.marks(e),Qp=(e,t,n)=>!!t&&md.isStart(e,t,n);function Jp(e){return Array.isArray(e)?e:[e]}var ef=(e,{filter:t,allow:n,exclude:r,level:o,maxLevel:i}={})=>{if(!e)return!1;const[a,s]=e;if(o){if(!Jp(o).includes(s.length))return!1}if(i&&s.length>i)return!1;if(t&&!t(e))return!1;if(n){const e=Jp(n);if(e.length>0&&!e.includes(a.type))return!1}if(r){const e=Jp(r);if(e.length>0&&e.includes(a.type))return!1}return!0},tf=(e,t,n={})=>{var r=n,{nextBlock:o,removeEmpty:i}=r,a=((e,t)=>{var n={};for(var r in e)Lp.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Fp)for(var r of Fp(e))t.indexOf(r)<0&&Mp.call(e,r)&&(n[r]=e[r]);return n})(r,["nextBlock","removeEmpty"]);pp(e,()=>{if(i){const t=Wp(e,{at:a.at});if(t){const n=!0===i?{allow:["p"]}:i,{filter:r}=n;n.filter=([t,n])=>{if((e=>Bc.string(e))(t))return!1;return!t.children.some(t=>((e,t)=>zp(t)&&md.isInline(e,t))(e,t))&&(!r||r([t,n]))},ef(t,n)&&(bp(e,{at:t[1]}),o=!1)}}if(o){const{at:t=e.selection}=a;if(t){const n=Zp(e,t),r=Wp(e,{at:n,block:!0});r&&(a.at=Ec.next(r[1]))}}Vd.insertNodes(e,t,a)})};const nf=e=>"object"==typeof e&&null!=e&&1===e.nodeType,rf=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,of=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return rf(n.overflowY,t)||rf(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},af=(e,t,n,r,o,i,a,s)=>i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-r:a>t&&s<n||i<e&&s>n?a-t+o:0,sf=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},lf=(e,t)=>{var n,r,o,i;if("undefined"==typeof document)return[];const{scrollMode:a,block:s,inline:l,boundary:u,skipOverflowHiddenElements:c}=t,d="function"==typeof u?u:e=>e!==u;if(!nf(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,f=[];let h=e;for(;nf(h)&&d(h);){if(h=sf(h),h===p){f.push(h);break}null!=h&&h===document.body&&of(h)&&!of(document.documentElement)||null!=h&&of(h,c)&&f.push(h)}const g=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,m=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,{scrollX:v,scrollY:y}=window,{height:b,width:w,top:E,right:_,bottom:x,left:k}=e.getBoundingClientRect(),{top:C,right:S,bottom:T,left:D}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let A="start"===s||"nearest"===s?E-C:"end"===s?x+T:E+b/2-C+T,O="center"===l?k+w/2-D+S:"end"===l?_+S:k-D;const P=[];for(let e=0;e<f.length;e++){const t=f[e],{height:n,width:r,top:o,right:i,bottom:u,left:c}=t.getBoundingClientRect();if("if-needed"===a&&E>=0&&k>=0&&x<=m&&_<=g&&(t===p&&!of(t)||E>=o&&x<=u&&k>=c&&_<=i))return P;const d=getComputedStyle(t),h=parseInt(d.borderLeftWidth,10),C=parseInt(d.borderTopWidth,10),S=parseInt(d.borderRightWidth,10),T=parseInt(d.borderBottomWidth,10);let D=0,I=0;const N="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-S:0,R="offsetHeight"in t?t.offsetHeight-t.clientHeight-C-T:0,B="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,F="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(p===t)D="start"===s?A:"end"===s?A-m:"nearest"===s?af(y,y+m,m,C,T,y+A,y+A+b,b):A-m/2,I="start"===l?O:"center"===l?O-g/2:"end"===l?O-g:af(v,v+g,g,h,S,v+O,v+O+w,w),D=Math.max(0,D+y),I=Math.max(0,I+v);else{D="start"===s?A-o-C:"end"===s?A-u+T+R:"nearest"===s?af(o,u,n,C,T+R,A,A+b,b):A-(o+n/2)+R/2,I="start"===l?O-c-h:"center"===l?O-(c+r/2)+N/2:"end"===l?O-i+S+N:af(c,i,r,h,S+N,O,O+w,w);const{scrollLeft:e,scrollTop:a}=t;D=0===F?0:Math.max(0,Math.min(a+D/F,t.scrollHeight-n/F+R)),I=0===B?0:Math.max(0,Math.min(e+I/B,t.scrollWidth-r/B+N)),A+=a-D,O+=e-I}P.push({el:t,top:D,left:I})}return P};function uf(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(lf(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:o,top:i,left:a}of lf(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=i-n.top+n.bottom,t=a-n.left+n.right;o.scroll({top:e,left:t,behavior:r})}}var cf={};Object.defineProperty(cf,"__esModule",{value:!0});for(var df="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),pf={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},ff={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:df?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},hf={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},gf=1;gf<20;gf++)hf["f"+gf]=111+gf;function mf(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(e){return vf(e,t)}),o=function(e){return r.some(function(t){return yf(t,e)})};return null==n?o:o(n)}function vf(e,t){var n=t&&t.byKey,r={},o=(e=e.replace("++","+add")).split("+"),i=o.length;for(var a in pf)r[pf[a]]=!1;var s=!0,l=!1,u=void 0;try{for(var c,d=o[Symbol.iterator]();!(s=(c=d.next()).done);s=!0){var p=c.value,f=p.endsWith("?")&&p.length>1;f&&(p=p.slice(0,-1));var h=wf(p),g=pf[h];if(p.length>1&&!g&&!ff[p]&&!hf[h])throw new TypeError('Unknown modifier: "'+p+'"');1!==i&&g||(n?r.key=h:r.which=bf(p)),g&&(r[g]=!f||null)}}catch(e){l=!0,u=e}finally{try{!s&&d.return&&d.return()}finally{if(l)throw u}}return r}function yf(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function bf(e){return e=wf(e),hf[e]||e.toUpperCase().charCodeAt(0)}function wf(e){return e=e.toLowerCase(),e=ff[e]||e}cf.default=mf;var Ef=cf.isHotkey=mf;cf.isCodeHotkey=function(e,t){return mf(e,t)};var _f=cf.isKeyHotkey=function(e,t){return mf(e,{byKey:!0},t)};cf.parseHotkey=vf,cf.compareHotkey=yf,cf.toKeyCode=bf,cf.toKeyName=wf;var xf,kf,Cf=globalThis.Node,Sf=globalThis.Text,Tf=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,Df=e=>Of(e)&&8===e.nodeType,Af=e=>Of(e)&&1===e.nodeType,Of=e=>{var t=Tf(e);return!!t&&e instanceof t.Node},Pf=e=>{var t=e&&e.anchorNode&&Tf(e.anchorNode);return!!t&&e instanceof t.Selection},If=e=>Of(e)&&3===e.nodeType,Nf=(e,t,n)=>{for(var{childNodes:r}=e,o=r[t],i=t,a=!1,s=!1;(Df(o)||Af(o)&&0===o.childNodes.length||Af(o)&&"false"===o.getAttribute("contenteditable"))&&(!a||!s);)i>=r.length?(a=!0,i=t-1,n="backward"):i<0?(s=!0,i=t+1,n="forward"):(o=r[i],t=i,i+="forward"===n?1:-1);return[o,t]},Rf=(e,t,n)=>{var[r]=Nf(e,t,n);return r},Bf=e=>{var t="";if(If(e)&&e.nodeValue)return e.nodeValue;if(Af(e)){for(var n of Array.from(e.childNodes))t+=Bf(n);var r=getComputedStyle(e).getPropertyValue("display");"block"!==r&&"list"!==r&&"BR"!==e.tagName||(t+="\n")}return t},Ff=/data-slate-fragment="(.+?)"/m,Lf=e=>null!=e.getSelection?e.getSelection():document.getSelection(),Mf=(e,t,n)=>{var{target:r}=t;if(Af(r)&&r.matches('[contentEditable="false"]'))return!1;var{document:o}=Ph.getWindow(e);if($f(o,r))return Ph.hasDOMNode(e,r,{editable:!0});var i=n.find(e=>{var{addedNodes:t,removedNodes:n}=e;for(var o of t)if(o===r||$f(o,r))return!0;for(var i of n)if(i===r||$f(i,r))return!0});return!(!i||i===t)&&Mf(e,i,n)},Uf=(e,t)=>Boolean(e.compareDocumentPosition(t)&Cf.DOCUMENT_POSITION_PRECEDING),jf=(e,t)=>{if(!e)return null;for(var n=e;n;){if(n.matches&&n.matches(t))return n;if(n.parentElement)n=n.parentElement;else{if(!n.parentNode||!("host"in n.parentNode))return null;n=n.parentNode.host}}return null},$f=(e,t)=>{if(!e||!t)return!1;if(e.contains(t))return!0;for(var n=t;n;){if(n===e)return!0;if(!n.parentNode)return!1;n="host"in n.parentNode?n.parentNode.host:n.parentNode}return!1},zf="undefined"!=typeof navigator&&"undefined"!=typeof window&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Hf="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),Vf="undefined"!=typeof navigator&&/Android/.test(navigator.userAgent),Wf="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),qf="undefined"!=typeof navigator&&/AppleWebKit(?!.*Chrome)/i.test(navigator.userAgent),Gf="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),Kf="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent),Yf="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),Zf=Vf&&"undefined"!=typeof navigator&&/Chrome?\/(?:[0-5]?\d)(?:\.)/i.test(navigator.userAgent),Xf="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent),Qf="undefined"!=typeof navigator&&/.*UCBrowser/.test(navigator.userAgent),Jf="undefined"!=typeof navigator&&/.*Wechat/.test(navigator.userAgent)&&!/.*MacWechat/.test(navigator.userAgent)&&(!Kf||Yf),eh=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement);"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&/Version\/(\d+)/.test(navigator.userAgent)&&null!==(xf=navigator.userAgent.match(/Version\/(\d+)/))&&void 0!==xf&&xf[1]&&parseInt(null===(kf=navigator.userAgent.match(/Version\/(\d+)/))||void 0===kf?void 0:kf[1],10);var th=(!Yf||!Zf)&&!Gf&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges;function nh(e){return nh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nh(e)}function rh(e){var t=function(e,t){if("object"!==nh(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==nh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===nh(t)?t:String(t)}function oh(e,t,n){return(t=rh(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ih=0;class ah{constructor(){oh(this,"id",void 0),this.id="".concat(ih++)}}var sh=new WeakMap,lh=new WeakMap,uh=new WeakMap,ch=new WeakMap,dh=new WeakMap,ph=new WeakMap,fh=new WeakMap,hh=new WeakMap,gh=new WeakMap,mh=new WeakMap,vh=new WeakMap,yh=new WeakMap,bh=new WeakMap,wh=new WeakMap,Eh=new WeakMap,_h=new WeakMap,xh=new WeakMap,kh=new WeakMap,Ch=new WeakMap,Sh=new WeakMap,Th=new WeakMap,Dh=new WeakMap,Ah=Symbol("placeholder"),Oh=Symbol("mark-placeholder"),Ph={androidPendingDiffs:e=>Ch.get(e),androidScheduleFlush:e=>{var t;null===(t=_h.get(e))||void 0===t||t()},blur:e=>{var t=Ph.toDOMNode(e,e),n=Ph.findDocumentOrShadowRoot(e);yh.set(e,!1),n.activeElement===t&&t.blur()},deselect:e=>{var{selection:t}=e,n=Ph.findDocumentOrShadowRoot(e),r=Lf(n);r&&r.rangeCount>0&&r.removeAllRanges(),t&&Vd.deselect(e)},findDocumentOrShadowRoot:e=>{var t=Ph.toDOMNode(e,e),n=t.getRootNode();return n instanceof Document||n instanceof ShadowRoot?n:t.ownerDocument},findEventRange:(e,t)=>{"nativeEvent"in t&&(t=t.nativeEvent);var{clientX:n,clientY:r,target:o}=t;if(null==n||null==r)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var i,a=Ph.toSlateNode(e,t.target),s=Ph.findPath(e,a);if(Bc.isElement(a)&&md.isVoid(e,a)){var l=o.getBoundingClientRect(),u=e.isInline(a)?n-l.left<l.left+l.width-n:r-l.top<l.top+l.height-r,c=md.point(e,s,{edge:u?"start":"end"}),d=u?md.before(e,c):md.after(e,c);if(d)return md.range(e,d)}var{document:p}=Ph.getWindow(e);if(p.caretRangeFromPoint)i=p.caretRangeFromPoint(n,r);else{var f=p.caretPositionFromPoint(n,r);f&&((i=p.createRange()).setStart(f.offsetNode,f.offset),i.setEnd(f.offsetNode,f.offset))}if(!i)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));return Ph.toSlateRange(e,i,{exactMatch:!1,suppressThrow:!1})},findKey:(e,t)=>{var n=gh.get(t);return n||(n=new ah,gh.set(t,n)),n},findPath:(e,t)=>{for(var n=[],r=t;;){var o=uh.get(r);if(null==o){if(r===e)return n;break}var i=lh.get(r);if(null==i)break;n.unshift(i),r=o}throw new Error("Unable to find the path for Slate node: ".concat(_d.stringify(t)))},focus:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{retries:5};if(!yh.get(e)&&dh.get(e)){if(t.retries<=0)throw new Error("Could not set focus, editor seems stuck with pending operations");if(e.operations.length>0)setTimeout(()=>{Ph.focus(e,{retries:t.retries-1})},10);else{var n=Ph.toDOMNode(e,e),r=Ph.findDocumentOrShadowRoot(e);if(r.activeElement!==n){if(e.selection&&r instanceof Document){var o=Lf(r),i=Ph.toDOMRange(e,e.selection);null==o||o.removeAllRanges(),null==o||o.addRange(i)}e.selection||Vd.select(e,md.start(e,[])),yh.set(e,!0),n.focus({preventScroll:!0})}}}},getWindow:e=>{var t=ch.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},hasDOMNode:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{editable:o=!1}=r,i=Ph.toDOMNode(e,e);try{n=Af(t)?t:t.parentElement}catch(e){if(e instanceof Error&&!e.message.includes('Permission denied to access property "nodeType"'))throw e}return!!n&&!(jf(n,"[data-slate-editor]")!==i||o&&!n.isContentEditable&&("boolean"!=typeof n.isContentEditable||jf(n,'[contenteditable="false"]')!==i)&&!n.getAttribute("data-slate-zero-width"))},hasEditableTarget:(e,t)=>Of(t)&&Ph.hasDOMNode(e,t,{editable:!0}),hasRange:(e,t)=>{var{anchor:n,focus:r}=t;return md.hasPath(e,n.path)&&md.hasPath(e,r.path)},hasSelectableTarget:(e,t)=>Ph.hasEditableTarget(e,t)||Ph.isTargetInsideNonReadonlyVoid(e,t),hasTarget:(e,t)=>Of(t)&&Ph.hasDOMNode(e,t),insertData:(e,t)=>{e.insertData(t)},insertFragmentData:(e,t)=>e.insertFragmentData(t),insertTextData:(e,t)=>e.insertTextData(t),isComposing:e=>!!bh.get(e),isFocused:e=>!!yh.get(e),isReadOnly:e=>!!vh.get(e),isTargetInsideNonReadonlyVoid:(e,t)=>{if(vh.get(e))return!1;if(!Ph.hasTarget(e,t))return!1;var n=Ph.toSlateNode(e,t);return Bc.isElement(n)&&md.isVoid(e,n)},setFragmentData:(e,t,n)=>e.setFragmentData(t,n),toDOMNode:(e,t)=>{var n,r=t===e?dh.get(e):null===(n=mh.get(e))||void 0===n?void 0:n.get(Ph.findKey(e,t));if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(_d.stringify(t)));return r},toDOMPoint:(e,t)=>{var n,[r]=md.node(e,t.path),o=Ph.toDOMNode(e,r);md.void(e,{at:t})&&(t={path:t.path,offset:0});for(var i=Array.from(o.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),a=0,s=0;s<i.length;s++){var l=i[s],u=l.childNodes[0];if(null!=u&&null!=u.textContent){var{length:c}=u.textContent,d=l.getAttribute("data-slate-length"),p=a+(null==d?c:parseInt(d,10)),f=i[s+1];if(t.offset===p&&null!=f&&f.hasAttribute("data-slate-mark-placeholder")){var h,g=f.childNodes[0];n=[g instanceof Sf?g:f,null!==(h=f.textContent)&&void 0!==h&&h.startsWith("\ufeff")?1:0];break}if(t.offset<=p){n=[u,Math.min(c,Math.max(0,t.offset-a))];break}a=p}}if(!n)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(_d.stringify(t)));return n},toDOMRange:(e,t)=>{var{anchor:n,focus:r}=t,o=Dc.isBackward(t),i=Ph.toDOMPoint(e,n),a=Dc.isCollapsed(t)?i:Ph.toDOMPoint(e,r),s=Ph.getWindow(e).document.createRange(),[l,u]=o?a:i,[c,d]=o?i:a,p=!!(Af(l)?l:l.parentElement).getAttribute("data-slate-zero-width"),f=!!(Af(c)?c:c.parentElement).getAttribute("data-slate-zero-width");return s.setStart(l,p?1:u),s.setEnd(c,f?1:d),s},toSlateNode:(e,t)=>{var n=Af(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?fh.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},toSlatePoint:(e,t,n)=>{var{exactMatch:r,suppressThrow:o,searchDirection:i}=n,[a,s]=r?t:(e=>{var[t,n]=e;if(Af(t)&&t.childNodes.length){var r=n===t.childNodes.length,o=r?n-1:n;for([t,o]=Nf(t,o,r?"backward":"forward"),r=o<n;Af(t)&&t.childNodes.length;){var i=r?t.childNodes.length-1:0;t=Rf(t,i,r?"backward":"forward")}n=r&&null!=t.textContent?t.textContent.length:0}return[t,n]})(t),l=a.parentNode,u=null,c=0;if(l){var d,p,f=Ph.toDOMNode(e,e),h=l.closest('[data-slate-void="true"]'),g=h&&$f(f,h)?h:null,m=l.closest('[contenteditable="false"]'),v=m&&$f(f,m)?m:null,y=l.closest("[data-slate-leaf]"),b=null;if(y){if(u=y.closest('[data-slate-node="text"]')){var w=Ph.getWindow(e).document.createRange();w.setStart(u,0),w.setEnd(a,s);var E=w.cloneContents();[...Array.prototype.slice.call(E.querySelectorAll("[data-slate-zero-width]")),...Array.prototype.slice.call(E.querySelectorAll("[contenteditable=false]"))].forEach(e=>{Vf&&!r&&e.hasAttribute("data-slate-zero-width")&&e.textContent.length>0&&"\ufeff"!==e.textContext?e.textContent.startsWith("\ufeff")&&(e.textContent=e.textContent.slice(1)):e.parentNode.removeChild(e)}),c=E.textContent.length,b=u}}else if(g){for(var _=g.querySelectorAll("[data-slate-leaf]"),x=0;x<_.length;x++){var k=_[x];if(Ph.hasDOMNode(e,k)){y=k;break}}y?(u=y.closest('[data-slate-node="text"]'),c=(b=y).textContent.length,b.querySelectorAll("[data-slate-zero-width]").forEach(e=>{c-=e.textContent.length})):c=1}else if(v){var C,S,T=e=>e?e.querySelectorAll("[data-slate-leaf]:not(:scope [data-slate-editor] [data-slate-leaf])"):[],D=v.closest('[data-slate-node="element"]');if("backward"===i||!i)y=null!==(C=[...T(null==D?void 0:D.previousElementSibling),...T(D)].findLast(e=>Uf(v,e)))&&void 0!==C?C:null;if("forward"===i||!i)y=null!==(S=[...T(D),...T(null==D?void 0:D.nextElementSibling)].find(e=>((e,t)=>Boolean(e.compareDocumentPosition(t)&Cf.DOCUMENT_POSITION_FOLLOWING))(v,e)))&&void 0!==S?S:null;y&&(u=y.closest('[data-slate-node="text"]'),b=y,"forward"===i?c=0:(c=b.textContent.length,b.querySelectorAll("[data-slate-zero-width]").forEach(e=>{c-=e.textContent.length})))}b&&c===b.textContent.length&&Vf&&"z"===b.getAttribute("data-slate-zero-width")&&null!==(d=b.textContent)&&void 0!==d&&d.startsWith("\ufeff")&&(l.hasAttribute("data-slate-zero-width")||Wf&&null!==(p=b.textContent)&&void 0!==p&&p.endsWith("\n\n"))&&c--}if(Vf&&!u&&!r){var A=l.hasAttribute("data-slate-node")?l:l.closest("[data-slate-node]");if(A&&Ph.hasDOMNode(e,A,{editable:!0})){var O=Ph.toSlateNode(e,A),{path:P,offset:I}=md.start(e,Ph.findPath(e,O));return A.querySelector("[data-slate-leaf]")||(I=s),{path:P,offset:I}}}if(!u){if(o)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var N=Ph.toSlateNode(e,u);return{path:Ph.findPath(e,N),offset:c}},toSlateRange:(e,t,n)=>{var r,o,i,a,s,l,{exactMatch:u,suppressThrow:c}=n;if(Pf(t)?t.anchorNode:t.startContainer)if(Pf(t)){if(Wf&&t.rangeCount>1){a=t.focusNode;var d=t.getRangeAt(0),p=t.getRangeAt(t.rangeCount-1);if(a instanceof HTMLTableRowElement&&d.startContainer instanceof HTMLTableRowElement&&p.startContainer instanceof HTMLTableRowElement){function E(e){return e.childElementCount>0?E(e.children[0]):e}var f=d.startContainer,h=p.startContainer,g=E(f.children[d.startOffset]),m=E(h.children[p.startOffset]);s=0,o=m.childNodes.length>0?m.childNodes[0]:m,a=g.childNodes.length>0?g.childNodes[0]:g,i=m instanceof HTMLElement?m.innerHTML.length:0}else d.startContainer===a?(o=p.endContainer,i=p.endOffset,s=d.startOffset):(o=d.startContainer,i=d.endOffset,s=p.startOffset)}else o=t.anchorNode,i=t.anchorOffset,a=t.focusNode,s=t.focusOffset;l=Kf&&(e=>{for(var t=e&&e.parentNode;t;){if("[object ShadowRoot]"===t.toString())return!0;t=t.parentNode}return!1})(o)||Wf?t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:t.isCollapsed}else o=t.startContainer,i=t.startOffset,a=t.endContainer,s=t.endOffset,l=t.collapsed;if(null==o||null==a||null==i||null==s)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t));Wf&&null!==(r=a.textContent)&&void 0!==r&&r.endsWith("\n\n")&&s===a.textContent.length&&s--;var v=Ph.toSlatePoint(e,[o,i],{exactMatch:u,suppressThrow:c});if(!v)return null;var y=Uf(o,a)||o===a&&s<i,b=l?v:Ph.toSlatePoint(e,[a,s],{exactMatch:u,suppressThrow:c,searchDirection:y?"forward":"backward"});if(!b)return null;var w={anchor:v,focus:b};return Dc.isExpanded(w)&&Dc.isForward(w)&&Af(a)&&md.void(e,{at:w.focus,mode:"highest"})&&(w=md.unhangRange(e,w,{voids:!0})),w}};function Ih(e,t){var{path:n,diff:r}=t;if(!md.hasPath(e,n))return!1;var o=Bc.get(e,n);if(!Bc.isText(o))return!1;if(r.start!==o.text.length||0===r.text.length)return o.text.slice(r.start,r.start+r.text.length)===r.text;var i=Ec.next(n);if(!md.hasPath(e,i))return!1;var a=Bc.get(e,i);return Bc.isText(a)&&a.text.startsWith(r.text)}function Nh(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((e,t)=>e.slice(0,t.start)+t.text+e.slice(t.end),e)}function Rh(e,t){var{start:n,end:r,text:o}=t,i=e.slice(n,r),a=function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r))return r;return n}(i,o),s=function(e,t,n){for(var r=Math.min(e.length,t.length,n),o=0;o<r;o++)if(e.charAt(e.length-o-1)!==t.charAt(t.length-o-1))return o;return r}(i,o,Math.min(i.length-a,o.length-a)),l={start:n+a,end:r-s,text:o.slice(a,o.length-s)};return l.start===l.end&&0===l.text.length?null:l}function Bh(e){var{path:t,diff:n}=e;return{anchor:{path:t,offset:n.start},focus:{path:t,offset:n.end}}}function Fh(e,t){var{path:n,offset:r}=t;if(!md.hasPath(e,n))return null;var o=Bc.get(e,n);if(!Bc.isText(o))return null;var i=md.above(e,{match:t=>Bc.isElement(t)&&md.isBlock(e,t),at:n});if(!i)return null;for(;r>o.text.length;){var a=md.next(e,{at:n,match:Bc.isText});if(!a||!Ec.isDescendant(a[1],i[1]))return null;r-=o.text.length,o=a[0],n=a[1]}return{path:n,offset:r}}function Lh(e,t){var n=Fh(e,t.anchor);if(!n)return null;if(Dc.isCollapsed(t))return{anchor:n,focus:n};var r=Fh(e,t.focus);return r?{anchor:n,focus:r}:null}function Mh(e,t,n){var r=Ch.get(e),o=null==r?void 0:r.find(e=>{var{path:n}=e;return Ec.equals(n,t.path)});if(!o||t.offset<=o.diff.start)return wd.transform(t,n,{affinity:"backward"});var{diff:i}=o;if(t.offset<=i.start+i.text.length){var a={path:t.path,offset:i.start},s=wd.transform(a,n,{affinity:"backward"});return s?{path:s.path,offset:s.offset+t.offset-i.start}:null}var l={path:t.path,offset:t.offset-i.text.length+i.end-i.start},u=wd.transform(l,n,{affinity:"backward"});return u?"split_node"===n.type&&Ec.equals(n.path,t.path)&&l.offset<n.position&&i.start<n.position?u:{path:u.path,offset:u.offset+i.text.length-i.end+i.start}:null}function Uh(e,t,n){var r=Mh(e,t.anchor,n);if(!r)return null;if(Dc.isCollapsed(t))return{anchor:r,focus:r};var o=Mh(e,t.focus,n);return o?{anchor:r,focus:o}:null}var jh=(e,t)=>{var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},$h=(e,t,n)=>{var r=Ph.toDOMRange(e,t).getBoundingClientRect(),o=Ph.toDOMRange(e,n).getBoundingClientRect();return jh(r,o)&&jh(o,r)};function zh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Hh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zh(Object(n),!0).forEach(function(t){oh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Vh=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x-slate-fragment",n=e,{apply:r,onChange:o,deleteBackward:i,addMark:a,removeMark:s}=n;return mh.set(n,new WeakMap),n.addMark=(e,t)=>{var r,o;null===(r=_h.get(n))||void 0===r||r(),!xh.get(n)&&null!==(o=Ch.get(n))&&void 0!==o&&o.length&&xh.set(n,null),kh.delete(n),a(e,t)},n.removeMark=e=>{var t;!xh.get(n)&&null!==(t=Ch.get(n))&&void 0!==t&&t.length&&xh.set(n,null),kh.delete(n),s(e)},n.deleteBackward=e=>{if("line"!==e)return i(e);if(n.selection&&Dc.isCollapsed(n.selection)){var t=md.above(n,{match:e=>Bc.isElement(e)&&md.isBlock(n,e),at:n.selection});if(t){var[,r]=t,o=md.range(n,r,n.selection.anchor),a=((e,t)=>{var n=md.range(e,Dc.end(t)),r=Array.from(md.positions(e,{at:t})),o=0,i=r.length,a=Math.floor(i/2);if($h(e,md.range(e,r[o]),n))return md.range(e,r[o],n);if(r.length<2)return md.range(e,r[r.length-1],n);for(;a!==r.length&&a!==o;)$h(e,md.range(e,r[a]),n)?i=a:o=a,a=Math.floor((o+i)/2);return md.range(e,r[o],n)})(n,o);Dc.isCollapsed(a)||Vd.delete(n,{at:a})}}},n.apply=t=>{var o=[],i=[],a=Ch.get(n);if(null!=a&&a.length){var s=a.map(e=>function(e,t){var{path:n,diff:r,id:o}=e;switch(t.type){case"insert_text":return!Ec.equals(t.path,n)||t.offset>=r.end?e:t.offset<=r.start?{diff:{start:t.text.length+r.start,end:t.text.length+r.end,text:r.text},id:o,path:n}:{diff:{start:r.start,end:r.end+t.text.length,text:r.text},id:o,path:n};case"remove_text":return!Ec.equals(t.path,n)||t.offset>=r.end?e:t.offset+t.text.length<=r.start?{diff:{start:r.start-t.text.length,end:r.end-t.text.length,text:r.text},id:o,path:n}:{diff:{start:r.start,end:r.end-t.text.length,text:r.text},id:o,path:n};case"split_node":return!Ec.equals(t.path,n)||t.position>=r.end?{diff:r,id:o,path:Ec.transform(n,t,{affinity:"backward"})}:t.position>r.start?{diff:{start:r.start,end:Math.min(t.position,r.end),text:r.text},id:o,path:n}:{diff:{start:r.start-t.position,end:r.end-t.position,text:r.text},id:o,path:Ec.transform(n,t,{affinity:"forward"})};case"merge_node":return Ec.equals(t.path,n)?{diff:{start:r.start+t.position,end:r.end+t.position,text:r.text},id:o,path:Ec.transform(n,t)}:{diff:r,id:o,path:Ec.transform(n,t)}}var i=Ec.transform(n,t);return i?{diff:r,path:i,id:o}:null}(e,t)).filter(Boolean);Ch.set(n,s)}var l=Th.get(n);l&&Th.set(n,Uh(n,l,t));var u=Sh.get(n);if(null!=u&&u.at){var c=vd.isPoint(null==u?void 0:u.at)?Mh(n,u.at,t):Uh(n,u.at,t);Sh.set(n,c?Hh(Hh({},u),{},{at:c}):null)}switch(t.type){case"insert_text":case"remove_text":case"set_node":case"split_node":o.push(...Wh(n,t.path));break;case"set_selection":var d;null===(d=wh.get(n))||void 0===d||d.unref(),wh.delete(n);break;case"insert_node":case"remove_node":o.push(...Wh(n,Ec.parent(t.path)));break;case"merge_node":var p=Ec.previous(t.path);o.push(...Wh(n,p));break;case"move_node":var f,h=Ec.common(Ec.parent(t.path),Ec.parent(t.newPath));o.push(...Wh(n,h)),Ec.isBefore(t.path,t.newPath)?(o.push(...Wh(n,Ec.parent(t.path))),f=t.newPath):(o.push(...Wh(n,Ec.parent(t.newPath))),f=t.path);var g=Bc.get(e,Ec.parent(f)),m=Ph.findKey(n,g),v=md.pathRef(n,Ec.parent(f));i.push([v,m])}switch(r(t),t.type){case"insert_node":case"remove_node":case"merge_node":case"move_node":case"split_node":case"insert_text":case"remove_text":case"set_selection":sh.set(n,!0)}for(var[y,b]of o){var[w]=md.node(n,y);gh.set(w,b)}for(var[E,_]of i){if(E.current){var[x]=md.node(n,E.current);gh.set(x,_)}E.unref()}},n.setFragmentData=e=>{var{selection:r}=n;if(r){var[o,i]=Dc.edges(r),a=md.void(n,{at:o.path}),s=md.void(n,{at:i.path});if(!Dc.isCollapsed(r)||a){var l=Ph.toDOMRange(n,r),u=l.cloneContents(),c=u.childNodes[0];if(u.childNodes.forEach(e=>{e.textContent&&""!==e.textContent.trim()&&(c=e)}),s){var[d]=s,p=l.cloneRange(),f=Ph.toDOMNode(n,d);p.setEndAfter(f),u=p.cloneContents()}if(a&&(c=u.querySelector("[data-slate-spacer]")),Array.from(u.querySelectorAll("[data-slate-zero-width]")).forEach(e=>{var t="n"===e.getAttribute("data-slate-zero-width");e.textContent=t?"\n":""}),If(c)){var h=c.ownerDocument.createElement("span");h.style.whiteSpace="pre",h.appendChild(c),u.appendChild(h),c=h}var g=n.getFragment(),m=JSON.stringify(g),v=window.btoa(encodeURIComponent(m));c.setAttribute("data-slate-fragment",v),e.setData("application/".concat(t),v);var y=u.ownerDocument.createElement("div");return y.appendChild(u),y.setAttribute("hidden","true"),u.ownerDocument.body.appendChild(y),e.setData("text/html",y.innerHTML),e.setData("text/plain",Bf(y)),u.ownerDocument.body.removeChild(y),e}}},n.insertData=e=>{n.insertFragmentData(e)||n.insertTextData(e)},n.insertFragmentData=e=>{var r=e.getData("application/".concat(t))||(e=>{var t=e.getData("text/html"),[,n]=t.match(Ff)||[];return n})(e);if(r){var o=decodeURIComponent(window.atob(r)),i=JSON.parse(o);return n.insertFragment(i),!0}return!1},n.insertTextData=e=>{var t=e.getData("text/plain");if(t){var r=t.split(/\r\n|\r|\n/),o=!1;for(var i of r)o&&Vd.splitNodes(n,{always:!0}),n.insertText(i),o=!0;return!0}return!1},n.onChange=e=>{var t=Eh.get(n);t&&t(e),o(e)},n},Wh=(e,t)=>{var n=[];for(var[r,o]of md.levels(e,{at:t})){var i=Ph.findKey(e,r);n.push([o,i])}return n},qh={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",insertSoftBreak:"shift+enter",splitBlock:"enter",undo:"mod+z"},Gh={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Kh={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Yh=e=>{var t=qh[e],n=Gh[e],r=Kh[e],o=t&&Ef(t),i=n&&Ef(n),a=r&&Ef(r);return e=>!(!o||!o(e))||(!!(Hf&&i&&i(e))||!(Hf||!a||!a(e)))},Zh={isBold:Yh("bold"),isCompose:Yh("compose"),isMoveBackward:Yh("moveBackward"),isMoveForward:Yh("moveForward"),isDeleteBackward:Yh("deleteBackward"),isDeleteForward:Yh("deleteForward"),isDeleteLineBackward:Yh("deleteLineBackward"),isDeleteLineForward:Yh("deleteLineForward"),isDeleteWordBackward:Yh("deleteWordBackward"),isDeleteWordForward:Yh("deleteWordForward"),isExtendBackward:Yh("extendBackward"),isExtendForward:Yh("extendForward"),isExtendLineBackward:Yh("extendLineBackward"),isExtendLineForward:Yh("extendLineForward"),isItalic:Yh("italic"),isMoveLineBackward:Yh("moveLineBackward"),isMoveLineForward:Yh("moveLineForward"),isMoveWordBackward:Yh("moveWordBackward"),isMoveWordForward:Yh("moveWordForward"),isRedo:Yh("redo"),isSoftBreak:Yh("insertSoftBreak"),isSplitBlock:Yh("splitBlock"),isTransposeCharacter:Yh("transposeCharacter"),isUndo:Yh("undo")};function Xh(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Qh=["anchor","focus"],Jh=["anchor","focus"];function eg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eg(Object(n),!0).forEach(function(t){oh(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ng,rg=(e,t)=>{var n,r,o=Xh(e,Qh),i=Xh(t,Jh);return e[Ah]===t[Ah]&&(n=o,r=i,Object.keys(n).length===Object.keys(r).length&&Object.keys(n).every(e=>r.hasOwnProperty(e)&&n[e]===r[e]))},og=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],o=t[n];if(!Dc.equals(r,o)||!rg(r,o))return!1}return!0},ig=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++){var r=e[n],o=t[n];if(r.anchor.offset!==o.anchor.offset||r.focus.offset!==o.focus.offset||!rg(r,o))return!1}return!0},ag=[],sg=function(){return ag.some(function(e){return e.activeTargets.length>0})},lg="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(ng||(ng={}));var ug,cg=function(e){return Object.freeze(e)},dg=function(e,t){this.inlineSize=e,this.blockSize=t,cg(this)},pg=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,cg(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),fg=function(e){return e instanceof SVGElement&&"getBBox"in e},hg=function(e){if(fg(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||e.getClientRects().length)},gg=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},mg="undefined"!=typeof window?window:{},vg=new WeakMap,yg=/auto|scroll/,bg=/^tb|vertical/,wg=/msie|trident/i.test(mg.navigator&&mg.navigator.userAgent),Eg=function(e){return parseFloat(e||"0")},_g=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new dg((n?t:e)||0,(n?e:t)||0)},xg=cg({devicePixelContentBoxSize:_g(),borderBoxSize:_g(),contentBoxSize:_g(),contentRect:new pg(0,0,0,0)}),kg=function(e,t){if(void 0===t&&(t=!1),vg.has(e)&&!t)return vg.get(e);if(hg(e))return vg.set(e,xg),xg;var n=getComputedStyle(e),r=fg(e)&&e.ownerSVGElement&&e.getBBox(),o=!wg&&"border-box"===n.boxSizing,i=bg.test(n.writingMode||""),a=!r&&yg.test(n.overflowY||""),s=!r&&yg.test(n.overflowX||""),l=r?0:Eg(n.paddingTop),u=r?0:Eg(n.paddingRight),c=r?0:Eg(n.paddingBottom),d=r?0:Eg(n.paddingLeft),p=r?0:Eg(n.borderTopWidth),f=r?0:Eg(n.borderRightWidth),h=r?0:Eg(n.borderBottomWidth),g=d+u,m=l+c,v=(r?0:Eg(n.borderLeftWidth))+f,y=p+h,b=s?e.offsetHeight-y-e.clientHeight:0,w=a?e.offsetWidth-v-e.clientWidth:0,E=o?g+v:0,_=o?m+y:0,x=r?r.width:Eg(n.width)-E-w,k=r?r.height:Eg(n.height)-_-b,C=x+g+w+v,S=k+m+b+y,T=cg({devicePixelContentBoxSize:_g(Math.round(x*devicePixelRatio),Math.round(k*devicePixelRatio),i),borderBoxSize:_g(C,S,i),contentBoxSize:_g(x,k,i),contentRect:new pg(d,l,x,k)});return vg.set(e,T),T},Cg=function(e,t,n){var r=kg(e,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case ng.DEVICE_PIXEL_CONTENT_BOX:return a;case ng.BORDER_BOX:return o;default:return i}},Sg=function(e){var t=kg(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=cg([t.borderBoxSize]),this.contentBoxSize=cg([t.contentBoxSize]),this.devicePixelContentBoxSize=cg([t.devicePixelContentBoxSize])},Tg=function(e){if(hg(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Dg=function(){var e=1/0,t=[];ag.forEach(function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach(function(t){var n=new Sg(t.target),o=Tg(t.target);r.push(n),t.lastReportedSize=Cg(t.target,t.observedBox),o<e&&(e=o)}),t.push(function(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){(0,r[n])()}return e},Ag=function(e){ag.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(Tg(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},Og=function(){var e,t=0;for(Ag(t);sg();)t=Dg(),Ag(t);return ag.some(function(e){return e.skippedTargets.length>0})&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:lg}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=lg),window.dispatchEvent(e)),t>0},Pg=[],Ig=function(e){if(!ug){var t=0,n=document.createTextNode("");new MutationObserver(function(){return Pg.splice(0).forEach(function(e){return e()})}).observe(n,{characterData:!0}),ug=function(){n.textContent="".concat(t?t--:t++)}}Pg.push(e),ug()},Ng=0,Rg={attributes:!0,characterData:!0,childList:!0,subtree:!0},Bg=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Fg=function(e){return void 0===e&&(e=0),Date.now()+e},Lg=!1,Mg=function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!Lg){Lg=!0;var n,r=Fg(e);n=function(){var n=!1;try{n=Og()}finally{if(Lg=!1,e=r-Fg(),!Ng)return;n?t.run(1e3):e>0?t.run(e):t.start()}},Ig(function(){requestAnimationFrame(n)})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Rg)};document.body?t():mg.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Bg.forEach(function(t){return mg.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Bg.forEach(function(t){return mg.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},e}(),Ug=new Mg,jg=function(e){!Ng&&e>0&&Ug.start(),!(Ng+=e)&&Ug.stop()},$g=function(){function e(e,t){this.target=e,this.observedBox=t||ng.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=Cg(this.target,this.observedBox,!0);return e=this.target,fg(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),zg=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},Hg=new WeakMap,Vg=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},Wg=function(){function e(){}return e.connect=function(e,t){var n=new zg(e,t);Hg.set(e,n)},e.observe=function(e,t,n){var r=Hg.get(e),o=0===r.observationTargets.length;Vg(r.observationTargets,t)<0&&(o&&ag.push(r),r.observationTargets.push(new $g(t,n&&n.box)),jg(1),Ug.schedule())},e.unobserve=function(e,t){var n=Hg.get(e),r=Vg(n.observationTargets,t),o=1===n.observationTargets.length;r>=0&&(o&&ag.splice(ag.indexOf(n),1),n.observationTargets.splice(r,1),jg(-1))},e.disconnect=function(e){var t=this,n=Hg.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),qg=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Wg.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!gg(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Wg.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!gg(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Wg.unobserve(this,e)},e.prototype.disconnect=function(){Wg.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function Gg(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Kg(e){return Kg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kg(e)}function Yg(e){var t=function(e,t){if("object"!==Kg(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==Kg(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Kg(t)?t:String(t)}function Zg(e,t,n){return(t=Yg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xg=Ta.createContext(null),Qg=()=>{var e=Ta.useContext(Xg);if(!e)throw new Error("The `useSlateStatic` hook must be used inside the <Slate> component's context.");return e},Jg=Ph;function em(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?em(Object(n),!0).forEach(function(t){Zg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):em(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nm(e){var{editor:t,scheduleOnDOMSelectionChange:n,onDOMSelectionChange:r}=e,o=!1,i=null,a=null,s=null,l=0,u=!1,c=()=>{var e=Th.get(t);if(Th.delete(t),e){var{selection:n}=t,r=Lh(t,e);!r||n&&Dc.equals(r,n)||Vd.select(t,r)}},d=()=>{if(a&&(clearTimeout(a),a=null),s&&(clearTimeout(s),s=null),m()||g()){o||(o=!0,setTimeout(()=>o=!1)),g()&&(o="action");var e=t.selection&&md.rangeRef(t,t.selection,{affinity:"forward"});kh.set(t,t.marks),Sh.get(t),Ch.get(t);for(var i,l=m();i=null===(d=Ch.get(t))||void 0===d?void 0:d[0];){var d,p,f=xh.get(t);void 0!==f&&(xh.delete(t),t.marks=f),f&&!1===u&&(u=null);var h=Bh(i);t.selection&&Dc.equals(t.selection,h)||Vd.select(t,h),i.diff.text?md.insertText(t,i.diff.text):md.deleteFragment(t),Ch.set(t,null===(p=Ch.get(t))||void 0===p?void 0:p.filter(e=>{var{id:t}=e;return t!==i.id})),Ih(t,i)||(l=!1,Sh.delete(t),kh.delete(t),o="action",Th.delete(t),n.cancel(),r.cancel(),null==e||e.unref())}var v=null==e?void 0:e.unref();if(!v||Th.get(t)||t.selection&&Dc.equals(v,t.selection)||Vd.select(t,v),g())(()=>{var e=Sh.get(t);if(Sh.delete(t),e){if(e.at){var n=vd.isPoint(e.at)?Fh(t,e.at):Lh(t,e.at);if(!n)return;var r=md.range(t,n);t.selection&&Dc.equals(t.selection,r)||Vd.select(t,n)}e.run()}})();else{l&&n(),n.flush(),r.flush(),c();var y=kh.get(t);kh.delete(t),void 0!==y&&(t.marks=y,t.onChange())}}else c()},p=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=ph.get(t);n&&(m()||e?n.style.display="none":n.style.removeProperty("display"))},f=(e,n)=>{var r,o=null!==(r=Ch.get(t))&&void 0!==r?r:[];Ch.set(t,o);var i=Bc.leaf(t,e),a=o.findIndex(t=>Ec.equals(t.path,e));if(a<0)return Rh(i.text,n)&&o.push({path:e,diff:n,id:l++}),void p();var s=function(e,t,n){var r=Math.min(t.start,n.start),o=Math.max(0,Math.min(t.start+t.text.length,n.end)-n.start),i=Nh(e,t,n),a=Math.max(n.start+n.text.length,t.start+t.text.length+(t.start+t.text.length>n.start?n.text.length:0)-o),s=i.slice(r,a);return Rh(e,{start:r,end:Math.max(t.end,n.end-t.text.length+(t.end-t.start)),text:s})}(i.text,o[a].diff,n);if(!s)return o.splice(a,1),void p();o[a]=tm(tm({},o[a]),{},{diff:s})},h=function(e){var{at:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u=!1,Th.delete(t),n.cancel(),r.cancel(),g()&&d(),Sh.set(t,{at:o,run:e}),s=setTimeout(d)},g=()=>!!Sh.get(t),m=()=>{var e;return!(null===(e=Ch.get(t))||void 0===e||!e.length)},v=e=>{Th.set(t,e),a&&(clearTimeout(a),a=null);var{selection:n}=t;if(e){var r=!n||!Ec.equals(n.anchor.path,e.anchor.path),o=!n||!Ec.equals(n.anchor.path.slice(0,-1),e.anchor.path.slice(0,-1));(r&&u||o)&&(u=!1),(r||m())&&(a=setTimeout(d,200))}},y=()=>{g()||(s=setTimeout(d))};return{flush:d,scheduleFlush:y,hasPendingDiffs:m,hasPendingAction:g,hasPendingChanges:()=>g()||m(),isFlushing:()=>o,handleUserSelect:v,handleCompositionEnd:e=>{i&&clearTimeout(i),i=setTimeout(()=>{bh.set(t,!1),d()},25)},handleCompositionStart:e=>{bh.set(t,!0),i&&(clearTimeout(i),i=null)},handleDOMBeforeInput:e=>{var n;if(a&&(clearTimeout(a),a=null),!sh.get(t)){var{inputType:r}=e,o=null,i=e.dataTransfer||e.data||void 0;!1!==u&&"insertText"!==r&&"insertCompositionText"!==r&&(u=!1);var[s]=e.getTargetRanges();s&&(o=Jg.toSlateRange(t,s,{exactMatch:!1,suppressThrow:!0}));var l=Jg.getWindow(t).getSelection();if(!o&&l&&(s=l,o=Jg.toSlateRange(t,l,{exactMatch:!1,suppressThrow:!0})),o=null!==(n=o)&&void 0!==n?n:t.selection){var c,d=!0;if(r.startsWith("delete")){var p=r.endsWith("Backward")?"backward":"forward",[g,m]=Dc.edges(o),[b,w]=md.leaf(t,g.path);if(Dc.isExpanded(o)&&b.text.length===g.offset&&0===m.offset){var E=md.next(t,{at:g.path,match:Bc.isText});E&&Ec.equals(E[1],m.path)&&("backward"===p?(o={anchor:m,focus:m},g=m,[b,w]=E):(o={anchor:g,focus:g},m=g))}var _={text:"",start:g.offset,end:m.offset},x=Ch.get(t),k=null==x?void 0:x.find(e=>Ec.equals(e.path,w)),C=k?[k.diff,_]:[_];if(0===Nh(b.text,...C).length&&(d=!1),Dc.isExpanded(o)){if(d&&Ec.equals(o.anchor.path,o.focus.path)){var S={path:o.anchor.path,offset:g.offset},T=md.range(t,S,S);return v(T),f(o.anchor.path,{text:"",end:m.offset,start:g.offset})}return h(()=>md.deleteFragment(t,{direction:p}),{at:o})}}switch(r){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":return h(()=>md.deleteFragment(t),{at:o});case"deleteContent":case"deleteContentForward":var{anchor:D}=o;if(d&&Dc.isCollapsed(o)){var A=Bc.leaf(t,D.path);if(D.offset<A.text.length)return f(D.path,{text:"",start:D.offset,end:D.offset+1})}return h(()=>md.deleteForward(t),{at:o});case"deleteContentBackward":var O,{anchor:P}=o,I=Pf(s)?s.isCollapsed:!(null===(O=s)||void 0===O||!O.collapsed);return d&&I&&Dc.isCollapsed(o)&&P.offset>0?f(P.path,{text:"",start:P.offset-1,end:P.offset}):h(()=>md.deleteBackward(t),{at:o});case"deleteEntireSoftLine":return h(()=>{md.deleteBackward(t,{unit:"line"}),md.deleteForward(t,{unit:"line"})},{at:o});case"deleteHardLineBackward":return h(()=>md.deleteBackward(t,{unit:"block"}),{at:o});case"deleteSoftLineBackward":return h(()=>md.deleteBackward(t,{unit:"line"}),{at:o});case"deleteHardLineForward":return h(()=>md.deleteForward(t,{unit:"block"}),{at:o});case"deleteSoftLineForward":return h(()=>md.deleteForward(t,{unit:"line"}),{at:o});case"deleteWordBackward":return h(()=>md.deleteBackward(t,{unit:"word"}),{at:o});case"deleteWordForward":return h(()=>md.deleteForward(t,{unit:"word"}),{at:o});case"insertLineBreak":return h(()=>md.insertSoftBreak(t),{at:o});case"insertParagraph":return h(()=>md.insertBreak(t),{at:o});case"insertCompositionText":case"deleteCompositionText":case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("DataTransfer"===(null==(c=i)?void 0:c.constructor.name))return h(()=>Jg.insertData(t,i),{at:o});var N=null!=i?i:"";if(xh.get(t)&&(N=N.replace("\ufeff","")),"insertText"===r&&/.*\n.*\n$/.test(N)&&(N=N.slice(0,-1)),N.includes("\n"))return h(()=>{var e=N.split("\n");e.forEach((n,r)=>{n&&md.insertText(t,n),r!==e.length-1&&md.insertSoftBreak(t)})},{at:o});if(Ec.equals(o.anchor.path,o.focus.path)){var[R,B]=Dc.edges(o),F={start:R.offset,end:B.offset,text:N};if(N&&u&&"insertCompositionText"===r){var L=u.start+u.text.search(/\S|$/);F.start+F.text.search(/\S|$/)===L+1&&F.end===u.start+u.text.length?(F.start-=1,u=null,y()):u=!1}else u="insertText"===r&&(null===u?F:!(!u||!Dc.isCollapsed(o)||u.end+u.text.length!==R.offset)&&tm(tm({},u),{},{text:u.text+N}));if(d){var M=t.selection;if(f(R.path,F),M){var U={path:R.path,offset:R.offset+N.length};h(()=>{Vd.select(t,{anchor:U,focus:U})},{at:U})}return}}return h(()=>md.insertText(t,N),{at:o})}}}},handleKeyDown:e=>{m()||(p(!0),setTimeout(p))},handleDomMutations:e=>{var n;m()||g()||e.some(n=>Mf(t,n,e))&&(null===(n=Dh.get(t))||void 0===n||n())},handleInput:()=>{!g()&&m()||d()}}}var rm=eh?Ta.useLayoutEffect:Ta.useEffect;var om=["node"];function im(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var am={subtree:!0,childList:!0,characterData:!0},sm=Vf?e=>{var{node:t}=e,n=Gg(e,om);if(!Vf)return null;var r,o=Qg(),i=(r=Ta.useRef(!1),Ta.useEffect(()=>(r.current=!0,()=>{r.current=!1}),[]),r.current),[a]=Ta.useState(()=>nm(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?im(Object(n),!0).forEach(function(t){Zg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):im(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({editor:o},n)));return function(e,t,n){var[r]=Ta.useState(()=>new MutationObserver(t));rm(()=>{r.takeRecords()}),Ta.useEffect(()=>{if(!e.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");return r.observe(e.current,n),()=>r.disconnect()},[r,e,n])}(t,a.handleDomMutations,am),_h.set(o,a.scheduleFlush),i&&a.flush(),a}:()=>null;function lm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var um=e=>{var{isLast:t,leaf:n,parent:r,text:o}=e,i=Qg(),a=Jg.findPath(i,o),s=Ec.parent(a),l=Boolean(n[Oh]);return i.isVoid(r)?Da.createElement(pm,{length:Bc.string(r).length}):""!==n.text||r.children[r.children.length-1]!==o||i.isInline(r)||""!==md.string(i,s)?""===n.text?Da.createElement(pm,{isMarkPlaceholder:l}):t&&"\n"===n.text.slice(-1)?Da.createElement(cm,{isTrailing:!0,text:n.text}):Da.createElement(cm,{text:n.text}):Da.createElement(pm,{isLineBreak:!0,isMarkPlaceholder:l})},cm=e=>{var{text:t,isTrailing:n=!1}=e,r=Ta.useRef(null),o=()=>"".concat(null!=t?t:"").concat(n?"\n":""),[i]=Ta.useState(o);return rm(()=>{var e=o();r.current&&r.current.textContent!==e&&(r.current.textContent=e)}),Da.createElement(dm,{ref:r},i)},dm=Ta.memo(Ta.forwardRef((e,t)=>Da.createElement("span",{"data-slate-string":!0,ref:t},e.children))),pm=e=>{var{length:t=0,isLineBreak:n=!1,isMarkPlaceholder:r=!1}=e,o={"data-slate-zero-width":n?"n":"z","data-slate-length":t};return r&&(o["data-slate-mark-placeholder"]=!0),Da.createElement("span",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lm(Object(n),!0).forEach(function(t){Zg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lm(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},o),Vf&&n?null:"\ufeff",n?Da.createElement("br",null):null)};function fm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fm(Object(n),!0).forEach(function(t){Zg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fm(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var gm=Vf?300:0;function mm(e){e.current&&(clearTimeout(e.current),e.current=null)}var vm=e=>Da.createElement(wm,hm({},e)),ym=e=>{var{leaf:t,isLast:n,text:r,parent:o,renderPlaceholder:i,renderLeaf:a=vm,leafPosition:s}=e,l=Qg(),u=Ta.useRef(null),c=Ta.useRef(null),[d,p]=Ta.useState(!1),f=Ta.useRef(null),h=Ta.useCallback(e=>{if(function(e,t){e.current&&(e.current.disconnect(),t&&(e.current=null))}(u,null==e),null==e){var n;ph.delete(l),null===(n=t.onPlaceholderResize)||void 0===n||n.call(t,null)}else{if(ph.set(l,e),!u.current){var r=window.ResizeObserver||qg;u.current=new r(()=>{var n;null===(n=t.onPlaceholderResize)||void 0===n||n.call(t,e)})}u.current.observe(e),c.current=e}},[c,t,l]),g=Da.createElement(um,{isLast:n,leaf:t,parent:o,text:r}),m=Boolean(t[Ah]);if(Ta.useEffect(()=>(m?f.current||(f.current=setTimeout(()=>{p(!0),f.current=null},gm)):(mm(f),p(!1)),()=>mm(f)),[m,p]),m&&d){var v={children:t.placeholder,attributes:{"data-slate-placeholder":!0,style:{position:"absolute",top:0,pointerEvents:"none",width:"100%",maxWidth:"100%",display:"block",opacity:"0.333",userSelect:"none",textDecoration:"none",WebkitUserModify:qf?"inherit":void 0},contentEditable:!1,ref:h}};g=Da.createElement(Da.Fragment,null,g,i(v))}return a({attributes:{"data-slate-leaf":!0},children:g,leaf:t,text:r,leafPosition:s})},bm=Da.memo(ym,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&Td.equals(t.leaf,e.leaf)&&t.leaf[Ah]===e.leaf[Ah]),wm=e=>{var{attributes:t,children:n}=e;return Da.createElement("span",hm({},t),n)};function Em(e,t){var n,[,r]=Ta.useReducer(e=>e+1,0),o=Ta.useRef(),i=Ta.useRef(()=>null),a=Ta.useRef(null);try{if(e!==i.current||o.current){var s=e();n=t(a.current,s)?a.current:s}else n=a.current}catch(e){throw o.current&&e instanceof Error&&(e.message+="\nThe error may be correlated with this previous error:\n".concat(o.current.stack,"\n\n")),e}return i.current=e,a.current=n,o.current=void 0,[n,Ta.useCallback(()=>{try{var e=i.current();if(t(a.current,e))return;a.current=e}catch(e){e instanceof Error?o.current=e:o.current=new Error(String(e))}r()},[])]}var _m=Ta.createContext({}),xm=(e,t)=>{var n=Qg(),{decorate:r,addEventListener:o}=Ta.useContext(_m),i=Bc.isText(e)?ig:og,[a,s]=Em(()=>{var t=Jg.findPath(n,e);return r([e,t])},i);return rm(()=>{var e=o(s);return s(),e},[o,s]),Ta.useMemo(()=>[...a,...t],[a,t])};function km(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Cm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?km(Object(n),!0).forEach(function(t){Zg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):km(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Sm=e=>Da.createElement(Am,Cm({},e)),Tm=e=>{for(var{decorations:t,isLast:n,parent:r,renderPlaceholder:o,renderLeaf:i,renderText:a=Sm,text:s}=e,l=Qg(),u=Ta.useRef(null),c=xm(s,t),d=Td.decorations(s,c),p=Jg.findKey(l,s),f=[],h=0;h<d.length;h++){var{leaf:g,position:m}=d[h];f.push(Da.createElement(bm,{isLast:n&&h===d.length-1,key:"".concat(p.id,"-").concat(h),renderPlaceholder:o,leaf:g,leafPosition:m,text:s,parent:r,renderLeaf:i}))}var v=Ta.useCallback(e=>{var t=mh.get(l);e?(null==t||t.set(p,e),hh.set(s,e),fh.set(e,s)):(null==t||t.delete(p),hh.delete(s),u.current&&fh.delete(u.current)),u.current=e},[u,l,p,s]);return a({text:s,children:f,attributes:{"data-slate-node":"text",ref:v}})},Dm=Da.memo(Tm,(e,t)=>t.parent===e.parent&&t.isLast===e.isLast&&t.renderText===e.renderText&&t.renderLeaf===e.renderLeaf&&t.renderPlaceholder===e.renderPlaceholder&&t.text===e.text&&ig(t.decorations,e.decorations)),Am=e=>{var{attributes:t,children:n}=e;return Da.createElement("span",Cm({},t),n)};function Om(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Om(Object(n),!0).forEach(function(t){Zg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Om(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Im=e=>Da.createElement(Bm,Pm({},e)),Nm=e=>{var{decorations:n,element:r,renderElement:o=Im,renderChunk:i,renderPlaceholder:a,renderLeaf:s,renderText:l}=e,u=Qg(),c=Zm(),d=u.isInline(r),p=xm(r,n),f=Jg.findKey(u,r),h=Ta.useCallback(e=>{var t=mh.get(u);e?(null==t||t.set(f,e),hh.set(r,e),fh.set(e,r)):(null==t||t.delete(f),hh.delete(r))},[u,f,r]),g=Gm({decorations:p,node:r,renderElement:o,renderChunk:i,renderPlaceholder:a,renderLeaf:s,renderText:l}),m={"data-slate-node":"element",ref:h};if(d&&(m["data-slate-inline"]=!0),!d&&md.hasInlines(u,r)){var v=Bc.string(r),y=t(v);"rtl"===y&&(m.dir=y)}if(md.isVoid(u,r)){m["data-slate-void"]=!0,!c&&d&&(m.contentEditable=!1);var b=d?"span":"div",[[w]]=Bc.texts(r);g=Da.createElement(b,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},Da.createElement(Dm,{renderPlaceholder:a,decorations:[],isLast:!1,parent:r,text:w})),lh.set(w,0),uh.set(w,r)}return o({attributes:m,children:g,element:r})},Rm=Da.memo(Nm,(e,t)=>e.element===t.element&&e.renderElement===t.renderElement&&e.renderChunk===t.renderChunk&&e.renderText===t.renderText&&e.renderLeaf===t.renderLeaf&&e.renderPlaceholder===t.renderPlaceholder&&og(e.decorations,t.decorations)),Bm=e=>{var{attributes:t,children:n,element:r}=e,o=Qg().isInline(r)?"span":"div";return Da.createElement(o,Pm(Pm({},t),{},{style:{position:"relative"}}),n)};class Fm{constructor(e,t){var{chunkSize:n,debug:r}=t;Zg(this,"root",void 0),Zg(this,"chunkSize",void 0),Zg(this,"debug",void 0),Zg(this,"reachedEnd",void 0),Zg(this,"pointerChunk",void 0),Zg(this,"pointerIndex",void 0),Zg(this,"pointerIndexStack",void 0),Zg(this,"cachedPointerNode",void 0),this.root=e,this.chunkSize=n,this.debug=null!=r&&r,this.pointerChunk=e,this.pointerIndex=-1,this.pointerIndexStack=[],this.reachedEnd=!1,this.validateState()}readLeaf(){if(this.reachedEnd)return null;for(;;){if(this.pointerIndex+1<this.pointerSiblings.length){this.pointerIndex++,this.cachedPointerNode=void 0;break}if("root"===this.pointerChunk.type)return this.reachedEnd=!0,null;this.exitChunk()}return this.validateState(),this.enterChunkUntilLeaf(!1),this.pointerNode}returnToPreviousLeaf(){if(this.reachedEnd)return this.reachedEnd=!1,void this.enterChunkUntilLeaf(!0);for(;;){if(this.pointerIndex>=1){this.pointerIndex--,this.cachedPointerNode=void 0;break}if("root"===this.pointerChunk.type)return void(this.pointerIndex=-1);this.exitChunk()}this.validateState(),this.enterChunkUntilLeaf(!0)}insertBefore(e){this.returnToPreviousLeaf(),this.insertAfter(e),this.readLeaf()}insertAfter(e){if(0!==e.length){for(var t=0,n=0;"chunk"===this.pointerChunk.type&&this.pointerIndex===this.pointerSiblings.length-1;){var r=this.chunkSize-this.pointerSiblings.length,o=Math.min(r,e.length);if(o>0){var i=e.splice(0,o);this.rawInsertAfter(i,t)}this.exitChunk(),t++}if(0!==e.length){var a=this.savePointer(),s=null;if(this.readLeaf())for(;"chunk"===this.pointerChunk.type&&0===this.pointerIndex;){var l=this.chunkSize-this.pointerSiblings.length,u=Math.min(l,e.length);if(u>0){var c=e.splice(-u,u);this.pointerIndex=-1,this.cachedPointerNode=void 0,this.rawInsertAfter(c,n),s||(s=this.savePointer())}this.exitChunk(),n++}this.restorePointer(a);var d=Math.max(t,n);this.rawInsertAfter(e,d),s&&this.restorePointer(s),this.validateState()}}}remove(){this.pointerSiblings.splice(this.pointerIndex--,1),this.cachedPointerNode=void 0,0===this.pointerSiblings.length&&"chunk"===this.pointerChunk.type?(this.exitChunk(),this.remove()):this.invalidateChunk(),this.validateState()}invalidateChunk(){for(var e=this.pointerChunk;"chunk"===e.type;e=e.parent)this.root.modifiedChunks.add(e)}get atStart(){return"root"===this.pointerChunk.type&&-1===this.pointerIndex}get pointerSiblings(){return this.pointerChunk.children}getPointerNode(){return this.reachedEnd||-1===this.pointerIndex?null:this.pointerSiblings[this.pointerIndex]}get pointerNode(){if(void 0!==this.cachedPointerNode)return this.cachedPointerNode;var e=this.getPointerNode();return this.cachedPointerNode=e,e}getChunkPath(e){for(var t=[],n=e;"chunk"===n.type;n=n.parent){var r=n.parent.children.indexOf(n);if(-1===r)return null;t.unshift(r)}return t}savePointer(){if(this.atStart)return"start";if(!this.pointerNode)throw new Error("Cannot save pointer when pointerNode is null");return{chunk:this.pointerChunk,node:this.pointerNode}}restorePointer(e){if("start"===e)return this.pointerChunk=this.root,this.pointerIndex=-1,this.pointerIndexStack=[],this.reachedEnd=!1,void(this.cachedPointerNode=void 0);var{chunk:t,node:n}=e,r=t.children.indexOf(n);if(-1===r)throw new Error("Cannot restore point because saved node is no longer in saved chunk");var o=this.getChunkPath(t);if(!o)throw new Error("Cannot restore point because saved chunk is no longer connected to root");this.pointerChunk=t,this.pointerIndex=r,this.pointerIndexStack=o,this.reachedEnd=!1,this.cachedPointerNode=n,this.validateState()}enterChunk(e){var t;if("chunk"!==(null===(t=this.pointerNode)||void 0===t?void 0:t.type))throw new Error("Cannot enter non-chunk");if(this.pointerIndexStack.push(this.pointerIndex),this.pointerChunk=this.pointerNode,this.pointerIndex=e?this.pointerSiblings.length-1:0,this.cachedPointerNode=void 0,this.validateState(),0===this.pointerChunk.children.length)throw new Error("Cannot enter empty chunk")}enterChunkUntilLeaf(e){for(;"chunk"===(null===(t=this.pointerNode)||void 0===t?void 0:t.type);){var t;this.enterChunk(e)}}exitChunk(){if("root"===this.pointerChunk.type)throw new Error("Cannot exit root");var e=this.pointerChunk;this.pointerChunk=e.parent,this.pointerIndex=this.pointerIndexStack.pop(),this.cachedPointerNode=void 0,this.validateState()}rawInsertAfter(e,t){if(0!==e.length){for(var n=(e,t,r)=>{if(1===r)return e;for(var o=[],i=0;i<this.chunkSize;i++){var a=e.slice(i*r,(i+1)*r);if(0===a.length)break;var s={type:"chunk",key:new ah,parent:t,children:[]};s.children=n(a,s,r/this.chunkSize),o.push(s)}return o},r=this.pointerSiblings.length+e.length,o=0,i=this.chunkSize;i<r;i*=this.chunkSize)o++;var a=Math.max(o,t),s=Math.pow(this.chunkSize,a),l=n(e,this.pointerChunk,s);this.pointerSiblings.splice(this.pointerIndex+1,0,...l),this.pointerIndex+=l.length,this.cachedPointerNode=void 0,this.invalidateChunk(),this.validateState()}}validateState(){if(this.debug){var e=t=>{if("chunk"===t.type){var{parent:n,children:r}=t;if(!n.children.includes(t))throw new Error("Debug: Chunk ".concat(t.key.id," has an incorrect parent property"));r.forEach(e)}};if(this.root.children.forEach(e),void 0!==this.cachedPointerNode&&this.cachedPointerNode!==this.getPointerNode())throw new Error("Debug: The cached pointer is incorrect and has not been invalidated");var t=this.getChunkPath(this.pointerChunk);if(!t)throw new Error("Debug: The pointer chunk is not connected to the root");if(!Ec.equals(this.pointerIndexStack,t))throw new Error("Debug: The cached index stack [".concat(this.pointerIndexStack.join(", "),"] does not match the path of the pointer chunk [").concat(t.join(", "),"]"))}}}class Lm{constructor(e,t){Zg(this,"editor",void 0),Zg(this,"children",void 0),Zg(this,"cachedKeys",void 0),Zg(this,"pointerIndex",void 0),this.editor=e,this.children=t,this.cachedKeys=new Array(t.length),this.pointerIndex=0}read(e){if(1===e)return[this.children[this.pointerIndex++]];var t=this.remaining(e);return this.pointerIndex+=e,t}remaining(e){return void 0===e?this.children.slice(this.pointerIndex):this.children.slice(this.pointerIndex,this.pointerIndex+e)}get reachedEnd(){return this.pointerIndex>=this.children.length}lookAhead(e,t){var n=this.children.indexOf(e,this.pointerIndex);if(n>-1)return n-this.pointerIndex;for(var r=this.pointerIndex;r<this.children.length;r++){var o=this.children[r];if(this.findKey(o,r)===t)return r-this.pointerIndex}return-1}toChunkLeaves(e,t){return e.map((e,n)=>({type:"leaf",node:e,key:this.findKey(e,t+n),index:t+n}))}findKey(e,t){var n=this.cachedKeys[t];if(n)return n;var r=Jg.findKey(this.editor,e);return this.cachedKeys[t]=r,r}}function Mm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var Um=new WeakMap,jm=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Jg.findKey(e,t),o=Um.get(r);return o||(o={type:"root",movedNodeKeys:new Set,modifiedChunks:new Set,children:[]},Um.set(r,o)),n.reconcile&&((e,t)=>{for(var n,{chunkTree:r,children:o,chunkSize:i,rerenderChildren:a=[],onInsert:s,onUpdate:l,onIndexChange:u,debug:c}=t,d=new Fm(r,{chunkSize:i,debug:c}),p=new Lm(e,o),f=function(){var e=p.lookAhead(n.node,n.key),t=e>0&&r.movedNodeKeys.has(n.key);if(-1===e||t)return d.remove(),1;var o=p.pointerIndex,i=p.read(e+1),c=i.pop();if(i.length){var f=p.toChunkLeaves(i,o);d.insertBefore(f),i.forEach((e,t)=>{null==s||s(e,o+t)})}var h=p.pointerIndex-1;n.node!==c&&(n.node=c,d.invalidateChunk(),null==l||l(c,h)),n.index!==h&&(n.index=h,null==u||u(c,h)),a.includes(h)&&d.invalidateChunk()};n=d.readLeaf();)f();if(!p.reachedEnd){var h=p.remaining(),g=p.toChunkLeaves(h,p.pointerIndex);d.returnToPreviousLeaf(),d.insertAfter(g),h.forEach((e,t)=>{null==s||s(e,p.pointerIndex+t)})}r.movedNodeKeys.clear()})(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mm(Object(n),!0).forEach(function(t){Zg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mm(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({chunkTree:o,children:t.children},n.reconcile)),o};function $m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var zm=e=>{var{children:t}=e;return t},Hm=e=>{var{root:t,ancestor:n,renderElement:r,renderChunk:o=zm}=e;return n.children.map(e=>{if("chunk"===e.type){var i=e.key.id,a=o({highest:n===t,lowest:e.children.some(e=>"leaf"===e.type),attributes:{"data-slate-chunk":!0},children:Da.createElement(Wm,{root:t,ancestor:e,renderElement:r,renderChunk:o})});return Da.createElement(Ta.Fragment,{key:i},a)}var s=e.node;return r(s,e.index,e.key)})},Vm=e=>(Ta.useEffect(()=>{e.root.modifiedChunks.clear()}),Da.createElement(Hm,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$m(Object(n),!0).forEach(function(t){Zg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e))),Wm=Da.memo(Hm,(e,t)=>e.root===t.root&&e.renderElement===t.renderElement&&e.renderChunk===t.renderChunk&&!t.root.modifiedChunks.has(t.ancestor)),qm=Ta.createContext(null),Gm=e=>{var{decorations:t,node:n,renderElement:r,renderChunk:o,renderPlaceholder:i,renderText:a,renderLeaf:s}=e,l=Qg();sh.set(l,!1);var u=Bc.isElement(n)&&!l.isInline(n)&&md.hasInlines(l,n)?null:l.getChunkSize(n),c=!!u,{decorationsByChild:d,childrenToRedecorate:p}=Km(l,n,t);c||n.children.forEach((e,t)=>{lh.set(e,t),uh.set(e,n)});var f=Ta.useCallback((e,t,n)=>{var u=null!=n?n:Jg.findKey(l,e);return Da.createElement(qm.Provider,{key:"provider-".concat(u.id),value:e},Da.createElement(Rm,{decorations:d[t],element:e,key:u.id,renderElement:r,renderChunk:o,renderPlaceholder:i,renderLeaf:s,renderText:a}))},[l,d,r,o,i,s,a]);if(!c)return n.children.map((e,t)=>Bc.isText(e)?((e,t)=>{var r=Jg.findKey(l,e);return Da.createElement(Dm,{decorations:d[t],key:r.id,isLast:t===n.children.length-1,parent:n,renderPlaceholder:i,renderLeaf:s,renderText:a,text:e})})(e,t):f(e,t));var h=jm(l,n,{reconcile:{chunkSize:u,rerenderChildren:p,onInsert:(e,t)=>{lh.set(e,t),uh.set(e,n)},onUpdate:(e,t)=>{lh.set(e,t),uh.set(e,n)},onIndexChange:(e,t)=>{lh.set(e,t)}}});return Da.createElement(Vm,{root:h,ancestor:h,renderElement:f,renderChunk:o})},Km=(e,t,n)=>{var r=((e,t,n)=>{var r=Array.from(t.children,()=>[]);if(0===n.length)return r;var o=Ph.findPath(e,t),i=o.length,a=md.range(e,o),s=new Array(t.children.length),l=t=>{var n=s[t];if(n)return n;var r=md.range(e,[...o,t]);return s[t]=r,r};for(var u of n){var c=Dc.intersection(a,u);if(c)for(var[d,p]=Dc.edges(c),f=d.path[i],h=p.path[i],g=f;g<=h;g++){var m=r[g];if(m){var v=l(g),y=Dc.intersection(v,u);y&&m.push(tg(tg({},u),y))}}}return r})(e,t,n),o=Ta.useRef(r).current,i=[];o.length=r.length;for(var a=0;a<r.length;a++){var s,l=r[a],u=null!==(s=o[a])&&void 0!==s?s:null;og(u,l)||(o[a]=l,i.push(a))}return{decorationsByChild:o,childrenToRedecorate:i}},Ym=Ta.createContext(!1),Zm=()=>Ta.useContext(Ym),Xm=Ta.createContext({});var Qm=()=>{var{addEventListener:e}=Ta.useContext(Xm),[,t]=Ta.useReducer(e=>e+1,0);if(!e)throw new Error("The `useSlate` hook must be used inside the <Slate> component's context.");return rm(()=>e(t),[e]),Qg()};var Jm={subtree:!0,childList:!0,characterData:!0,characterDataOldValue:!0};class ev extends Ta.Component{constructor(){super(...arguments),Zg(this,"context",null),Zg(this,"manager",null),Zg(this,"mutationObserver",null)}observe(){var e,{node:t}=this.props;if(!t.current)throw new Error("Failed to attach MutationObserver, `node` is undefined");null===(e=this.mutationObserver)||void 0===e||e.observe(t.current,Jm)}componentDidMount(){var{receivedUserInput:e}=this.props,t=this.context;this.manager=((e,t)=>{var n=[],r=()=>{n=[]};return{registerMutations:r=>{if(t.current){var o=r.filter(t=>Mf(e,t,r));n.push(...o)}},restoreDOM:function(){n.length>0&&(n.reverse().forEach(e=>{"characterData"!==e.type&&(e.removedNodes.forEach(t=>{e.target.insertBefore(t,e.nextSibling)}),e.addedNodes.forEach(t=>{e.target.removeChild(t)}))}),r())},clear:r}})(t,e),this.mutationObserver=new MutationObserver(this.manager.registerMutations),this.observe()}getSnapshotBeforeUpdate(){var e,t,n,r,o=null===(e=this.mutationObserver)||void 0===e?void 0:e.takeRecords();null!=o&&o.length&&(null===(r=this.manager)||void 0===r||r.registerMutations(o));return null===(t=this.mutationObserver)||void 0===t||t.disconnect(),null===(n=this.manager)||void 0===n||n.restoreDOM(),null}componentDidUpdate(){var e;null===(e=this.manager)||void 0===e||e.clear(),this.observe()}componentWillUnmount(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect()}render(){return this.props.children}}Zg(ev,"contextType",Xg);var tv=Vf?ev:e=>{var{children:t}=e;return Da.createElement(Da.Fragment,null,t)},nv=Ta.createContext(!1),rv=["autoFocus","decorate","onDOMBeforeInput","placeholder","readOnly","renderElement","renderChunk","renderLeaf","renderText","renderPlaceholder","scrollSelectionIntoView","style","as","disableDefaultStyles"],ov=["text"];function iv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function av(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iv(Object(n),!0).forEach(function(t){Zg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var sv=e=>Da.createElement(Da.Fragment,null,Gm(e)),lv=Ta.forwardRef((e,o)=>{var i=Ta.useCallback(e=>Da.createElement(uv,av({},e)),[]),{autoFocus:a,decorate:s=cv,onDOMBeforeInput:l,placeholder:u,readOnly:c=!1,renderElement:d,renderChunk:p,renderLeaf:f,renderText:h,renderPlaceholder:g=i,scrollSelectionIntoView:m=dv,style:v={},as:y="div",disableDefaultStyles:b=!1}=e,w=Gg(e,rv),E=Qm(),[_,x]=Ta.useState(!1),k=Ta.useRef(null),C=Ta.useRef([]),[S,T]=Ta.useState(),D=Ta.useRef(!1),{onUserInput:A,receivedUserInput:O}=function(){var e=Qg(),t=Ta.useRef(!1),n=Ta.useRef(0),r=Ta.useCallback(()=>{if(!t.current){t.current=!0;var r=Jg.getWindow(e);r.cancelAnimationFrame(n.current),n.current=r.requestAnimationFrame(()=>{t.current=!1})}},[e]);return Ta.useEffect(()=>()=>cancelAnimationFrame(n.current),[]),{receivedUserInput:t,onUserInput:r}}(),[,P]=Ta.useReducer(e=>e+1,0);Dh.set(E,P),vh.set(E,c);var I=Ta.useMemo(()=>({isDraggingInternally:!1,isUpdatingSelection:!1,latestElement:null,hasMarkPlaceholder:!1}),[]);Ta.useEffect(()=>{k.current&&a&&k.current.focus()},[a]);var N=Ta.useRef(),R=Ta.useMemo(()=>r(()=>{if(sh.get(E))R();else{var e=Jg.toDOMNode(E,E).getRootNode();if(!D.current&&qf&&e instanceof ShadowRoot){D.current=!0;var t=(()=>{for(var e=document.activeElement;null!==(t=e)&&void 0!==t&&t.shadowRoot&&null!==(n=e.shadowRoot)&&void 0!==n&&n.activeElement;){var t,n,r;e=null===(r=e)||void 0===r||null===(r=r.shadowRoot)||void 0===r?void 0:r.activeElement}return e})();return t?document.execCommand("indent"):Vd.deselect(E),void(D.current=!1)}var n=N.current;if((Vf||!Jg.isComposing(E))&&(!I.isUpdatingSelection||null!=n&&n.isFlushing())&&!I.isDraggingInternally){var r=Jg.findDocumentOrShadowRoot(E),{activeElement:o}=r,i=Jg.toDOMNode(E,E),a=Lf(r);if(o===i?(I.latestElement=o,yh.set(E,!0)):yh.delete(E),!a)return Vd.deselect(E);var{anchorNode:s,focusNode:l}=a,u=Jg.hasEditableTarget(E,s)||Jg.isTargetInsideNonReadonlyVoid(E,s),d=Jg.hasTarget(E,l);if(u&&d){var p=Jg.toSlateRange(E,a,{exactMatch:!1,suppressThrow:!0});p&&(Jg.isComposing(E)||null!=n&&n.hasPendingChanges()||null!=n&&n.isFlushing()?null==n||n.handleUserSelect(p):Vd.select(E,p))}!c||u&&d||Vd.deselect(E)}}},100),[E,c,I]),B=Ta.useMemo(()=>n(R,0),[R]);N.current=sm({node:k,onDOMSelectionChange:R,scheduleOnDOMSelectionChange:B}),rm(()=>{var e,t,n;k.current&&(n=Tf(k.current))?(ch.set(E,n),dh.set(E,k.current),hh.set(E,k.current),fh.set(k.current,E)):hh.delete(E);var{selection:r}=E,o=Jg.findDocumentOrShadowRoot(E),i=Lf(o);if(i&&Jg.isFocused(E)&&(null===(e=N.current)||void 0===e||!e.hasPendingAction())){var a=e=>{var t="None"!==i.type;if(r||t){var n,o=i.focusNode;if(Wf&&i.rangeCount>1){var a=i.getRangeAt(0),s=i.getRangeAt(i.rangeCount-1);n=a.startContainer===o?s.endContainer:a.startContainer}else n=i.anchorNode;var l=dh.get(E),u=!1;if($f(l,n)&&$f(l,o)&&(u=!0),t&&u&&r&&!e){var c=Jg.toSlateRange(E,i,{exactMatch:!0,suppressThrow:!0});if(c&&Dc.equals(c,r)){var d;if(!I.hasMarkPlaceholder)return;if(null!==(d=n)&&void 0!==d&&null!==(d=d.parentElement)&&void 0!==d&&d.hasAttribute("data-slate-mark-placeholder"))return}}if(!r||Jg.hasRange(E,r)){I.isUpdatingSelection=!0;var p=null;try{p=r&&Jg.toDOMRange(E,r)}catch(e){}return p?(Jg.isComposing(E)&&!Vf?i.collapseToEnd():Dc.isBackward(r)?i.setBaseAndExtent(p.endContainer,p.endOffset,p.startContainer,p.startOffset):i.setBaseAndExtent(p.startContainer,p.startOffset,p.endContainer,p.endOffset),m(E,p)):i.removeAllRanges(),p}E.selection=Jg.toSlateRange(E,i,{exactMatch:!1,suppressThrow:!0})}};i.rangeCount<=1&&a();var s="action"===(null===(t=N.current)||void 0===t?void 0:t.isFlushing());if(Vf&&s){var l=null,u=requestAnimationFrame(()=>{if(s){var e=e=>{try{Jg.toDOMNode(E,E).focus(),a(e)}catch(e){}};e(),l=setTimeout(()=>{e(!0),I.isUpdatingSelection=!1})}});return()=>{cancelAnimationFrame(u),l&&clearTimeout(l)}}setTimeout(()=>{I.isUpdatingSelection=!1})}});var F=Ta.useCallback(e=>{gv(E,e);var t=Jg.toDOMNode(E,E).getRootNode();if(null!=D&&D.current&&qf&&t instanceof ShadowRoot){var n=e.getTargetRanges()[0],r=new window.Range;r.setStart(n.startContainer,n.startOffset),r.setEnd(n.endContainer,n.endOffset);var o=Jg.toSlateRange(E,r,{exactMatch:!1,suppressThrow:!1});return Vd.select(E,o),e.preventDefault(),void e.stopImmediatePropagation()}if(A(),!c&&Jg.hasEditableTarget(E,e.target)&&!hv(e,l)){var i;if(N.current)return N.current.handleDOMBeforeInput(e);B.flush(),R.flush();var{selection:a}=E,{inputType:s}=e,u=e.dataTransfer||e.data||void 0,d="insertCompositionText"===s||"deleteCompositionText"===s;if(d&&Jg.isComposing(E))return;var p=!1;if("insertText"===s&&a&&Dc.isCollapsed(a)&&e.data&&1===e.data.length&&/[a-z ]/i.test(e.data)&&0!==a.anchor.offset&&(p=!0,E.marks&&(p=!1),!sh.get(E))){var f,h,{anchor:g}=a,[m,v]=Jg.toDOMPoint(E,g),y=null===(f=m.parentElement)||void 0===f?void 0:f.closest("a"),b=Jg.getWindow(E);if(p&&y&&Jg.hasDOMNode(E,y)){var w,_=null==b?void 0:b.document.createTreeWalker(y,NodeFilter.SHOW_TEXT).lastChild();_===m&&(null===(w=_.textContent)||void 0===w?void 0:w.length)===v&&(p=!1)}if(p&&m.parentElement&&"pre"===(null==b||null===(h=b.getComputedStyle(m.parentElement))||void 0===h?void 0:h.whiteSpace)){var k=md.above(E,{at:g.path,match:e=>Bc.isElement(e)&&md.isBlock(E,e)});k&&Bc.string(k[0]).includes("\t")&&(p=!1)}}if((!s.startsWith("delete")||s.startsWith("deleteBy"))&&!sh.get(E)){var[S]=e.getTargetRanges();if(S){var T=Jg.toSlateRange(E,S,{exactMatch:!1,suppressThrow:!1});if(!a||!Dc.equals(a,T)){p=!1;var O=!d&&E.selection&&md.rangeRef(E,E.selection);Vd.select(E,T),O&&wh.set(E,O)}}}if(d)return;if(p||e.preventDefault(),a&&Dc.isExpanded(a)&&s.startsWith("delete")){var P=s.endsWith("Backward")?"backward":"forward";return void md.deleteFragment(E,{direction:P})}switch(s){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":md.deleteFragment(E);break;case"deleteContent":case"deleteContentForward":md.deleteForward(E);break;case"deleteContentBackward":md.deleteBackward(E);break;case"deleteEntireSoftLine":md.deleteBackward(E,{unit:"line"}),md.deleteForward(E,{unit:"line"});break;case"deleteHardLineBackward":md.deleteBackward(E,{unit:"block"});break;case"deleteSoftLineBackward":md.deleteBackward(E,{unit:"line"});break;case"deleteHardLineForward":md.deleteForward(E,{unit:"block"});break;case"deleteSoftLineForward":md.deleteForward(E,{unit:"line"});break;case"deleteWordBackward":md.deleteBackward(E,{unit:"word"});break;case"deleteWordForward":md.deleteForward(E,{unit:"word"});break;case"insertLineBreak":md.insertSoftBreak(E);break;case"insertParagraph":md.insertBreak(E);break;case"insertFromComposition":case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":"insertFromComposition"===s&&Jg.isComposing(E)&&(x(!1),bh.set(E,!1)),"DataTransfer"===(null==u?void 0:u.constructor.name)?Jg.insertData(E,u):"string"==typeof u&&(p?C.current.push(()=>md.insertText(E,u)):md.insertText(E,u))}var I=null===(i=wh.get(E))||void 0===i?void 0:i.unref();wh.delete(E),!I||E.selection&&Dc.equals(E.selection,I)||Vd.select(E,I)}},[E,R,A,l,c,B]),L=Ta.useCallback(e=>{null==e?(R.cancel(),B.cancel(),dh.delete(E),hh.delete(E),k.current&&th&&k.current.removeEventListener("beforeinput",F)):th&&e.addEventListener("beforeinput",F),k.current=e,"function"==typeof o?o(e):o&&(o.current=e)},[R,B,E,F,o]);rm(()=>{var e=Jg.getWindow(E),t=e=>{var{target:t}=e,n=t instanceof HTMLElement?t:null,r=null==n?void 0:n.tagName;"INPUT"!==r&&"TEXTAREA"!==r&&B()};e.document.addEventListener("selectionchange",t);var n=()=>{I.isDraggingInternally=!1};return e.document.addEventListener("dragend",n),e.document.addEventListener("drop",n),()=>{e.document.removeEventListener("selectionchange",t),e.document.removeEventListener("dragend",n),e.document.removeEventListener("drop",n)}},[B,I]);var M=s([E,[]]),U=(e=>{var t=Ta.useRef(new Set),n=Ta.useRef(e);rm(()=>{n.current=e,t.current.forEach(e=>e())},[e]);var r=Ta.useCallback(e=>n.current(e),[]),o=Ta.useCallback(e=>(t.current.add(e),()=>{t.current.delete(e)}),[]);return Ta.useMemo(()=>({decorate:r,addEventListener:o}),[r,o])})(s),j=u&&1===E.children.length&&1===Array.from(Bc.texts(E)).length&&""===Bc.string(E)&&!_,$=Ta.useCallback(e=>{var t;e&&j?T(null===(t=e.getBoundingClientRect())||void 0===t?void 0:t.height):T(void 0)},[j]);if(j){var z=md.start(E,[]);M.push({[Ah]:!0,placeholder:u,onPlaceholderResize:$,anchor:z,focus:z})}var{marks:H}=E;if(I.hasMarkPlaceholder=!1,E.selection&&Dc.isCollapsed(E.selection)&&H){var{anchor:V}=E.selection,W=Bc.leaf(E,V.path),q=Gg(W,ov);if(!Td.equals(W,H,{loose:!0})){I.hasMarkPlaceholder=!0;var G=Object.fromEntries(Object.keys(q).map(e=>[e,null]));M.push(av(av(av({[Oh]:!0},G),H),{},{anchor:V,focus:V}))}}return Ta.useEffect(()=>{setTimeout(()=>{var{selection:e}=E;if(e){var{anchor:t}=e,n=Bc.leaf(E,t.path);if(H&&!Td.equals(n,H,{loose:!0}))return void xh.set(E,H)}xh.delete(E)})}),function(){var{flushDeferred:e}=Ta.useContext(Xm);rm(e)}(),Da.createElement(Ym.Provider,{value:c},Da.createElement(nv.Provider,{value:_},Da.createElement(_m.Provider,{value:U},Da.createElement(tv,{node:k,receivedUserInput:O},Da.createElement(y,av(av({role:c?void 0:"textbox","aria-multiline":!c||void 0,translate:"no"},w),{},{spellCheck:!(!th&&eh)&&w.spellCheck,autoCorrect:th||!eh?w.autoCorrect:"false",autoCapitalize:th||!eh?w.autoCapitalize:"false","data-slate-editor":!0,"data-slate-node":"value",contentEditable:!c,zindex:-1,suppressContentEditableWarning:!0,ref:L,style:av(av({},b?{}:av({position:"relative",whiteSpace:"pre-wrap",wordWrap:"break-word"},S?{minHeight:S}:{})),v),onBeforeInput:Ta.useCallback(e=>{if(!th&&!c&&!pv(e,w.onBeforeInput)&&Jg.hasSelectableTarget(E,e.target)&&(e.preventDefault(),!Jg.isComposing(E))){var t=e.data;md.insertText(E,t)}},[w.onBeforeInput,E,c]),onInput:Ta.useCallback(e=>{if(!pv(e,w.onInput))if(N.current)N.current.handleInput();else{for(var t of C.current)t();C.current=[],Jg.isFocused(E)||gv(E,e.nativeEvent)}},[w.onInput,E]),onBlur:Ta.useCallback(e=>{if(!c&&!I.isUpdatingSelection&&Jg.hasSelectableTarget(E,e.target)&&!pv(e,w.onBlur)){var t=Jg.findDocumentOrShadowRoot(E);if(I.latestElement!==t.activeElement){var{relatedTarget:n}=e;if(!(n===Jg.toDOMNode(E,E)||Af(n)&&n.hasAttribute("data-slate-spacer"))){if(null!=n&&Of(n)&&Jg.hasDOMNode(E,n)){var r=Jg.toSlateNode(E,n);if(Bc.isElement(r)&&!E.isVoid(r))return}if(qf){var o=Lf(t);null==o||o.removeAllRanges()}yh.delete(E)}}}},[c,I.isUpdatingSelection,I.latestElement,E,w.onBlur]),onClick:Ta.useCallback(e=>{if(Jg.hasTarget(E,e.target)&&!pv(e,w.onClick)&&Of(e.target)){var t=Jg.toSlateNode(E,e.target),n=Jg.findPath(E,t);if(!md.hasPath(E,n)||Bc.get(E,n)!==t)return;if(3===e.detail&&n.length>=1){var r=n;if(!Bc.isElement(t)||!md.isBlock(E,t)){var o,i=md.above(E,{match:e=>Bc.isElement(e)&&md.isBlock(E,e),at:n});r=null!==(o=null==i?void 0:i[1])&&void 0!==o?o:n.slice(0,1)}var a=md.range(E,r);return void Vd.select(E,a)}if(c)return;var s=md.start(E,n),l=md.end(E,n),u=md.void(E,{at:s}),d=md.void(E,{at:l});if(u&&d&&Ec.equals(u[1],d[1])){var p=md.range(E,s);Vd.select(E,p)}}},[E,w.onClick,c]),onCompositionEnd:Ta.useCallback(e=>{if(!fv(e)&&Jg.hasSelectableTarget(E,e.target)){var t;if(Jg.isComposing(E)&&Promise.resolve().then(()=>{x(!1),bh.set(E,!1)}),null===(t=N.current)||void 0===t||t.handleCompositionEnd(e),pv(e,w.onCompositionEnd)||Vf)return;if(!qf&&!Xf&&!zf&&!Jf&&!Qf&&e.data){var n=xh.get(E);xh.delete(E),void 0!==n&&(kh.set(E,E.marks),E.marks=n),md.insertText(E,e.data);var r=kh.get(E);kh.delete(E),void 0!==r&&(E.marks=r)}}},[w.onCompositionEnd,E]),onCompositionUpdate:Ta.useCallback(e=>{!Jg.hasSelectableTarget(E,e.target)||pv(e,w.onCompositionUpdate)||fv(e)||Jg.isComposing(E)||(x(!0),bh.set(E,!0))},[w.onCompositionUpdate,E]),onCompositionStart:Ta.useCallback(e=>{if(!fv(e)&&Jg.hasSelectableTarget(E,e.target)){var t;if(null===(t=N.current)||void 0===t||t.handleCompositionStart(e),pv(e,w.onCompositionStart)||Vf)return;x(!0);var{selection:n}=E;if(n&&Dc.isExpanded(n))return void md.deleteFragment(E)}},[w.onCompositionStart,E]),onCopy:Ta.useCallback(e=>{!Jg.hasSelectableTarget(E,e.target)||pv(e,w.onCopy)||fv(e)||(e.preventDefault(),Jg.setFragmentData(E,e.clipboardData,"copy"))},[w.onCopy,E]),onCut:Ta.useCallback(e=>{if(!c&&Jg.hasSelectableTarget(E,e.target)&&!pv(e,w.onCut)&&!fv(e)){e.preventDefault(),Jg.setFragmentData(E,e.clipboardData,"cut");var{selection:t}=E;if(t)if(Dc.isExpanded(t))md.deleteFragment(E);else{var n=Bc.parent(E,t.anchor.path);md.isVoid(E,n)&&Vd.delete(E)}}},[c,E,w.onCut]),onDragOver:Ta.useCallback(e=>{if(Jg.hasTarget(E,e.target)&&!pv(e,w.onDragOver)){var t=Jg.toSlateNode(E,e.target);Bc.isElement(t)&&md.isVoid(E,t)&&e.preventDefault()}},[w.onDragOver,E]),onDragStart:Ta.useCallback(e=>{if(!c&&Jg.hasTarget(E,e.target)&&!pv(e,w.onDragStart)){var t=Jg.toSlateNode(E,e.target),n=Jg.findPath(E,t);if(Bc.isElement(t)&&md.isVoid(E,t)||md.void(E,{at:n,voids:!0})){var r=md.range(E,n);Vd.select(E,r)}I.isDraggingInternally=!0,Jg.setFragmentData(E,e.dataTransfer,"drag")}},[c,E,w.onDragStart,I]),onDrop:Ta.useCallback(e=>{if(!c&&Jg.hasTarget(E,e.target)&&!pv(e,w.onDrop)){e.preventDefault();var t=E.selection,n=Jg.findEventRange(E,e),r=e.dataTransfer;Vd.select(E,n),I.isDraggingInternally&&(!t||Dc.equals(t,n)||md.void(E,{at:n,voids:!0})||Vd.delete(E,{at:t})),Jg.insertData(E,r),Jg.isFocused(E)||Jg.focus(E)}},[c,E,w.onDrop,I]),onDragEnd:Ta.useCallback(e=>{!c&&I.isDraggingInternally&&w.onDragEnd&&Jg.hasTarget(E,e.target)&&w.onDragEnd(e)},[c,I,w,E]),onFocus:Ta.useCallback(e=>{if(!c&&!I.isUpdatingSelection&&Jg.hasEditableTarget(E,e.target)&&!pv(e,w.onFocus)){var t=Jg.toDOMNode(E,E),n=Jg.findDocumentOrShadowRoot(E);if(I.latestElement=n.activeElement,Wf&&e.target!==t)return void t.focus();yh.set(E,!0)}},[c,I,E,w.onFocus]),onKeyDown:Ta.useCallback(e=>{if(!c&&Jg.hasEditableTarget(E,e.target)){var n;null===(n=N.current)||void 0===n||n.handleKeyDown(e);var{nativeEvent:r}=e;if(Jg.isComposing(E)&&!1===r.isComposing&&(bh.set(E,!1),x(!1)),pv(e,w.onKeyDown)||Jg.isComposing(E))return;var{selection:o}=E,i=E.children[null!==o?o.focus.path[0]:0],a="rtl"===t(Bc.string(i));if(Zh.isRedo(r)){e.preventDefault();var s=E;return void("function"==typeof s.redo&&s.redo())}if(Zh.isUndo(r)){e.preventDefault();var l=E;return void("function"==typeof l.undo&&l.undo())}if(Zh.isMoveLineBackward(r))return e.preventDefault(),void Vd.move(E,{unit:"line",reverse:!0});if(Zh.isMoveLineForward(r))return e.preventDefault(),void Vd.move(E,{unit:"line"});if(Zh.isExtendLineBackward(r))return e.preventDefault(),void Vd.move(E,{unit:"line",edge:"focus",reverse:!0});if(Zh.isExtendLineForward(r))return e.preventDefault(),void Vd.move(E,{unit:"line",edge:"focus"});if(Zh.isMoveBackward(r))return e.preventDefault(),void(o&&Dc.isCollapsed(o)?Vd.move(E,{reverse:!a}):Vd.collapse(E,{edge:a?"end":"start"}));if(Zh.isMoveForward(r))return e.preventDefault(),void(o&&Dc.isCollapsed(o)?Vd.move(E,{reverse:a}):Vd.collapse(E,{edge:a?"start":"end"}));if(Zh.isMoveWordBackward(r))return e.preventDefault(),o&&Dc.isExpanded(o)&&Vd.collapse(E,{edge:"focus"}),void Vd.move(E,{unit:"word",reverse:!a});if(Zh.isMoveWordForward(r))return e.preventDefault(),o&&Dc.isExpanded(o)&&Vd.collapse(E,{edge:"focus"}),void Vd.move(E,{unit:"word",reverse:a});if(th){if((Kf||qf)&&o&&(Zh.isDeleteBackward(r)||Zh.isDeleteForward(r))&&Dc.isCollapsed(o)){var u=Bc.parent(E,o.anchor.path);if(Bc.isElement(u)&&md.isVoid(E,u)&&(md.isInline(E,u)||md.isBlock(E,u)))return e.preventDefault(),void md.deleteBackward(E,{unit:"block"})}}else{if(Zh.isBold(r)||Zh.isItalic(r)||Zh.isTransposeCharacter(r))return void e.preventDefault();if(Zh.isSoftBreak(r))return e.preventDefault(),void md.insertSoftBreak(E);if(Zh.isSplitBlock(r))return e.preventDefault(),void md.insertBreak(E);if(Zh.isDeleteBackward(r))return e.preventDefault(),void(o&&Dc.isExpanded(o)?md.deleteFragment(E,{direction:"backward"}):md.deleteBackward(E));if(Zh.isDeleteForward(r))return e.preventDefault(),void(o&&Dc.isExpanded(o)?md.deleteFragment(E,{direction:"forward"}):md.deleteForward(E));if(Zh.isDeleteLineBackward(r))return e.preventDefault(),void(o&&Dc.isExpanded(o)?md.deleteFragment(E,{direction:"backward"}):md.deleteBackward(E,{unit:"line"}));if(Zh.isDeleteLineForward(r))return e.preventDefault(),void(o&&Dc.isExpanded(o)?md.deleteFragment(E,{direction:"forward"}):md.deleteForward(E,{unit:"line"}));if(Zh.isDeleteWordBackward(r))return e.preventDefault(),void(o&&Dc.isExpanded(o)?md.deleteFragment(E,{direction:"backward"}):md.deleteBackward(E,{unit:"word"}));if(Zh.isDeleteWordForward(r))return e.preventDefault(),void(o&&Dc.isExpanded(o)?md.deleteFragment(E,{direction:"forward"}):md.deleteForward(E,{unit:"word"}))}}},[c,E,w.onKeyDown]),onPaste:Ta.useCallback(e=>{c||!Jg.hasEditableTarget(E,e.target)||pv(e,w.onPaste)||(!th||(e=>e.clipboardData&&""!==e.clipboardData.getData("text/plain")&&1===e.clipboardData.types.length)(e.nativeEvent)||qf)&&(e.preventDefault(),Jg.insertData(E,e.clipboardData))},[c,E,w.onPaste])}),Da.createElement(sv,{decorations:M,node:E,renderElement:d,renderChunk:p,renderPlaceholder:g,renderLeaf:f,renderText:h}))))))}),uv=e=>{var{attributes:t,children:n}=e;return Da.createElement("span",av({},t),n,Vf&&Da.createElement("br",null))},cv=()=>[],dv=(e,t)=>{var n=!!e.selection&&Dc.isBackward(e.selection),r=t.cloneRange();if(r.collapse(n),r.getBoundingClientRect){var o=r.startContainer.parentElement,i=r.getBoundingClientRect();if(0===i.width&&0===i.height&&0===i.x&&0===i.y){var a=o.getBoundingClientRect();if(a.width>0||a.height>0)return}o.getBoundingClientRect=r.getBoundingClientRect.bind(r),uf(o,{scrollMode:"if-needed"}),delete o.getBoundingClientRect}},pv=(e,t)=>{if(!t)return!1;var n=t(e);return null!=n?n:e.isDefaultPrevented()||e.isPropagationStopped()},fv=e=>Of(e.target)&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement),hv=(e,t)=>{if(!t)return!1;var n=t(e);return null!=n?n:e.defaultPrevented},gv=(e,t)=>{var n=e;"historyUndo"!==t.inputType||"function"!=typeof n.undo?"historyRedo"!==t.inputType||"function"!=typeof n.redo||n.redo():n.undo()},mv=Ta.createContext(!1),vv=parseInt(Da.version.split(".")[0],10),yv=["editor","children","onChange","onSelectionChange","onValueChange","initialValue"],bv=e=>{var{editor:t,children:n,onChange:r,onSelectionChange:o,onValueChange:i,initialValue:a}=e,s=Gg(e,yv);Da.useState(()=>{if(!Bc.isNodeList(a))throw new Error("[Slate] initialValue is invalid! Expected a list of elements but got: ".concat(_d.stringify(a)));if(!md.isEditor(t))throw new Error("[Slate] editor is invalid! You passed: ".concat(_d.stringify(t)));t.children=a,Object.assign(t,s)});var{selectorContext:l,onChange:u}=function(){var e=Ta.useRef(new Set),t=Ta.useRef(new Set),n=Ta.useCallback(()=>{e.current.forEach(e=>e())},[]),r=Ta.useCallback(()=>{t.current.forEach(e=>e()),t.current.clear()},[]),o=Ta.useCallback(function(n){var{deferred:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r?()=>t.current.add(n):n;return e.current.add(o),()=>{e.current.delete(o)}},[]);return{selectorContext:Ta.useMemo(()=>({addEventListener:o,flushDeferred:r}),[o,r]),onChange:n}}(),c=Ta.useCallback(()=>{r&&r(t.children),o&&t.operations.find(e=>"set_selection"===e.type)&&o(t.selection),i&&t.operations.find(e=>"set_selection"!==e.type)&&i(t.children),u()},[t,u,r,o,i]);Ta.useEffect(()=>(Eh.set(t,c),()=>{Eh.set(t,()=>{})}),[t,c]);var[d,p]=Ta.useState(Jg.isFocused(t));return Ta.useEffect(()=>{p(Jg.isFocused(t))},[t]),rm(()=>{var e=()=>p(Jg.isFocused(t));return vv>=17?(document.addEventListener("focusin",e),document.addEventListener("focusout",e),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",e)}):(document.addEventListener("focus",e,!0),document.addEventListener("blur",e,!0),()=>{document.removeEventListener("focus",e,!0),document.removeEventListener("blur",e,!0)})},[]),Da.createElement(Xm.Provider,{value:l},Da.createElement(Xg.Provider,{value:t},Da.createElement(mv.Provider,{value:d},n)))},wv=(e,t)=>{t&&Gp(e,()=>{(e=>{Vd.deselect(e)})(e),((e,t)=>{Vd.select(e,t)})(e,t)}),Jg.focus(e)},Ev=(e,{edge:t="start"}={})=>{const n="start"===t?((e,t)=>md.start(e,t))(e,[]):Zp(e,[]);wv(e,n)},_v=Array.isArray,xv=_v;var kv=Bn(function(){if(!arguments.length)return[];var e=arguments[0];return xv(e)?e:[e]});var Cv=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o};var Sv=function(){this.__data__=[],this.size=0};var Tv=function(e,t){return e===t||e!=e&&t!=t},Dv=Tv;var Av=function(e,t){for(var n=e.length;n--;)if(Dv(e[n][0],t))return n;return-1},Ov=Av,Pv=Array.prototype.splice;var Iv=function(e){var t=this.__data__,n=Ov(t,e);return!(n<0)&&(n==t.length-1?t.pop():Pv.call(t,n,1),--this.size,!0)},Nv=Av;var Rv=function(e){var t=this.__data__,n=Nv(t,e);return n<0?void 0:t[n][1]},Bv=Av;var Fv=Av;var Lv=function(e,t){var n=this.__data__,r=Fv(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Mv=Sv,Uv=Iv,jv=Rv,$v=function(e){return Bv(this.__data__,e)>-1},zv=Lv;function Hv(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hv.prototype.clear=Mv,Hv.prototype.delete=Uv,Hv.prototype.get=jv,Hv.prototype.has=$v,Hv.prototype.set=zv;var Vv=Hv,Wv=Vv;var qv=function(){this.__data__=new Wv,this.size=0};var Gv=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var Kv=function(e){return this.__data__.get(e)};var Yv=function(e){return this.__data__.has(e)},Zv="object"==typeof Rn&&Rn&&Rn.Object===Object&&Rn,Xv=Zv,Qv="object"==typeof self&&self&&self.Object===Object&&self,Jv=Xv||Qv||Function("return this")(),ey=Jv.Symbol,ty=ey,ny=Object.prototype,ry=ny.hasOwnProperty,oy=ny.toString,iy=ty?ty.toStringTag:void 0;var ay=function(e){var t=ry.call(e,iy),n=e[iy];try{e[iy]=void 0;var r=!0}catch(e){}var o=oy.call(e);return r&&(t?e[iy]=n:delete e[iy]),o},sy=Object.prototype.toString;var ly=ay,uy=function(e){return sy.call(e)},cy=ey?ey.toStringTag:void 0;var dy=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":cy&&cy in Object(e)?ly(e):uy(e)};var py=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},fy=dy,hy=py;var gy,my=function(e){if(!hy(e))return!1;var t=fy(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},vy=Jv["__core-js_shared__"],yy=(gy=/[^.]+$/.exec(vy&&vy.keys&&vy.keys.IE_PROTO||""))?"Symbol(src)_1."+gy:"";var by=function(e){return!!yy&&yy in e},wy=Function.prototype.toString;var Ey=function(e){if(null!=e){try{return wy.call(e)}catch(e){}try{return e+""}catch(e){}}return""},_y=my,xy=by,ky=py,Cy=Ey,Sy=/^\[object .+?Constructor\]$/,Ty=Function.prototype,Dy=Object.prototype,Ay=Ty.toString,Oy=Dy.hasOwnProperty,Py=RegExp("^"+Ay.call(Oy).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Iy=function(e){return!(!ky(e)||xy(e))&&(_y(e)?Py:Sy).test(Cy(e))},Ny=function(e,t){return null==e?void 0:e[t]};var Ry=function(e,t){var n=Ny(e,t);return Iy(n)?n:void 0},By=Ry(Jv,"Map"),Fy=Ry(Object,"create"),Ly=Fy;var My=function(){this.__data__=Ly?Ly(null):{},this.size=0};var Uy=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},jy=Fy,$y=Object.prototype.hasOwnProperty;var zy=function(e){var t=this.__data__;if(jy){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return $y.call(t,e)?t[e]:void 0},Hy=Fy,Vy=Object.prototype.hasOwnProperty;var Wy=Fy;var qy=My,Gy=Uy,Ky=zy,Yy=function(e){var t=this.__data__;return Hy?void 0!==t[e]:Vy.call(t,e)},Zy=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wy&&void 0===t?"__lodash_hash_undefined__":t,this};function Xy(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xy.prototype.clear=qy,Xy.prototype.delete=Gy,Xy.prototype.get=Ky,Xy.prototype.has=Yy,Xy.prototype.set=Zy;var Qy=Xy,Jy=Vv,eb=By;var tb=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var nb=function(e,t){var n=e.__data__;return tb(t)?n["string"==typeof t?"string":"hash"]:n.map},rb=nb;var ob=nb;var ib=nb;var ab=nb;var sb=function(e,t){var n=ab(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},lb=function(){this.size=0,this.__data__={hash:new Qy,map:new(eb||Jy),string:new Qy}},ub=function(e){var t=rb(this,e).delete(e);return this.size-=t?1:0,t},cb=function(e){return ob(this,e).get(e)},db=function(e){return ib(this,e).has(e)},pb=sb;function fb(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}fb.prototype.clear=lb,fb.prototype.delete=ub,fb.prototype.get=cb,fb.prototype.has=db,fb.prototype.set=pb;var hb=fb,gb=Vv,mb=By,vb=hb;var yb=Vv,bb=qv,wb=Gv,Eb=Kv,_b=Yv,xb=function(e,t){var n=this.__data__;if(n instanceof gb){var r=n.__data__;if(!mb||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new vb(r)}return n.set(e,t),this.size=n.size,this};function kb(e){var t=this.__data__=new yb(e);this.size=t.size}kb.prototype.clear=bb,kb.prototype.delete=wb,kb.prototype.get=Eb,kb.prototype.has=_b,kb.prototype.set=xb;var Cb=kb;var Sb=hb,Tb=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Db=function(e){return this.__data__.has(e)};function Ab(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Sb;++t<n;)this.add(e[t])}Ab.prototype.add=Ab.prototype.push=Tb,Ab.prototype.has=Db;var Ob=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};var Pb=function(e,t){return e.has(t)},Ib=Ab,Nb=Ob,Rb=Pb;var Bb=function(e,t,n,r,o,i){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,p=!0,f=2&n?new Ib:void 0;for(i.set(e,t),i.set(t,e);++d<s;){var h=e[d],g=t[d];if(r)var m=a?r(g,h,d,t,e,i):r(h,g,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(f){if(!Nb(t,function(e,t){if(!Rb(f,t)&&(h===e||o(h,e,n,r,i)))return f.push(t)})){p=!1;break}}else if(h!==g&&!o(h,g,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p},Fb=Jv.Uint8Array;var Lb=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n};var Mb=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},Ub=Fb,jb=Tv,$b=Bb,zb=Lb,Hb=Mb,Vb=ey?ey.prototype:void 0,Wb=Vb?Vb.valueOf:void 0;var qb=function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Ub(e),new Ub(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return jb(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=zb;case"[object Set]":var l=1&r;if(s||(s=Hb),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var c=$b(s(e),s(t),r,o,i,a);return a.delete(e),c;case"[object Symbol]":if(Wb)return Wb.call(e)==Wb.call(t)}return!1};var Gb=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e},Kb=Gb,Yb=_v;var Zb=function(e,t,n){var r=t(e);return Yb(e)?r:Kb(r,n(e))};var Xb=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i};var Qb=function(){return[]},Jb=Xb,ew=Qb,tw=Object.prototype.propertyIsEnumerable,nw=Object.getOwnPropertySymbols,rw=nw?function(e){return null==e?[]:(e=Object(e),Jb(nw(e),function(t){return tw.call(e,t)}))}:ew;var ow=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var iw=function(e){return null!=e&&"object"==typeof e},aw=dy,sw=iw;var lw=function(e){return sw(e)&&"[object Arguments]"==aw(e)},uw=iw,cw=Object.prototype,dw=cw.hasOwnProperty,pw=cw.propertyIsEnumerable,fw=lw(function(){return arguments}())?lw:function(e){return uw(e)&&dw.call(e,"callee")&&!pw.call(e,"callee")},hw={exports:{}};var gw=function(){return!1};!function(e,t){var n=Jv,r=gw,o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r;e.exports=s}(hw,hw.exports);var mw=hw.exports,vw=/^(?:0|[1-9]\d*)$/;var yw=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&vw.test(e))&&e>-1&&e%1==0&&e<t};var bw=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},ww=dy,Ew=bw,_w=iw,xw={};xw["[object Float32Array]"]=xw["[object Float64Array]"]=xw["[object Int8Array]"]=xw["[object Int16Array]"]=xw["[object Int32Array]"]=xw["[object Uint8Array]"]=xw["[object Uint8ClampedArray]"]=xw["[object Uint16Array]"]=xw["[object Uint32Array]"]=!0,xw["[object Arguments]"]=xw["[object Array]"]=xw["[object ArrayBuffer]"]=xw["[object Boolean]"]=xw["[object DataView]"]=xw["[object Date]"]=xw["[object Error]"]=xw["[object Function]"]=xw["[object Map]"]=xw["[object Number]"]=xw["[object Object]"]=xw["[object RegExp]"]=xw["[object Set]"]=xw["[object String]"]=xw["[object WeakMap]"]=!1;var kw=function(e){return _w(e)&&Ew(e.length)&&!!xw[ww(e)]};var Cw=function(e){return function(t){return e(t)}},Sw={exports:{}};!function(e,t){var n=Zv,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}(Sw,Sw.exports);var Tw=Sw.exports,Dw=kw,Aw=Cw,Ow=Tw&&Tw.isTypedArray,Pw=Ow?Aw(Ow):Dw,Iw=ow,Nw=fw,Rw=_v,Bw=mw,Fw=yw,Lw=Pw,Mw=Object.prototype.hasOwnProperty;var Uw=function(e,t){var n=Rw(e),r=!n&&Nw(e),o=!n&&!r&&Bw(e),i=!n&&!r&&!o&&Lw(e),a=n||r||o||i,s=a?Iw(e.length,String):[],l=s.length;for(var u in e)!t&&!Mw.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Fw(u,l))||s.push(u);return s},jw=Object.prototype;var $w=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||jw)};var zw=function(e,t){return function(n){return e(t(n))}},Hw=zw(Object.keys,Object),Vw=$w,Ww=Hw,qw=Object.prototype.hasOwnProperty;var Gw=my,Kw=bw;var Yw=function(e){return null!=e&&Kw(e.length)&&!Gw(e)},Zw=Uw,Xw=function(e){if(!Vw(e))return Ww(e);var t=[];for(var n in Object(e))qw.call(e,n)&&"constructor"!=n&&t.push(n);return t},Qw=Yw;var Jw=function(e){return Qw(e)?Zw(e):Xw(e)},eE=Zb,tE=rw,nE=Jw;var rE=function(e){return eE(e,nE,tE)},oE=rE,iE=Object.prototype.hasOwnProperty;var aE=function(e,t,n,r,o,i){var a=1&n,s=oE(e),l=s.length;if(l!=oE(t).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in t:iE.call(t,c)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var f=!0;i.set(e,t),i.set(t,e);for(var h=a;++u<l;){var g=e[c=s[u]],m=t[c];if(r)var v=a?r(m,g,c,t,e,i):r(g,m,c,e,t,i);if(!(void 0===v?g===m||o(g,m,n,r,i):v)){f=!1;break}h||(h="constructor"==c)}if(f&&!h){var y=e.constructor,b=t.constructor;y==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(f=!1)}return i.delete(e),i.delete(t),f},sE=Ry(Jv,"DataView"),lE=By,uE=Ry(Jv,"Promise"),cE=Ry(Jv,"Set"),dE=Ry(Jv,"WeakMap"),pE=dy,fE=Ey,hE="[object Map]",gE="[object Promise]",mE="[object Set]",vE="[object WeakMap]",yE="[object DataView]",bE=fE(sE),wE=fE(lE),EE=fE(uE),_E=fE(cE),xE=fE(dE),kE=pE;(sE&&kE(new sE(new ArrayBuffer(1)))!=yE||lE&&kE(new lE)!=hE||uE&&kE(uE.resolve())!=gE||cE&&kE(new cE)!=mE||dE&&kE(new dE)!=vE)&&(kE=function(e){var t=pE(e),n="[object Object]"==t?e.constructor:void 0,r=n?fE(n):"";if(r)switch(r){case bE:return yE;case wE:return hE;case EE:return gE;case _E:return mE;case xE:return vE}return t});var CE=kE,SE=Cb,TE=Bb,DE=qb,AE=aE,OE=CE,PE=_v,IE=mw,NE=Pw,RE="[object Arguments]",BE="[object Array]",FE="[object Object]",LE=Object.prototype.hasOwnProperty;var ME=function(e,t,n,r,o,i){var a=PE(e),s=PE(t),l=a?BE:OE(e),u=s?BE:OE(t),c=(l=l==RE?FE:l)==FE,d=(u=u==RE?FE:u)==FE,p=l==u;if(p&&IE(e)){if(!IE(t))return!1;a=!0,c=!1}if(p&&!c)return i||(i=new SE),a||NE(e)?TE(e,t,n,r,o,i):DE(e,t,l,n,r,o,i);if(!(1&n)){var f=c&&LE.call(e,"__wrapped__"),h=d&&LE.call(t,"__wrapped__");if(f||h){var g=f?e.value():e,m=h?t.value():t;return i||(i=new SE),o(g,m,n,r,i)}}return!!p&&(i||(i=new SE),AE(e,t,n,r,o,i))},UE=iw;var jE=function e(t,n,r,o,i){return t===n||(null==t||null==n||!UE(t)&&!UE(n)?t!=t&&n!=n:ME(t,n,r,o,e,i))},$E=Cb,zE=jE;var HE=function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var s=n[o];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++o<i;){var l=(s=n[o])[0],u=e[l],c=s[1];if(a&&s[2]){if(void 0===u&&!(l in e))return!1}else{var d=new $E;if(r)var p=r(u,c,l,e,t,d);if(!(void 0===p?zE(c,u,3,r,d):p))return!1}}return!0},VE=py;var WE=function(e){return e==e&&!VE(e)},qE=WE,GE=Jw;var KE=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},YE=HE,ZE=function(e){for(var t=GE(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,qE(o)]}return t},XE=KE;var QE=function(e){var t=ZE(e);return 1==t.length&&t[0][2]?XE(t[0][0],t[0][1]):function(n){return n===e||YE(n,e,t)}},JE=dy,e_=iw;var t_=function(e){return"symbol"==typeof e||e_(e)&&"[object Symbol]"==JE(e)},n_=_v,r_=t_,o_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i_=/^\w*$/;var a_=function(e,t){if(n_(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!r_(e))||(i_.test(e)||!o_.test(e)||null!=t&&e in Object(t))},s_=hb;function l_(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(l_.Cache||s_),n}l_.Cache=s_;var u_=l_;var c_=function(e){var t=u_(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t},d_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p_=/\\(\\)?/g,f_=c_(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(d_,function(e,n,r,o){t.push(r?o.replace(p_,"$1"):n||e)}),t}),h_=f_,g_=Cv,m_=_v,v_=t_,y_=ey?ey.prototype:void 0,b_=y_?y_.toString:void 0;var w_=function e(t){if("string"==typeof t)return t;if(m_(t))return g_(t,e)+"";if(v_(t))return b_?b_.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},E_=w_;var __=_v,x_=a_,k_=h_,C_=function(e){return null==e?"":E_(e)};var S_=function(e,t){return __(e)?e:x_(e,t)?[e]:k_(C_(e))},T_=t_;var D_=function(e){if("string"==typeof e||T_(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},A_=S_,O_=D_;var P_=function(e,t){for(var n=0,r=(t=A_(t,e)).length;null!=e&&n<r;)e=e[O_(t[n++])];return n&&n==r?e:void 0},I_=P_;var N_=function(e,t,n){var r=null==e?void 0:I_(e,t);return void 0===r?n:r};var R_=S_,B_=fw,F_=_v,L_=yw,M_=bw,U_=D_;var j_=function(e,t,n){for(var r=-1,o=(t=R_(t,e)).length,i=!1;++r<o;){var a=U_(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&M_(o)&&L_(a,o)&&(F_(e)||B_(e))},$_=function(e,t){return null!=e&&t in Object(e)},z_=j_;var H_=function(e,t){return null!=e&&z_(e,t,$_)},V_=jE,W_=N_,q_=H_,G_=a_,K_=WE,Y_=KE,Z_=D_;var X_=function(e,t){return G_(e)&&K_(t)?Y_(Z_(e),t):function(n){var r=W_(n,e);return void 0===r&&r===t?q_(n,e):V_(t,r,3)}};var Q_=function(e){return e};var J_=P_;var ex=function(e){return function(t){return J_(t,e)}},tx=function(e){return function(t){return null==t?void 0:t[e]}},nx=ex,rx=a_,ox=D_;var ix=function(e){return rx(e)?tx(ox(e)):nx(e)},ax=QE,sx=X_,lx=Q_,ux=_v,cx=ix;var dx=function(e){return"function"==typeof e?e:null==e?lx:"object"==typeof e?ux(e)?sx(e[0],e[1]):ax(e):cx(e)};var px=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++o];if(!1===n(i[l],l,i))break}return t}},fx=px(),hx=fx,gx=Jw;var mx=Yw;var vx=function(e,t){return function(n,r){if(null==n)return n;if(!mx(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=Object(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}},yx=vx(function(e,t){return e&&hx(e,t,gx)});var bx=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0},wx="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),Ex=(e,t)=>e&&e.nodeName!==t?Ex(e.parentElement,t):e,_x=/^(?:\w+:)?\/\/(\S+)$/,xx=/mailto:([^?\\]+)/,kx=/^localhost[\d:?]*(?:[^\d:?]\S*)?$/,Cx=/^[^\s.]+\.\S{2,}$/,Sx=e=>{if("string"!=typeof e)return!1;const t=e.match(_x),n=e.match(xx),r=t||n;if(!r)return!1;const o=r[1];if(!o)return!1;try{new URL(e)}catch(e){return!1}return kx.test(o)||Cx.test(o)},Tx=e=>{return!((e=>void 0===e)(t=e)||(e=>null===e)(t));var t},Dx=Object.defineProperty,Ax=Object.defineProperties,Ox=Object.getOwnPropertyDescriptors,Px=Object.getOwnPropertySymbols,Ix=Object.prototype.hasOwnProperty,Nx=Object.prototype.propertyIsEnumerable,Rx=(e,t,n)=>t in e?Dx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bx=(e,t)=>{for(var n in t||(t={}))Ix.call(t,n)&&Rx(e,n,t[n]);if(Px)for(var n of Px(t))Nx.call(t,n)&&Rx(e,n,t[n]);return e},Fx=(e,t)=>Ax(e,Ox(t)),Lx=(e,t)=>Tx(((e,t)=>{if(!e)return;const n=Xp(e);return null==n?void 0:n[t]})(e,t)),Mx=(e,t)=>{var n,r=t,{key:o,at:i,shouldChange:a=!0}=r,s=((e,t)=>{var n={};for(var r in e)Ix.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Px)for(var r of Px(e))t.indexOf(r)<0&&Nx.call(e,r)&&(n[r]=e[r]);return n})(r,["key","at","shouldChange"]);const l=null!=i?i:e.selection;if(o=kv(o),l)if(Dc.isRange(l)&&Dc.isExpanded(l))((e,t,n)=>{Vd.unsetNodes(e,t,n)})(e,o,Bx({at:l,match:Kp,split:!0},s));else if(e.selection){const t=null!=(n=Xp(e))?n:{};o.forEach(e=>{delete t[e]}),e.marks=t,a&&e.onChange()}},Ux=(e,t,n)=>{Gp(e,()=>{for(const[,r]of((e,t,n)=>Bc.children(e,t,n))(e,t,{reverse:!0}))Yp(e,Fx(Bx({},n),{at:r}))})};var jx=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},$x=jx,zx=Math.max;var Hx=function(e,t,n){return t=zx(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=zx(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),$x(e,this,s)}};var Vx=function(e){return function(){return e}},Wx=Ry,qx=function(){try{var e=Wx(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Gx=Vx,Kx=qx,Yx=Kx?function(e,t){return Kx(e,"toString",{configurable:!0,enumerable:!1,value:Gx(t),writable:!0})}:Q_,Zx=Yx,Xx=Date.now;var Qx=function(e){var t=0,n=0;return function(){var r=Xx(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Zx),Jx=Q_,ek=Hx,tk=Qx;var nk=function(e,t){return tk(ek(e,t,Jx),e+"")},rk=qx;var ok=function(e,t,n){"__proto__"==t&&rk?rk(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},ik=ok,ak=Tv;var sk=function(e,t,n){(void 0!==n&&!ak(e[t],n)||void 0===n&&!(t in e))&&ik(e,t,n)},lk={exports:{}};!function(e,t){var n=Jv,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}(lk,lk.exports);var uk=lk.exports,ck=Fb;var dk=function(e){var t=new e.constructor(e.byteLength);return new ck(t).set(new ck(e)),t},pk=dk;var fk=function(e,t){var n=t?pk(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)};var hk=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},gk=py,mk=Object.create,vk=function(){function e(){}return function(t){if(!gk(t))return{};if(mk)return mk(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),yk=zw(Object.getPrototypeOf,Object),bk=vk,wk=yk,Ek=$w;var _k=function(e){return"function"!=typeof e.constructor||Ek(e)?{}:bk(wk(e))},xk=Yw,kk=iw;var Ck=function(e){return kk(e)&&xk(e)},Sk=dy,Tk=yk,Dk=iw,Ak=Function.prototype,Ok=Object.prototype,Pk=Ak.toString,Ik=Ok.hasOwnProperty,Nk=Pk.call(Object);var Rk=function(e){if(!Dk(e)||"[object Object]"!=Sk(e))return!1;var t=Tk(e);if(null===t)return!0;var n=Ik.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Pk.call(n)==Nk};var Bk=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},Fk=ok,Lk=Tv,Mk=Object.prototype.hasOwnProperty;var Uk=function(e,t,n){var r=e[t];Mk.call(e,t)&&Lk(r,n)&&(void 0!==n||t in e)||Fk(e,t,n)},jk=Uk,$k=ok;var zk=function(e,t,n,r){var o=!n;n||(n={});for(var i=-1,a=t.length;++i<a;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),o?$k(n,s,l):jk(n,s,l)}return n};var Hk=py,Vk=$w,Wk=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},qk=Object.prototype.hasOwnProperty;var Gk=Uw,Kk=function(e){if(!Hk(e))return Wk(e);var t=Vk(e),n=[];for(var r in e)("constructor"!=r||!t&&qk.call(e,r))&&n.push(r);return n},Yk=Yw;var Zk=function(e){return Yk(e)?Gk(e,!0):Kk(e)},Xk=zk,Qk=Zk;var Jk=sk,eC=uk,tC=fk,nC=hk,rC=_k,oC=fw,iC=_v,aC=Ck,sC=mw,lC=my,uC=py,cC=Rk,dC=Pw,pC=Bk,fC=function(e){return Xk(e,Qk(e))};var hC=Cb,gC=sk,mC=fx,vC=function(e,t,n,r,o,i,a){var s=pC(e,n),l=pC(t,n),u=a.get(l);if(u)Jk(e,n,u);else{var c=i?i(s,l,n+"",e,t,a):void 0,d=void 0===c;if(d){var p=iC(l),f=!p&&sC(l),h=!p&&!f&&dC(l);c=l,p||f||h?iC(s)?c=s:aC(s)?c=nC(s):f?(d=!1,c=eC(l,!0)):h?(d=!1,c=tC(l,!0)):c=[]:cC(l)||oC(l)?(c=s,oC(s)?c=fC(s):uC(s)&&!lC(s)||(c=rC(l))):d=!1}d&&(a.set(l,c),o(c,l,r,i,a),a.delete(l)),Jk(e,n,c)}},yC=py,bC=Zk,wC=Bk;var EC=function e(t,n,r,o,i){t!==n&&mC(n,function(a,s){if(i||(i=new hC),yC(a))vC(t,n,s,r,e,o,i);else{var l=o?o(wC(t,s),a,s+"",t,n,i):void 0;void 0===l&&(l=a),gC(t,s,l)}},bC)},_C=EC,xC=py;var kC=function e(t,n,r,o,i,a){return xC(t)&&xC(n)&&(a.set(n,t),_C(t,n,void 0,e,a),a.delete(n)),t},CC=Tv,SC=Yw,TC=yw,DC=py;var AC=function(e,t,n){if(!DC(n))return!1;var r=typeof t;return!!("number"==r?SC(n)&&TC(t,n.length):"string"==r&&t in n)&&CC(n[t],e)},OC=nk,PC=AC;var IC=function(e){return OC(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&PC(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var s=n[r];s&&e(t,s,r,i)}return t})},NC=EC,RC=IC(function(e,t,n,r){NC(e,t,n,r)}),BC=jx,FC=kC,LC=RC,MC=nk(function(e){return e.push(void 0,FC),BC(LC,void 0,e)}),UC=Bn(MC);function jC(e){return jC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jC(e)}function $C(e){var t=function(e,t){if("object"!==jC(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==jC(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===jC(t)?t:String(t)}function zC(e,t,n){return(t=$C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var HC=new WeakMap,VC=new WeakMap;let WC=class{};class qC extends WC{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),zC(this,"offset",void 0),zC(this,"path",void 0);var{offset:t,path:n}=e;this.offset=t,this.path=n}}class GC extends WC{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),zC(this,"offset",void 0),zC(this,"path",void 0);var{offset:t,path:n}=e;this.offset=t,this.path=n}}var KC=e=>HC.get(e),YC=e=>VC.get(e);function ZC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function XC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ZC(Object(n),!0).forEach(function(t){zC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var QC=new WeakSet,JC=e=>{var t=[],n=e=>{if(null!=e){var r=t[t.length-1];if("string"==typeof e){var o={text:e};QC.add(o),e=o}if(Td.isText(e)){var i=e;Td.isText(r)&&QC.has(r)&&QC.has(i)&&Td.equals(r,i,{loose:!0})?r.text+=i.text:t.push(i)}else if(Oc.isElement(e))t.push(e);else{if(!(e instanceof WC))throw new Error("Unexpected hyperscript child object: ".concat(e));var a=t[t.length-1];Td.isText(a)||(n(""),a=t[t.length-1]),e instanceof qC?((e,t)=>{var n=e.text.length;HC.set(e,[n,t])})(a,e):e instanceof GC&&((e,t)=>{var n=e.text.length;VC.set(e,[n,t])})(a,e)}}};for(var r of e.flat(1/0))n(r);return t};function eS(e,t,n){return XC(XC({},t),{},{children:JC(n)})}function tS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tS(Object(n),!0).forEach(function(t){zC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var rS,oS={anchor:function(e,t,n){return new qC(t)},cursor:function(e,t,n){return[new qC(t),new GC(t)]},editor:(rS=xp,(e,t,n)=>{var r,o=[];for(var i of n)Dc.isRange(i)?r=i:o.push(i);var a=JC(o),s={},l=rS();for(var[u,c]of(Object.assign(l,t),l.children=a,Bc.texts(l))){var d=KC(u),p=YC(u);if(null!=d){var[f]=d;s.anchor={path:c,offset:f}}if(null!=p){var[h]=p;s.focus={path:c,offset:h}}}if(s.anchor&&!s.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<anchor />`. For collapsed selections, use `<cursor />` instead.");if(!s.anchor&&s.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<focus />`. For collapsed selections, use `<cursor />` instead.");return null!=r?l.selection=r:Dc.isRange(s)&&(l.selection=s),l}),element:eS,focus:function(e,t,n){return new GC(t)},fragment:function(e,t,n){return JC(n)},selection:function(e,t,n){var r=n.find(e=>e instanceof qC),o=n.find(e=>e instanceof GC);if(!r||null==r.offset||null==r.path)throw new Error("The <selection> hyperscript tag must have an <anchor> tag as a child with `path` and `offset` attributes defined.");if(!o||null==o.offset||null==o.path)throw new Error("The <selection> hyperscript tag must have a <focus> tag as a child with `path` and `offset` attributes defined.");return XC({anchor:{offset:r.offset,path:r.path},focus:{offset:o.offset,path:o.path}},t)},text:function(e,t,n){var r=JC(n);if(r.length>1)throw new Error("The <text> hyperscript tag must only contain a single node's worth of children.");var[o]=r;if(null==o&&(o={text:""}),!Td.isText(o))throw new Error("\n The <text> hyperscript tag can only contain text content as children.");return QC.delete(o),Object.assign(o,t),o}},iS=e=>function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];var a=e[t];if(!a)throw new Error("No hyperscript creator found for tag: <".concat(t,">"));return null==n&&(n={}),Cp(n)||(o=[n].concat(o),n={}),a(t,n,o=o.filter(e=>Boolean(e)).flat())},aS=e=>{var t={},n=function(){var n=e[r];if("object"!=typeof n)throw new Error("Properties specified for a hyperscript shorthand should be an object, but for the custom element <".concat(r,"> tag you passed: ").concat(n));t[r]=(e,t,r)=>eS(0,nS(nS({},n),t),r)};for(var r in e)n();return t},sS=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{elements:t={}}=e,n=aS(t),r=nS(nS(nS({},oS),n),e.creators);return iS(r)}();var lS=function(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r},uS=yx;var cS=lS,dS=function(e,t,n,r){return uS(e,function(e,o,i){t(r,e,n(e),i)}),r},pS=dx,fS=_v;var hS=ok,gS=Bn(function(e,t){return function(n,r){var o=fS(n)?cS:dS,i=t?t():{};return o(n,e,pS(r),i)}}(function(e,t,n){hS(e,n,t)})),mS=EC,vS=Bn(IC(function(e,t,n){mS(e,t,n)})),yS=Cv;var bS=function(e,t){return yS(t,function(t){return e[t]})},wS=bS,ES=Jw;var _S=Bn(function(e){return null==e?[]:wS(e,ES(e))});var xS=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},kS=zk,CS=Jw;var SS=function(e,t){return e&&kS(t,CS(t),e)},TS=zk,DS=Zk;var AS=function(e,t){return e&&TS(t,DS(t),e)},OS=zk,PS=rw;var IS=function(e,t){return OS(e,PS(e),t)},NS=Gb,RS=yk,BS=rw,FS=Qb,LS=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)NS(t,BS(e)),e=RS(e);return t}:FS,MS=zk,US=LS;var jS=function(e,t){return MS(e,US(e),t)},$S=Zb,zS=LS,HS=Zk;var VS=function(e){return $S(e,HS,zS)},WS=Object.prototype.hasOwnProperty;var qS=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&WS.call(e,"index")&&(n.index=e.index,n.input=e.input),n},GS=dk;var KS=function(e,t){var n=t?GS(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)},YS=/\w*$/;var ZS=function(e){var t=new e.constructor(e.source,YS.exec(e));return t.lastIndex=e.lastIndex,t},XS=ey?ey.prototype:void 0,QS=XS?XS.valueOf:void 0;var JS=dk,eT=KS,tT=ZS,nT=function(e){return QS?Object(QS.call(e)):{}},rT=fk;var oT=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return JS(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return eT(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return rT(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return tT(e);case"[object Symbol]":return nT(e)}},iT=CE,aT=iw;var sT=function(e){return aT(e)&&"[object Map]"==iT(e)},lT=Cw,uT=Tw&&Tw.isMap,cT=uT?lT(uT):sT,dT=CE,pT=iw;var fT=function(e){return pT(e)&&"[object Set]"==dT(e)},hT=Cw,gT=Tw&&Tw.isSet,mT=gT?hT(gT):fT,vT=Cb,yT=xS,bT=Uk,wT=SS,ET=AS,_T=uk,xT=hk,kT=IS,CT=jS,ST=rE,TT=VS,DT=CE,AT=qS,OT=oT,PT=_k,IT=_v,NT=mw,RT=cT,BT=py,FT=mT,LT=Jw,MT=Zk,UT="[object Arguments]",jT="[object Function]",$T="[object Object]",zT={};zT[UT]=zT["[object Array]"]=zT["[object ArrayBuffer]"]=zT["[object DataView]"]=zT["[object Boolean]"]=zT["[object Date]"]=zT["[object Float32Array]"]=zT["[object Float64Array]"]=zT["[object Int8Array]"]=zT["[object Int16Array]"]=zT["[object Int32Array]"]=zT["[object Map]"]=zT["[object Number]"]=zT[$T]=zT["[object RegExp]"]=zT["[object Set]"]=zT["[object String]"]=zT["[object Symbol]"]=zT["[object Uint8Array]"]=zT["[object Uint8ClampedArray]"]=zT["[object Uint16Array]"]=zT["[object Uint32Array]"]=!0,zT["[object Error]"]=zT[jT]=zT["[object WeakMap]"]=!1;var HT=function e(t,n,r,o,i,a){var s,l=1&n,u=2&n,c=4&n;if(r&&(s=i?r(t,o,i,a):r(t)),void 0!==s)return s;if(!BT(t))return t;var d=IT(t);if(d){if(s=AT(t),!l)return xT(t,s)}else{var p=DT(t),f=p==jT||"[object GeneratorFunction]"==p;if(NT(t))return _T(t,l);if(p==$T||p==UT||f&&!i){if(s=u||f?{}:PT(t),!l)return u?CT(t,ET(s,t)):kT(t,wT(s,t))}else{if(!zT[p])return i?t:{};s=OT(t,p,l)}}a||(a=new vT);var h=a.get(t);if(h)return h;a.set(t,s),FT(t)?t.forEach(function(o){s.add(e(o,n,r,o,t,a))}):RT(t)&&t.forEach(function(o,i){s.set(i,e(o,n,r,i,t,a))});var g=d?void 0:(c?u?TT:ST:u?MT:LT)(t);return yT(g||t,function(o,i){g&&(o=t[i=o]),bT(s,i,e(o,n,r,i,t,a))}),s},VT=HT;var WT=Bn(function(e){return VT(e,5)});function qT(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=qT(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function GT(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=qT(e))&&(r&&(r+=" "),r+=t);return r}var KT=function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i},YT=P_,ZT=KT;var XT=function(e,t){return t.length<2?e:YT(e,ZT(t,0,-1))},QT=S_,JT=bx,eD=XT,tD=D_,nD=Object.prototype.hasOwnProperty;var rD=function(e,t){var n=-1,r=(t=QT(t,e)).length;if(!r)return!0;for(var o=null==e||"object"!=typeof e&&"function"!=typeof e;++n<r;){var i=t[n];if("string"==typeof i){if("__proto__"===i&&!nD.call(e,"__proto__"))return!1;if("constructor"===i&&n+1<r&&"string"==typeof t[n+1]&&"prototype"===t[n+1]){if(o&&0===n)continue;return!1}}}var a=eD(e,t);return null==a||delete a[tD(JT(t))]},oD=Rk;var iD=function(e){return oD(e)?void 0:e},aD=fw,sD=_v,lD=ey?ey.isConcatSpreadable:void 0;var uD=Gb,cD=function(e){return sD(e)||aD(e)||!!(lD&&e&&e[lD])};var dD=function e(t,n,r,o,i){var a=-1,s=t.length;for(r||(r=cD),i||(i=[]);++a<s;){var l=t[a];n>0&&r(l)?n>1?e(l,n-1,r,o,i):uD(i,l):o||(i[i.length]=l)}return i},pD=dD;var fD=function(e){return(null==e?0:e.length)?pD(e,1):[]},hD=Hx,gD=Qx;var mD=Cv,vD=HT,yD=rD,bD=S_,wD=zk,ED=iD,_D=VS,xD=function(e){return gD(hD(e,void 0,fD),e+"")}(function(e,t){var n={};if(null==e)return n;var r=!1;t=mD(t,function(t){return t=bD(t,e),r||(r=t.length>1),t}),wD(e,_D(e),n),r&&(n=vD(n,7,ED));for(var o=t.length;o--;)yD(n,t[o]);return n}),kD=Bn(xD),CD=Object.prototype.hasOwnProperty;function SD(e,t,n){for(n of e.keys())if(TD(n,t))return n}function TD(e,t){var n,r,o;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&TD(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((o=r)&&"object"==typeof o&&!(o=SD(t,o)))return!1;if(!t.has(o))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((o=r[0])&&"object"==typeof o&&!(o=SD(t,o)))return!1;if(!TD(r[1],t.get(o)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(CD.call(e,n)&&++r&&!CD.call(t,n))return!1;if(!(n in t)||!TD(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}function DD(e,t){return Da.useMemo(e,function(e){const t=Da.useRef(e),n=Da.useRef(0);return TD(e,t.current)||(t.current=e,n.current+=1),Da.useMemo(()=>t.current,[n.current])}(t))}const AD=e=>e,OD=e=>({_tag:"Left",value:e}),PD=e=>({_tag:"Right",value:e}),ID={dimap:(e,t,n)=>r=>t(n(e(r))),first:e=>([t,n])=>[e(t),n],right:e=>t=>"Left"===t._tag?t:PD(e(t.value)),wander:e=>t=>t.map(e)},ND={empty:()=>{},foldMap:(e,t)=>{for(let n=0;n<t.length;n++){const r=e(t[n]);if(null!=r)return r}}},RD={empty:()=>[],foldMap:(e,t)=>{let n=[];return t.forEach(t=>{n=n.concat(e(t))}),n}},BD=e=>({dimap:(e,t,n)=>t=>n(e(t)),first:e=>([t,n])=>e(t),right:t=>n=>"Left"===n._tag?e.empty():t(n.value),wander:t=>n=>e.foldMap(t,n)}),FD={Equivalence:{Equivalence:"Equivalence",Iso:"Iso",Lens:"Lens",Prism:"Prism",Traversal:"Traversal",Getter:"Getter",AffineFold:"AffineFold",Fold:"Fold",Setter:"Setter"},Iso:{Equivalence:"Iso",Iso:"Iso",Lens:"Lens",Prism:"Prism",Traversal:"Traversal",Getter:"Getter",AffineFold:"AffineFold",Fold:"Fold",Setter:"Setter"},Lens:{Equivalence:"Lens",Iso:"Lens",Lens:"Lens",Prism:"Prism",Traversal:"Traversal",Getter:"Getter",AffineFold:"AffineFold",Fold:"Fold",Setter:"Setter"},Prism:{Equivalence:"Prism",Iso:"Prism",Lens:"Prism",Prism:"Prism",Traversal:"Traversal",Getter:"AffineFold",AffineFold:"AffineFold",Fold:"Fold",Setter:"Setter"},Traversal:{Equivalence:"Traversal",Iso:"Traversal",Lens:"Traversal",Prism:"Traversal",Traversal:"Traversal",Getter:"Fold",AffineFold:"Fold",Fold:"Fold",Setter:"Setter"},Getter:{Equivalence:"Getter",Iso:"Getter",Lens:"Getter",Prism:"AffineFold",Traversal:"Fold",Getter:"Getter",AffineFold:"AffineFold",Fold:"Fold",Setter:void 0},AffineFold:{Equivalence:"AffineFold",Iso:"AffineFold",Lens:"AffineFold",Prism:"AffineFold",Traversal:"Fold",Getter:"AffineFold",AffineFold:"AffineFold",Fold:"Fold",Setter:void 0},Fold:{Equivalence:"Fold",Iso:"Fold",Lens:"Fold",Prism:"Fold",Traversal:"Fold",Getter:"Fold",AffineFold:"Fold",Fold:"Fold",Setter:void 0},Setter:{Equivalence:void 0,Iso:void 0,Lens:void 0,Prism:void 0,Traversal:void 0,Getter:void 0,AffineFold:void 0,Fold:void 0,Setter:void 0}},LD=(e,t)=>{const n=t;return n._tag=e,n},MD=e=>(e._removable=!0,e);function UD(e,t,n){if(2===arguments.length){const n=(n,r)=>e(n,t(n,r));return n._tag=FD[e._tag][t._tag],n._removable=t._removable||!1,n}{const r=FD[e._tag][t._tag],o=(r,o)=>e(r,t(r,n(r,o)));return o._tag=FD[r][n._tag],o._removable=n._removable||!1,o}}const jD=LD("Equivalence",(e,t)=>t),$D=(e,t)=>LD("Iso",(n,r)=>n.dimap(e,t,r)),zD=(e,t)=>LD("Lens",(n,r)=>n.dimap(t=>[e(t),t],t,n.first(r))),HD=(e,t)=>LD("Prism",(n,r)=>n.dimap(e,e=>((e,t,n)=>"Left"===n._tag?e(n.value):t(n.value))(AD,t,e),n.right(r))),VD=LD("Traversal",(e,t)=>e.dimap(AD,AD,e.wander(t))),WD=(e,t,n)=>e(ID,t)(n),qD=(e,t)=>e(BD(RD),e=>[e])(t),GD=$D(e=>e.map((e,t)=>[t,e]),e=>{const t=[...e].sort((e,t)=>e[0]-t[0]),n=[];for(let e=0;e<t.length;++e)e!==t.length-1&&t[e][0]===t[e+1][0]||n.push(t[e][1]);return n}),KD=e=>zD(t=>t[e],([t,n])=>Object.assign(Object.assign({},n),{[e]:t})),YD=e=>zD(t=>t[e],([t,n])=>{const r=n.slice();return r[e]=t,r}),ZD=YD(0),XD=e=>HD(t=>e(t)?PD(t):OD(t),AD),QD=Symbol("__no_match__"),JD=XD(e=>e!==QD),eA=Symbol("__remove_me__"),tA=e=>MD(UD(zD(t=>0<=e&&e<t.length?t[e]:QD,([t,n])=>{if(t===QD)return n;if(t===eA)return"string"==typeof n?n.substring(0,e)+n.substring(e+1):[...n.slice(0,e),...n.slice(e+1)];if("string"==typeof n)return 0===e?t+n.substring(1):e===n.length?n.substring(0,e-1)+t:n.substring(0,e)+t+n.substring(e+1);{const r=n.slice();return r[e]=t,r}}),JD)),nA=HD(e=>void 0===e?OD(void 0):PD(e),AD),rA=zD(e=>{},([e,t])=>void 0===e?t:[e,...t]),oA=zD(e=>{},([e,t])=>void 0===e?t:[...t,e]),iA=UD($D(e=>e.split(""),e=>e.join("")),VD),aA=UD($D(e=>e.split(/\b/),e=>e.join("")),VD,XD(e=>!/\s+/.test(e)));class sA{constructor(e){this._ref=e}get _tag(){return this._ref._tag}get _removable(){return this._ref._removable}compose(e){return new sA(UD(this._ref,e._ref))}iso(e,t){return new sA(UD(this._ref,$D(e,t)))}lens(e,t){return new sA(UD(this._ref,zD(e,([e,n])=>t(n,e))))}indexed(){return new sA(UD(this._ref,GD))}prop(e){return new sA(UD(this._ref,KD(e)))}path(...e){return 1===e.length&&(e=e[0].split(".")),new sA(e.reduce((e,t)=>UD(e,KD(t)),this._ref))}pick(e){return new sA(UD(this._ref,(e=>zD(t=>{const n={};for(const r of e)n[r]=t[r];return n},([t,n])=>{const r=Object.assign({},n);for(const t of e)delete r[t];return Object.assign(r,t)}))(e)))}nth(e){return new sA(UD(this._ref,YD(e)))}filter(e){return new sA(UD(this._ref,(e=>UD(zD(t=>{const n=t.map((t,n)=>e(t)?n:null).filter(e=>null!=e);return[n.map(e=>t[e]),n]},([[e,t],n])=>{const r=n.length,o=e.length;let i=0,a=0,s=0;const l=[];for(;i<r;)t[a]===i?(++a,s<o&&(l.push(e[s]),++s)):l.push(n[i]),++i;for(;s<o;)l.push(e[s++]);return l}),ZD))(e)))}valueOr(e){return new sA(UD(this._ref,(e=>zD(t=>void 0===t?e:t,([e,t])=>e))(e)))}partsOf(e){const t="function"==typeof e?e(lA):e;return new sA(UD(this._ref,(e=>UD(zD(t=>{const n=qD(e,t);return[n,n.length]},([[t,n],r])=>{if(t.length!==n)throw new Error("cannot add/remove elements through partsOf");let o=0;return WD(e,()=>t[o++],r)}),ZD))(t._ref)))}reread(e){return new sA(UD(this._ref,(e=>zD(t=>e(t),([e,t])=>e))(e)))}rewrite(e){return new sA(UD(this._ref,(e=>zD(e=>e,([t,n])=>e(t)))(e)))}optional(){return new sA(UD(this._ref,nA))}guard_(){return e=>this.guard(e)}guard(e){return new sA(UD(this._ref,(e=>HD(t=>e(t)?PD(t):OD(t),AD))(e)))}at(e){return new sA(UD(this._ref,tA(e)))}head(){return new sA(UD(this._ref,tA(0)))}index(e){return new sA(UD(this._ref,tA(e)))}find(e){return new sA(UD(this._ref,(e=>MD(UD(zD(t=>{const n=t.findIndex(e);return-1===n?[QD,-1]:[t[n],n]},([[e,t],n])=>{if(e===QD)return n;if(e===eA)return[...n.slice(0,t),...n.slice(t+1)];const r=n.slice();return r[t]=e,r}),ZD,JD)))(e)))}elems(){return new sA(UD(this._ref,VD))}to(e){return new sA(UD(this._ref,(e=>LD("Getter",(t,n)=>t.dimap(e,AD,n)))(e)))}when(e){return new sA(UD(this._ref,XD(e)))}chars(){return new sA(UD(this._ref,iA))}words(){return new sA(UD(this._ref,aA))}prependTo(){return new sA(UD(this._ref,rA))}appendTo(){return new sA(UD(this._ref,oA))}}const lA=new sA(jD);function uA(e){return t=>((e,t)=>e(BD({}),AD)(t))(e._ref,t)}function cA(e){return t=>((e,t)=>e(BD(ND),AD)(t))(e._ref,t)}function dA(e){return t=>n=>((e,t,n)=>e(ID,()=>t)(n))(e._ref,t,n)}const pA=(e,t,n)=>(t.has(n)?t:t.set(n,e())).get(n),fA=new WeakMap;function hA(e,t){return((n,r,o)=>{const i=pA(()=>new WeakMap,fA,r);return pA(()=>{const n=t(lA);return ls(t=>{const r=t(e);return r instanceof Promise?r.then(e=>gA(n,e)):gA(n,r)},(t,r,o)=>{const i="function"==typeof o?function(e){return t=>n=>WD(e._ref,t,n)}(n)(o):dA(n)(o),a=t(e);return r(e,a instanceof Promise?a.then(i):i(a))})},i,o)})(0,e,t)}const gA=(e,t)=>"Traversal"===e._tag?function(e){return t=>qD(e._ref,t)}(e)(t):"Prism"===e._tag?cA(e)(t):uA(e)(t);var mA=Object.defineProperty,vA=Object.defineProperties,yA=Object.getOwnPropertyDescriptors,bA=Object.getOwnPropertySymbols,wA=Object.prototype.hasOwnProperty,EA=Object.prototype.propertyIsEnumerable,_A=(e,t,n)=>t in e?mA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xA=(e,t)=>{for(var n in t||(t={}))wA.call(t,n)&&_A(e,n,t[n]);if(bA)for(var n of bA(t))EA.call(t,n)&&_A(e,n,t[n]);return e},kA=(e,t)=>vA(e,yA(t)),CA=(e,t)=>{var n={};for(var r in e)wA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&bA)for(var r of bA(e))t.indexOf(r)<0&&EA.call(e,r)&&(n[r]=e[r]);return n};function SA(e){var t=e,{attributes:n,children:r,text:o,leaf:i,editor:a,nodeProps:s}=t,l=CA(t,["attributes","children","text","leaf","editor","nodeProps"]);return Da.createElement("span",xA(xA({},n),l),r)}var{useElementStore:TA,ElementProvider:DA}=Ws({element:null},{name:"element"}),AA=(e="element")=>{const t=TA(e).get.element();return t||(console.warn("The `useElement(pluginKey)` hook must be used inside the node component's context"),{})},OA=cc("event-editor")({blur:null,focus:null,last:null}),PA=OA.set,IA=OA.get;OA.use;var NA=({node:e,path:t=[],source:n,apply:r,query:o})=>{var i;(ef([e,t],o)&&r(e,n instanceof Function?n():n),i=e,Oc.isAncestor(i))&&e.children.forEach((e,i)=>{NA({node:e,path:t.concat([i]),source:n,apply:r,query:o})})},RA=(e,t)=>{((e,{at:t,nodes:n,insertOptions:r,removeOptions:o})=>{Gp(e,()=>{Ux(e,t,o),tf(e,n,Fx(Bx({},r),{at:t.concat([0])}))})})(e,xA({at:[],nodes:e.childrenFactory()},t))},BA=e=>{const t=(e=>Jg.isFocused(e))(e);RA(e),e.history.undos=[],e.history.redos=[],e.operations=[],t&&Ev(e,{edge:"start"})},FA=(e,t)=>{var n;return null!=(n=(e=>{var t;return null!=(t=null==e?void 0:e.pluginsByKey)?t:{}})(e)[t])?n:{key:t}},LA=(e,t)=>{var n,r;return null!=(r=null!=(n=FA(e,t).type)?n:t)?r:""},MA=(e,t={},n=!1)=>{var r;if(t[e.key]){const r=t[e.key],{plugins:o,then:i}=r,a=CA(r,["plugins","then"]);e=UC(a,e),n||null==o||o.forEach(t=>{e.plugins||(e.plugins=[]);e.plugins.find(e=>e.key===t.key)||e.plugins.push(t)})}e.plugins&&(e.plugins=e.plugins.map(e=>MA(e,t,!0)));const{then:o}=e;return o?(void 0===e._thenReplaced&&(e._thenReplaced=0),e._thenReplaced<3&&(e.then=(n,r)=>{const i=xA({key:e.key},o(n,r));return UC(MA(i,t),i)},e._thenReplaced++)):(null==(r=t[e.key])?void 0:r.then)&&(e.then=t[e.key].then),e},UA=e=>(t,n={})=>(n[e.key]=t,MA(xA({},e),n)),jA="deserializeAst",$A=UA({key:jA,editor:{insertData:{format:"application/x-slate-fragment",getFragment:({data:e})=>{const t=decodeURIComponent(window.atob(e));let n;try{n=JSON.parse(t)}catch(e){}return n}}}}),zA=(e,t)=>{var n;const{selection:r}=e;if(!r)return!1;const o=null==(n=((e,t={})=>Wp(e,kA(xA({},t),{block:!0})))(e,t))?void 0:n[1];return!!o&&(Qp(e,r.focus,o)||(e=>!!e&&Dc.isExpanded(e))(e.selection)&&Qp(e,r.anchor,o))},HA=e=>{const t=Xp(e);t&&Object.keys(t).forEach(t=>{((e,t)=>{md.removeMark(e,t)})(e,t)})},VA="editorProtocol",WA=UA({key:VA,withOverrides:e=>{const{deleteBackward:t,deleteForward:n,deleteFragment:r}=e,o=()=>{zA(e)&&HA(e)};return e.deleteBackward=e=>{t(e),o()},e.deleteForward=e=>{n(e),o()},e.deleteFragment=e=>{r(e),o()},e}}),qA="event-editor",GA=UA({key:qA,handlers:{onFocus:e=>()=>{PA.focus(e.id)},onBlur:e=>()=>{IA.focus()===e.id&&PA.focus(null),PA.blur(e.id)}}}),KA=UA({key:"history",withOverrides:e=>(e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var r=n[n.length-1];r.selectionBefore&&Vd.setSelection(t,r.selectionBefore),Op.withoutSaving(t,()=>{md.withoutNormalizing(t,()=>{for(var e of r.operations)t.apply(e)})}),e.redos.pop(),t.writeHistory("undos",r)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var r=n[n.length-1];Op.withoutSaving(t,()=>{md.withoutNormalizing(t,()=>{var e=r.operations.map(Uc.inverse).reverse();for(var n of e)t.apply(n);r.selectionBefore&&Vd.setSelection(t,r.selectionBefore)})}),t.writeHistory("redos",r),e.undos.pop()}},t.apply=e=>{var{operations:r,history:o}=t,{undos:i}=o,a=i[i.length-1],s=a&&a.operations[a.operations.length-1],l=Op.isSaving(t),u=Op.isMerging(t);if(null==l&&(l=Ip(e)),l){if(null==u&&(u=null!=a&&(0!==r.length||Pp(e,s))),Op.isSplittingOnce(t)&&(u=!1,Op.setSplittingOnce(t,void 0)),a&&u)a.operations.push(e);else{var c={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",c)}for(;i.length>100;)i.shift();o.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t})(e)}),YA="inline-void",ZA=UA({key:YA,withOverrides:e=>{const{isInline:t,isVoid:n,markableVoid:r}=e,o=[],i=[],a=[];return e.plugins.forEach(e=>{e.isInline&&i.push(e.type),e.isVoid&&o.push(e.type),e.isMarkableVoid&&a.push(e.type)}),e.isInline=e=>!!i.includes(e.type)||t(e),e.isVoid=e=>!!o.includes(e.type)||n(e),e.markableVoid=e=>!!a.includes(e.type)||r(e),e}}),XA=(e,t)=>{const n=[];return[...e.plugins].reverse().forEach(e=>{var r;const o=null==(r=e.inject.pluginsByKey)?void 0:r[t.key];o&&n.push(o)}),[t,...n]},QA="insertData",JA=UA({key:QA,withOverrides:e=>{const{insertData:t}=e;return e.insertData=n=>{const r=[...e.plugins].reverse().some(t=>{const r=t.editor.insertData;if(!r)return!1;const o=XA(e,t),{format:i,getFragment:a}=r;if(!i)return!1;let s=n.getData(i);if(!s)return;if(!((e,{data:t,dataTransfer:n})=>e.every(e=>{var r,o;const i=null==(o=null==(r=e.editor)?void 0:r.insertData)?void 0:o.query;return!i||i({data:t,dataTransfer:n})}))(o,{data:s,dataTransfer:n}))return!1;s=((e,{data:t,dataTransfer:n})=>(e.forEach(e=>{var r,o;const i=null==(o=null==(r=e.editor)?void 0:r.insertData)?void 0:o.transformData;i&&(t=i(t,{dataTransfer:n}))}),t))(o,{data:s,dataTransfer:n});let l=null==a?void 0:a({data:s,dataTransfer:n});return!!(null==l?void 0:l.length)&&(l=((e,t)=>{var n=t,{fragment:r}=n,o=CA(n,["fragment"]);return e.forEach(e=>{var t,n;const i=null==(n=null==(t=e.editor)?void 0:t.insertData)?void 0:n.transformFragment;i&&(r=i(r,o))}),r})(o,{fragment:l,data:s,dataTransfer:n}),0!==l.length&&(((e,t,n)=>{var r=n,{fragment:o}=r,i=CA(r,["fragment"]);Gp(e,()=>{t.some(e=>{var t,n,r;return!0===(null==(r=null==(n=null==(t=e.editor)?void 0:t.insertData)?void 0:n.preInsert)?void 0:r.call(n,o,i))}),e.insertFragment(o)})})(e,o,{fragment:l,data:s,dataTransfer:n}),!0))});r||t(n)},e}}),eO="length",tO=UA({key:eO,withOverrides:(e,{options:t})=>{const{apply:n}=e;return e.apply=r=>{Gp(e,()=>{if(n(r),t.maxLength){const n=((e,t,n)=>{if(!t)return"";try{return md.string(e,t,n)}catch(e){return""}})(e,[]).length;if(n>t.maxLength){const r=n-t.maxLength;e.delete({unit:"character",distance:r,reverse:!0})}}})},e}}),nO="nodeFactory",rO=UA({key:nO,withOverrides:e=>(e.blockFactory=t=>xA({type:LA(e,"p"),children:[{text:""}]},t),e.childrenFactory=()=>[e.blockFactory()],e)}),oO="prevSelection",iO=UA({key:oO,handlers:{onKeyDown:e=>t=>{t.persist(),e.currentKeyboardEvent=t}},withOverrides:e=>{const{apply:t}=e;return e.apply=n=>{if("set_selection"===n.type){const{properties:r}=n;return e.prevSelection=r,t(n),void(e.currentKeyboardEvent=null)}t(n)},e}}),aO=UA({key:"react",withOverrides:e=>function(e){var t=e;t=Vh(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x-slate-fragment");var{onChange:n,apply:r,insertText:o}=t;return t.getChunkSize=()=>null,Vf&&(t.insertText=(e,n)=>(Th.delete(t),o(e,n))),t.onChange=e=>{(vv<18?hu.unstable_batchedUpdates:e=>e())(()=>{n(e)})},t.apply=e=>{if("move_node"===e.type){var n=Bc.parent(t,e.path);if(t.getChunkSize(n)){var o=Bc.get(t,e.path),i=jm(t,n),a=Jg.findKey(t,o);i.movedNodeKeys.add(a)}}r(e)},t}(e)}),sO=(e,t,n)=>(e=((e,t,n)=>{const r=((e,t)=>e.some((e,n,r)=>{const o=r[n-1];return 0!==n&&t(e)!==t(o)}))(e,t),{fragment:o}=e.reduce((e,o)=>{if(r&&t(o)){let t=e.precedingBlock;t||(t=n(),e.precedingBlock=t,e.fragment.push(t)),t.children.push(o)}else e.fragment.push(o),e.precedingBlock=null;return e},{fragment:[],precedingBlock:null});return o})(e=(e=>0===e.length?[{text:""}]:e)(e),t,n),e=e.map(e=>zp(e)?kA(xA({},e),{children:sO(e.children,t,n)}):e),e),lO=(e,{descendants:t})=>{const n=(e=>t=>Kp(t)||zp(t)&&e.isInline(t))(e),r=LA(e,"p"),o=(i=r,()=>({type:i,children:[]}));var i;return sO(t,n,o)},uO=new Set(["A","ABBR","B","BDI","BDO","BR","CITE","CODE","DATA","DFN","EM","I","KBD","MARK","Q","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR","WBR","IMG","MAP","TRACK","VIDEO","EMBED","IFRAME","OBJECT","PICTURE","PORTAL","SOURCE","svg","math","CANVAS","DEL","INS","BUTTON","INPUT","LABEL","METER","OUTPUT","PROGRESS","SELECT","TEXTAREA","ACRONYM","BIG","CONTENT","FONT","IMG","MARQUEE","MENUITEM","NOBR","SHADOW","STRIKE","TT"]),cO=e=>e.nodeType===Node.ELEMENT_NODE,dO=e=>{if(!cO(e))return!1;const t=e,n=uO.has(t.tagName),r=t.style.display.split(" ")[0];return""===r?n:!!r.startsWith("inline")||("inherit"===r&&t.parentElement?dO(t.parentElement):!!["initial","unset","revert","revert-layer","contents","none"].includes(r)&&n)},pO=e=>e.nodeType===Node.TEXT_NODE,fO=e=>{if(!cO(e))return!1;return!dO(e)},hO=e=>{e.inlineFormattingContext=null},gO=(e,t)=>{const n=e.textContent||"",r=""===n.trim();!t.inlineFormattingContext&&r||(e=>{e.inlineFormattingContext?e.inlineFormattingContext.atStart=!1:e.inlineFormattingContext={atStart:!0,lastHasTrailingWhiteSpace:!1}})(t);const{whiteSpaceRule:o}=t,i="normal"!==o?"collapse":!t.inlineFormattingContext||t.inlineFormattingContext.atStart||t.inlineFormattingContext.lastHasTrailingWhiteSpace?"all":"collapse",a="normal"===o?"collapse":(e=>{let t=e;for(;;){if(t.nextSibling)t=t.nextSibling;else{if(t=t.parentElement,t&&fO(t))return!0;t=(null==t?void 0:t.nextSibling)||null}if(!t)return!0;if(fO(t))return!0;if((t.textContent||"").length>0)return!1}})(e)?"single-newline":"collapse",s={normal:!0,pre:!1,"pre-line":!0}[o],l=((e,{trimStart:t="collapse",trimEnd:n="collapse",shouldCollapseWhiteSpace:r=!0,whiteSpaceIncludesNewlines:o=!0}={})=>("all"===t&&(e=e.replace(/^\s+/,"")),"single-newline"===n&&(e=e.replace(/\n$/,"")),r&&(e=o?e.replaceAll(/\s+/g," "):(e=(e=e.replaceAll(/[^\S\n\r]+/g," ")).replaceAll(/^[^\S\n\r]+/gm,"")).replaceAll(/[^\S\n\r]+$/gm,"")),e))(n||"",{trimStart:i,trimEnd:a,shouldCollapseWhiteSpace:s,whiteSpaceIncludesNewlines:"pre-line"!==o});t.inlineFormattingContext&&s&&(t.inlineFormattingContext.lastHasTrailingWhiteSpace=l.endsWith(" ")),e.textContent=l},mO=(e,t)=>{cO(e)?yO(e,t):pO(e)?gO(e,t):vO(e,t)},vO=(e,t)=>{const n=Array.from(e.childNodes);for(const e of n)mO(e,t)},yO=(e,t)=>{const n=dO(e),r=t.whiteSpaceRule,o=(e=>{const t=e.style.whiteSpace;switch(t){case"normal":case"nowrap":return"normal";case"pre":case"pre-wrap":case"break-spaces":return"pre";case"pre-line":return"pre-line"}return"PRE"===e.tagName?"pre":"initial"===t?"normal":null})(e);o&&(t.whiteSpaceRule=o),n||hO(t),vO(e,t),n||hO(t),t.whiteSpaceRule=r},bO=(e,t)=>Array.from(t.childNodes).flatMap(xO(e)),wO=(e,t,{element:n,deserializeLeaf:r})=>{var o;const{deserializeHtml:i,isElement:a,isLeaf:s,type:l}=t;if(!i)return;const{attributeNames:u,query:c,isLeaf:d,isElement:p,rules:f}=i;let{getNode:h}=i;const g=p||a,m=d||s;if(!r&&!g)return;if(r&&!m)return;if(f){if(!f.some(({validNodeName:e="*",validStyle:r,validClassName:o,validAttribute:i})=>{var a;if(e){const t=kv(e);if(t.length>0&&!t.includes(n.nodeName)&&"*"!==e)return!1}if(o&&!n.classList.contains(o))return!1;if(r)for(const[e,o]of Object.entries(r)){if(!kv(o).includes(n.style[e])&&"*"!==o)return;if("*"===o&&!n.style[e])return;const r=null==(a=t.inject.props)?void 0:a.defaultNodeValue;if(r&&r===n.style[e])return!1}if(i)if("string"==typeof i){if(!n.getAttributeNames().includes(i))return!1}else for(const[e,t]of Object.entries(i)){const r=kv(t),o=n.getAttribute(e);if(!Tx(o)||!r.includes(o))return!1}return!0}))return}if(c&&!c(n))return;if(!h)if(g)h=()=>({type:l});else{if(!m)return;h=()=>({[l]:!0})}let v=null!=(o=h(n,{}))?o:{};if(0===Object.keys(v).length)return;if(XA(e,t).forEach(e=>{var t,r;const o=null==(r=null==(t=e.deserializeHtml)?void 0:t.getNode)?void 0:r.call(t,n,v);o&&(v=xA(xA({},v),o))}),u){const e={},t=n.getAttributeNames();for(const r of t)u.includes(r)&&(e[r]=n.getAttribute(r));Object.keys(e).length>0&&(v.attributes=e)}return kA(xA({},i),{node:v})},EO=(e,t)=>{var n;const r=((e,t)=>{let n;return[...e.plugins].reverse().some(r=>(n=wO(e,r,{element:t}),!!n)),n})(e,t);if(r){const{node:o,withoutChildren:i}=r;let a=null!=(n=o.children)?n:bO(e,t);return(0===a.length||i)&&(a=[{text:""}]),sS("element",o,a)}},_O=(e,t)=>{const n=((e,t)=>{let n={};return[...e.plugins].reverse().forEach(r=>{const o=wO(e,r,{element:t,deserializeLeaf:!0});o&&(n=xA(xA({},n),o.node))}),n})(e,t);return bO(e,t).reduce((e,t)=>{if(!t)return e;if(zp(t))Object.keys(n).length>0&&zO({node:t,source:n,query:{filter:([e])=>Kp(e)}}),e.push(t);else{const r=xA({},n);Kp(t)&&t.text&&Object.keys(r).forEach(e=>{r[e]&&t[e]&&(r[e]=t[e])}),e.push(sS("text",r,t))}return e},[])},xO=e=>t=>{const n=(e=>{if(pO(e))return e.textContent||""})(t);if(n)return n;if(!cO(t))return null;const r=(e=>{if("BR"===e.nodeName)return"\n"})(t);if(r)return r;const o=((e,t)=>{if("BODY"===t.nodeName)return sS("fragment",{},bO(e,t))})(e,t);if(o)return o;const i=EO(e,t);return i||_O(e,t)},kO=(e,{element:t,collapseWhiteSpace:n=!0})=>{"string"==typeof t&&(t=(e=>{const t=document.createElement("body");return t.innerHTML=e,t})(t)),n&&(t=(e=>{const t=e.cloneNode(!0);return yO(t,{inlineFormattingContext:null,whiteSpaceRule:"normal"}),t})(t));const r=((e,t)=>xO(e)(t))(e,t);return lO(e,{descendants:r})},CO="deserializeHtml",SO=UA({key:CO,then:e=>({editor:{insertData:{format:"text/html",getFragment:({data:t})=>{const n=(r=t,(new DOMParser).parseFromString(r,"text/html"));var r;return kO(e,{element:n.body})}}}})}),TO=(e,t)=>{if(!t(e))return;let n=e.firstChild;for(;n;){const r=n,o=n.previousSibling;n=n.nextSibling,TO(r,t),r.previousSibling||r.nextSibling||r.parentNode||!n||o===n.previousSibling||!n.parentNode?r.previousSibling||r.nextSibling||r.parentNode||!n||n.previousSibling||n.nextSibling||n.parentNode||(o?n=o.nextSibling?o.nextSibling.nextSibling:null:e.firstChild&&(n=e.firstChild.nextSibling)):n=o?o.nextSibling:e.firstChild}},DO=(e,t)=>{let n=null;return((e,t)=>{TO(e,e=>!cO(e)||t(e))})(e,e=>!t(e)||(n=e,!1)),n},AO=(e,t)=>!!DO(e,t),OO=(e,t)=>{const n=xA({},t),{then:r}=n;if(r){delete n.then;const{plugins:t}=n,o=OO(e,UC(r(e,n),n));if(t&&o.plugins){const e=vS(gS(t,"key"),gS(o.plugins,"key"));o.plugins=_S(e)}return o}return n},PO=(e,t)=>{t&&t.forEach(t=>{let n=(e=>(void 0===e.type&&(e.type=e.key),e.options||(e.options={}),e.inject||(e.inject={}),e.editor||(e.editor={}),e))(t);if(n=OO(e,n),!1!==n.enabled){if(e.pluginsByKey[n.key]){const t=e.plugins.indexOf(e.pluginsByKey[n.key]),r=UC(n,e.pluginsByKey[n.key]);t>=0&&(e.plugins[t]=r),e.pluginsByKey[n.key]=r}else e.plugins.push(n),e.pluginsByKey[n.key]=n;PO(e,n.plugins)}})},IO=(e,{id:t,plugins:n=[],disableCorePlugins:r,maxLength:o}={})=>{let i=e;return i.id=null!=t?t:i.id,i.prevSelection=null,i.isFallback=!1,i.currentKeyboardEvent=null,i.reset=()=>BA(i),i.redecorate=()=>{return e="redecorate",()=>{console.warn(`editor.${e} should have been overriden but was not. Please report this issue here: https://github.com/udecode/plate/issues`)};var e},i.plate={get set(){return null}},i.key||(i.key=Math.random()),((e,{disableCorePlugins:t,plugins:n=[],maxLength:r})=>{var o,i,a,s,l,u,c,d,p,f,h,g,m,v,y,b,w,E,_,x,k,C;let S=[];if(!0!==t){const n=t;"object"==typeof n&&(null==n?void 0:n.react)||S.push(null!=(i=null==(o=null==e?void 0:e.pluginsByKey)?void 0:o.react)?i:aO()),"object"==typeof n&&(null==n?void 0:n.history)||S.push(null!=(s=null==(a=null==e?void 0:e.pluginsByKey)?void 0:a.history)?s:KA()),"object"==typeof n&&(null==n?void 0:n.nodeFactory)||S.push(null!=(u=null==(l=null==e?void 0:e.pluginsByKey)?void 0:l[nO])?u:rO()),"object"==typeof n&&(null==n?void 0:n.eventEditor)||S.push(null!=(d=null==(c=null==e?void 0:e.pluginsByKey)?void 0:c[qA])?d:GA()),"object"==typeof n&&(null==n?void 0:n.inlineVoid)||S.push(null!=(f=null==(p=null==e?void 0:e.pluginsByKey)?void 0:p[YA])?f:ZA()),"object"==typeof n&&(null==n?void 0:n.insertData)||S.push(null!=(g=null==(h=null==e?void 0:e.pluginsByKey)?void 0:h[QA])?g:JA()),"object"==typeof n&&(null==n?void 0:n.selection)||S.push(null!=(v=null==(m=null==e?void 0:e.pluginsByKey)?void 0:m[oO])?v:iO()),"object"==typeof n&&(null==n?void 0:n.length)||!Tx(r)||S.push(null!=(b=null==(y=null==e?void 0:e.pluginsByKey)?void 0:y[eO])?b:tO({options:{maxLength:r}})),"object"==typeof n&&(null==n?void 0:n.deserializeHtml)||S.push(null!=(E=null==(w=null==e?void 0:e.pluginsByKey)?void 0:w[CO])?E:SO()),"object"==typeof n&&(null==n?void 0:n.deserializeAst)||S.push(null!=(x=null==(_=null==e?void 0:e.pluginsByKey)?void 0:_[jA])?x:$A()),"object"==typeof n&&(null==n?void 0:n.editorProtocol)||S.push(null!=(C=null==(k=null==e?void 0:e.pluginsByKey)?void 0:k[VA])?C:WA())}S=[...S,...n],e.plugins=[],e.pluginsByKey={},PO(e,S),e.plugins.forEach(t=>{if(t.overrideByKey){const n=e.plugins.map(e=>MA(e,t.overrideByKey));e.plugins=[],e.pluginsByKey={},PO(e,n)}})})(i,{plugins:n,maxLength:o,disableCorePlugins:r}),i.plugins.forEach(e=>{e.withOverrides&&(i=e.withOverrides(i,e))}),i},NO=(e={})=>{var t=e,{editor:n=$p(),plugins:r=[],components:o,overrideByKey:i,normalizeInitialValue:a}=t,s=CA(t,["editor","plugins","components","overrideByKey","normalizeInitialValue"]);r=((e,{components:t,overrideByKey:n}={})=>{let r={};return n&&(r=WT(n)),t&&Object.keys(t).forEach(e=>{r[e]||(r[e]={}),r[e].component=t[e]}),Object.keys(r).length>0?e.map(e=>MA(e,r)):e})(r,{components:o,overrideByKey:i});const l=IO(n,xA({plugins:r},s));return a&&((e,t)=>{md.normalize(e,t)})(l,{force:!0}),l},RO=(e={})=>{const t=NO(e);return t.isFallback=!0,t.apply=()=>{throw new Error("Cannot apply operations on the fallback editor. The fallback editor is used when a hook that depends on the Plate store was unable to locate a valid store. If you are using PlateController, use `useEditorMounted(id?: PlateId)` or `!editor.isFallback` to ensure that a valid Plate store is available before attempting to call operations on the editor.")},t},BO=(e,t)=>{var n;return null!=(n=FA(e,t).options)?n:{}},FO=e=>`slate-${e}`,LO=({attributes:e,nodeProps:t,props:n,type:r})=>{var o;let i={};n&&(i=null!=(o="function"==typeof n?n(t):n)?o:{}),!i.nodeProps&&e&&(i.nodeProps=e),(t=xA(xA({},t),i)).nodeProps&&Object.keys(t.nodeProps).forEach(e=>{var n,r;void 0===(null==(n=t.nodeProps)?void 0:n[e])&&(null==(r=t.nodeProps)||delete r[e])});const{className:a}=t;return kA(xA({},t),{className:GT(FO(r),a)})},MO={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",insertSoftBreak:"shift+enter",italic:"mod+i",moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",splitBlock:"enter",tab:"tab",untab:"shift+tab",undo:"mod+z"},UO={deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},jO={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},$O=e=>{const t=MO[e],n=UO[e],r=jO[e],o=t&&_f(t),i=n&&_f(n),a=r&&_f(r);return e=>!(!o||!o(e))||(!!(wx&&i&&i(e))||!(wx||!a||!a(e)))};$O("bold"),$O("compose"),$O("moveBackward"),$O("moveForward"),$O("deleteBackward"),$O("deleteForward"),$O("deleteLineBackward"),$O("deleteLineForward"),$O("deleteWordBackward"),$O("deleteWordForward"),$O("extendBackward"),$O("extendForward"),$O("extendLineBackward"),$O("extendLineForward"),$O("italic"),$O("moveLineBackward"),$O("moveLineForward"),$O("moveWordBackward"),$O("moveWordForward"),$O("redo"),$O("insertSoftBreak"),$O("splitBlock"),$O("transposeCharacter"),$O("undo");var zO=e=>{NA(kA(xA({},e),{apply:vS}))},HO=(e,t)=>{const n=e.plugins.flatMap(t=>{var n,r;return null!=(r=null==(n=t.decorate)?void 0:n.call(t,e,t))?r:[]});if(t&&n.push(t),0!==n.length)return e=>{let t=[];return n.forEach(n=>{var r;(null==(r=n(e))?void 0:r.length)&&(t=[...t,...r])}),t}},VO=(e,t)=>{if(!t)return!1;const n=t(e);return null!=n?n:e.isPropagationStopped()},WO=(e,{editableProps:t,handlerKey:n})=>{let r=[];r=e.plugins.flatMap(t=>{var r,o,i;return null!=(i=null==(o=null==(r=t.handlers)?void 0:r[n])?void 0:o.call(r,e,t))?i:[]});const o=null==t?void 0:t[n];if(0!==r.length||o)return e=>{const t=e instanceof Event?(e=>{let t=!1;return kA(xA({},e),{nativeEvent:e,currentTarget:e.currentTarget,target:e.target,bubbles:e.bubbles,cancelable:e.cancelable,defaultPrevented:e.defaultPrevented,eventPhase:e.eventPhase,isTrusted:e.isTrusted,timeStamp:e.timeStamp,type:e.type,isDefaultPrevented:()=>e.defaultPrevented,isPropagationStopped:()=>t,persist:()=>{throw new Error("persist is not implemented for synthetic events created using convertDomEventToSyntheticEvent")},preventDefault:()=>e.preventDefault(),stopPropagation:()=>{t=!0,e.stopPropagation()}})})(e):e;return!!r.some(e=>VO(t,e))||VO(t,o)}},qO=(e,t)=>(e.plugins.forEach(e=>{if(e.inject.props){const n=((e,{key:t,inject:{props:n}},r)=>{var o,i,a,s;const{element:l,text:u,className:c,style:d}=r,p=null!=l?l:u;if(!p)return;if(!n)return;const{nodeKey:f=t,styleKey:h=f,validTypes:g,classNames:m,transformClassName:v,transformNodeValue:y,transformProps:b,transformStyle:w,validNodeValues:E,defaultNodeValue:_,query:x}=n,k=null==x?void 0:x(n,r);if(!k&&g&&zp(p)&&p.type&&!g.includes(p.type))return;const C=p[f];if(!k&&(!Tx(C)||E&&!E.includes(C)||C===_))return;const S=kA(xA({},r),{nodeValue:C}),T=null!=(o=null==y?void 0:y(S))?o:C;S.value=T;let D={};return l&&(D.className=GT(c,`slate-${f}-${C}`)),((null==m?void 0:m[C])||v)&&(D.className=null!=(i=null==v?void 0:v(S))?i:GT(c,null==m?void 0:m[T])),h&&(D.style=null!=(a=null==w?void 0:w(S))?a:kA(xA({},d),{[h]:T})),b&&(D=null!=(s=b(S,D))?s:D),D})(0,e,t);n&&(t=xA(xA({},t),n))}}),kA(xA({},t),{editor:e})),GO=(e,t)=>{const n=[];return e.plugins.forEach(t=>{t.isElement&&n.push(((e,{key:t,type:n,component:r,props:o})=>function(i){const{element:a,children:s}=i;if(a.type===n){const l=null!=r?r:Bm,u=e.plugins.flatMap(e=>{var t,n;return null!=(n=null==(t=e.inject)?void 0:t.aboveComponent)?n:[]}),c=e.plugins.flatMap(e=>{var t,n;return null!=(n=null==(t=e.inject)?void 0:t.belowComponent)?n:[]});i=LO({attributes:a.attributes,nodeProps:i,props:o,type:n});let d=s;c.forEach(e=>{const n=e(kA(xA({},i),{key:t}));n&&(d=n(kA(xA({},i),{children:d})))});let p=Da.createElement(l,xA({},i),d);return u.forEach(e=>{const n=e(kA(xA({},i),{key:t}));n&&(p=n(kA(xA({},i),{children:p})))}),Da.createElement(DA,{element:a,scope:t},p)}})(e,t))}),function(r){const o=qO(e,r);let i;return n.some(e=>(i=e(o),!!i)),i||(t?t(o):Da.createElement(Bm,xA({},o)))}},KO=(e,t)=>{const n=[];return e.plugins.forEach(e=>{e.isLeaf&&e.key&&n.push(((e,{key:t,type:n=t,component:r,props:o})=>function(e){const{leaf:t,children:i}=e;if(t[n]){const a=null!=r?r:SA;return e=LO({attributes:t.attributes,props:o,nodeProps:e,type:n}),Da.createElement(a,xA({},e),i)}return i})(0,e))}),function(r){const o=qO(e,r);return n.forEach(e=>{const t=e(o);void 0!==t&&(o.children=t)}),t?t(o):Da.createElement(SA,xA({},o))}},{plateControllerStore:YO,usePlateControllerStore:ZO}=Ws({activeId:ls(null),primaryEditorIds:ls([]),editorStores:ls({})},{name:"plateController"}),XO=()=>ZO().set,QO=e=>{const t=Da.useMemo(()=>ls(t=>{const n=t(YO.atom.editorStores),r=e=>{var t;return e&&null!=(t=n[e])?t:null};if(e)return r(e);const o=[t(YO.atom.activeId),...t(YO.atom.primaryEditorIds)];for(const e of o){const t=r(e);if(t)return t}return null}),[e]);return ZO().get.atom(t)},{usePlateStore:JO}=((e={})=>{var t=e,{decorate:n=null,editor:r=RO(),id:o,isMounted:i=!1,versionDecorate:a=1,versionEditor:s=1,versionSelection:l=1,onChange:u=null,editorRef:c=null,plugins:d=[],rawPlugins:p=[],readOnly:f=null,primary:h=!0,renderElement:g=null,renderLeaf:m=null,value:v=null}=t,y=CA(t,["decorate","editor","id","isMounted","versionDecorate","versionEditor","versionSelection","onChange","editorRef","plugins","rawPlugins","readOnly","primary","renderElement","renderLeaf","value"]);return Ws(xA({decorate:n,editor:r,id:o,isMounted:i,versionDecorate:a,versionEditor:s,versionSelection:l,onChange:u,editorRef:c,plugins:d,rawPlugins:p,readOnly:f,primary:h,renderElement:g,renderLeaf:m,value:v},y),{name:"plate",extend:e=>({trackedEditor:ls(t=>({editor:t(e.editor),version:t(e.versionEditor)})),trackedSelection:ls(t=>({selection:t(e.editor).selection,version:t(e.versionSelection)}))})})})(),eP=(e,{debugHookName:t="usePlateEditorStore"}={})=>{var n;const r=null!=(n=JO(e).store({warnIfNoStore:!1}))?n:null,[o]=Da.useState(!!r),i=o?r:QO(e),a=!!ZO().store({warnIfNoStore:!1}),s=Da.useMemo(()=>ds(),[]);if(!i){if(a)return s;throw new Error(`${t} must be used inside a Plate or PlateController`)}return i},tP=(e,t)=>{const n=eP(e,xA({debugHookName:"usePlateSelectors"},t));return JO({store:n}).get},nP=(e,t)=>{const n=eP(e,xA({debugHookName:"usePlateActions"},t));return JO({store:n}).set},rP=(e,t,n={})=>{const r=Da.useRef(1),o=nP(t,xA({debugHookName:"useIncrementVersion"},n))[e]();return Da.useCallback(()=>{const e=r.current+1;o(e),r.current=e},[o])},oP=(e,t={})=>tP(e,xA({debugHookName:"useEditorRef"},t)).editor(),iP=["readOnly","plugins","onChange","decorate","renderElement","renderLeaf"],aP=({id:e})=>{const t=oP(e),n=((e,t={})=>{const n=rP("versionDecorate",e,xA({debugHookName:"useRedecorate"},t));return Da.useCallback(()=>{n()},[n])})(e),r=JO(e),o=Object.fromEntries(iP.map(e=>[e,r.set[e]()])),i=Da.useMemo(()=>o,[]);return Da.useEffect(()=>{t.redecorate=n,t.plate={set:i}},[t,n,i]),null};function sP({id:e,plugin:t}){var n;const r=oP(e);return null==(n=t.useHooks)||n.call(t,r,t),null}function lP({id:e}){const t=nP(e).isMounted(),n=tP(e).plugins(),r=oP(e),o=tP(e).editorRef();return Da.useEffect(()=>(t(!0),()=>{t(!1)}),[t]),Da.useEffect(()=>"function"==typeof o?(o(r),()=>o(null)):o?(o.current=r,()=>{o.current=null}):void 0,[o,r]),Da.createElement(Da.Fragment,null,n.map(t=>Da.createElement(sP,{key:t.key,id:e,plugin:t})))}var uP=Da.memo(({id:e})=>{const t=Qm(),n=rP("versionEditor",e);Da.useEffect(()=>{n()});const r=rP("versionSelection",e),o=Da.useRef(t.selection),i=cP(o.current,t.selection);return Da.useEffect(()=>{i||r(),o.current=t.selection},[t.selection,i,r]),null}),cP=(e,t)=>!e&&!t||!(!e||!t)&&Dc.equals(e,t),dP=["onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onDOMBeforeInput","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],pP=({id:e})=>{const t=tP(void 0,{debugHookName:"usePlateId"}).id(),n=null!=e?e:t,r=Da.useMemo(()=>hA(YO.atom.editorStores,e=>e.prop(n)),[n]),o=XO().atom(r,{warnIfNoStore:!1}),i=JO(n).store(),a=tP(n).primary(),s=XO().primaryEditorIds({warnIfNoStore:!1}),l=Ta.useContext(mv),u=XO().activeId({warnIfNoStore:!1});return Da.useEffect(()=>(o(null!=i?i:null),()=>{o(null),u(e=>e===n?null:e)}),[i,o,u,n]),Da.useEffect(()=>{if(a)return s(e=>[...e,n]),()=>{s(e=>e.filter(e=>e!==n))}},[n,a,s]),Da.useEffect(()=>{n&&l&&u(n)},[n,l,u]),null};function fP({id:e,children:t}){var n;const r=(({id:e})=>{const t=oP(e),n=tP(e).value(),r=nP(e).value(),o=tP(e).onChange(),i=Da.useCallback(e=>{const n=(e=>{const t=e.plugins.flatMap(t=>{var n,r,o;return null!=(o=null==(r=null==(n=t.handlers)?void 0:n.onChange)?void 0:r.call(n,e,t))?o:[]});return e=>t.some(t=>{if(!t)return!1;const n=t(e);return null!=n&&n})})(t)(e);n||null==o||o(e),r(e)},[t,r,o]);return Da.useMemo(()=>({key:t.key,editor:t,onChange:i,value:n,initialValue:n}),[t,i,n])})({id:e}),o=oP(e);let i=Da.createElement(bv,xA({},r),t);return null==(n=o.plugins)||n.forEach(e=>{const{renderAboveSlate:t}=e;t&&(i=Da.createElement(t,null,i))}),i}var hP=Da.forwardRef((e,t)=>{var n=e,{renderEditable:r}=n,o=CA(n,["renderEditable"]);const{id:i}=o,a=oP(i);if(!a)throw new Error("Editor not found. Please ensure that PlateContent is rendered below Plate.");const s=((e={})=>{const{id:t}=e,n=oP(t),r=tP(t),o=r.versionDecorate(),i=r.readOnly(),a=r.decorate(),s=r.renderLeaf(),l=r.renderElement(),u=Da.useMemo(()=>HO(n,null!=a?a:null==e?void 0:e.decorate),[null==e?void 0:e.decorate,n,a]),c=Da.useMemo(()=>{if(o&&u)return e=>u(e)},[u,o]),d=Da.useMemo(()=>GO(n,null!=l?l:null==e?void 0:e.renderElement),[null==e?void 0:e.renderElement,n,l]),p=Da.useMemo(()=>KO(n,null!=s?s:null==e?void 0:e.renderLeaf),[null==e?void 0:e.renderLeaf,n,s]),f=DD(()=>{const t={decorate:c,renderElement:d,renderLeaf:p};return Tx(i)&&(t.readOnly=i),dP.forEach(r=>{const o=WO(n,{editableProps:e,handlerKey:r});o&&(t[r]=o)}),t},[c,e,d,p,i]);return DD(()=>xA(xA({},kD(e,[...dP,"renderElement","renderLeaf"])),f),[e,f])})(o),l=Da.createElement(lv,xA({ref:t},s));let u=null,c=null;a.plugins.forEach(e=>{const{renderBeforeEditable:t,renderAfterEditable:n}=e;n&&(u=Da.createElement(Da.Fragment,null,u,Da.createElement(n,xA({},s)))),t&&(c=Da.createElement(Da.Fragment,null,c,Da.createElement(t,xA({},s))))});let d=Da.createElement(Da.Fragment,null,c,r?r(l):l,Da.createElement(aP,{id:i}),Da.createElement(uP,{id:i}),Da.createElement(lP,{id:i}),Da.createElement(pP,{id:i}),u);return a.plugins.forEach(e=>{const{renderAboveEditable:t}=e;t&&(d=Da.createElement(t,null,d))}),Da.createElement(fP,{id:i},d)});function gP(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}hP.displayName="PlateContent";var mP=Symbol.for("react.lazy"),vP=Aa[" use ".trim().toString()];function yP(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===mP&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function bP(e){const t=EP(e),n=Ta.forwardRef((e,n)=>{let{children:r,...o}=e;yP(r)&&"function"==typeof vP&&(r=vP(r._payload));const i=Ta.Children.toArray(r),a=i.find(xP);if(a){const e=a.props.children,r=i.map(t=>t===a?Ta.Children.count(e)>1?Ta.Children.only(null):Ta.isValidElement(e)?e.props.children:null:t);return Ks.jsx(t,{...o,ref:n,children:Ta.isValidElement(e)?Ta.cloneElement(e,void 0,r):null})}return Ks.jsx(t,{...o,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var wP=bP("Slot");function EP(e){const t=Ta.forwardRef((e,t)=>{let{children:n,...r}=e;if(yP(n)&&"function"==typeof vP&&(n=vP(n._payload)),Ta.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==Ta.Fragment&&(o.ref=t?function(...e){return t=>{let n=!1;const r=e.map(e=>{const r=gP(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():gP(e[t],null)}}}}(t,e):e),Ta.cloneElement(n,o)}return Ta.Children.count(n)>1?Ta.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _P=Symbol("radix.slottable");function xP(e){return Ta.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===_P}function kP(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=kP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}var CP=Object.defineProperty,SP=Object.defineProperties,TP=Object.getOwnPropertyDescriptors,DP=Object.getOwnPropertySymbols,AP=Object.prototype.hasOwnProperty,OP=Object.prototype.propertyIsEnumerable,PP=(e,t,n)=>t in e?CP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IP=(e,t)=>{for(var n in t||(t={}))AP.call(t,n)&&PP(e,n,t[n]);if(DP)for(var n of DP(t))OP.call(t,n)&&PP(e,n,t[n]);return e},NP=(e,t)=>{var n={};for(var r in e)AP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&DP)for(var r of DP(e))t.indexOf(r)<0&&OP.call(e,r)&&(n[r]=e[r]);return n},RP=e=>Da.forwardRef((t,n)=>{var r=t,{as:o,asChild:i=!1}=r,a=NP(r,["as","asChild"]);const s=i?wP:o||e;return Da.createElement(s,IP({ref:n},a))}),BP=RP("div"),FP=RP("span"),LP=(...e)=>Da.useCallback(((...e)=>t=>e.forEach(e=>((e,t)=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})(e,t)))(...e),e),MP=e=>{const t=RP(e);return({propsHook:e,stateHook:n}={})=>Da.forwardRef((r,o)=>{var i,a,s=r,{asChild:l,options:u,state:c,className:d,getClassName:p}=s,f=NP(s,["asChild","options","state","className","getClassName"]);const h=Tx(c)?c:n?n(u):void 0,{ref:g,props:m,hidden:v}=e?e(h):{props:{},hidden:!1,ref:null},y=LP(o,g),b=Tx(null==m?void 0:m.className)||Tx(d)?function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=kP(e))&&(r&&(r+=" "),r+=t);return r}(null==m?void 0:m.className,d):void 0,w=(null==m?void 0:m.style)||f.style?IP(IP({},null==m?void 0:m.style),f.style):void 0;return!l&&v?null:Da.createElement(t,IP(IP((E=IP({ref:y,asChild:l},m),SP(E,TP({className:b,style:w}))),f),null!=(a=null==(i=f.setProps)?void 0:i.call(f,null!=m?m:{}))?a:{}));var E})};function UP(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=UP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function jP(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=UP(e))&&(r&&(r+=" "),r+=t);return r}"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?Da.useLayoutEffect:Da.useEffect;var $P=nk,zP=Tv,HP=AC,VP=Zk,WP=Object.prototype,qP=WP.hasOwnProperty;$P(function(e,t){e=Object(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&HP(t[0],t[1],o)&&(r=1);++n<r;)for(var i=t[n],a=VP(i),s=-1,l=a.length;++s<l;){var u=a[s],c=e[u];(void 0===c||zP(c,WP[u])&&!qP.call(e,u))&&(e[u]=i[u])}return e});var GP=Object.defineProperty,KP=Object.defineProperties,YP=Object.getOwnPropertyDescriptors,ZP=Object.getOwnPropertySymbols,XP=Object.prototype.hasOwnProperty,QP=Object.prototype.propertyIsEnumerable,JP=(e,t,n)=>t in e?GP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eI=(e,t)=>{for(var n in t||(t={}))XP.call(t,n)&&JP(e,n,t[n]);if(ZP)for(var n of ZP(t))QP.call(t,n)&&JP(e,n,t[n]);return e},tI=(e,t)=>KP(e,YP(t)),nI=(e,t)=>{var n={};for(var r in e)XP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&ZP)for(var r of ZP(e))t.indexOf(r)<0&&QP.call(e,r)&&(n[r]=e[r]);return n},rI=Da.forwardRef((e,t)=>{const{ref:n,props:r}=(e=>{const t=e,{editor:n,attributes:r,nodeProps:o,element:i,elementToAttributes:a}=t,s=nI(t,["editor","attributes","nodeProps","element","elementToAttributes"]);return{ref:LP(e.ref,r.ref),props:tI(eI(eI(eI(eI({},r),s),o),null==a?void 0:a(i)),{className:jP(e.className,null==o?void 0:o.className)})}})(tI(eI({},e),{ref:t}));return Da.createElement(BP,tI(eI({},r),{ref:n}))});rI.displayName="PlateElement";var oI=Da.forwardRef((e,t)=>{const{ref:n,props:r}=(e=>{const t=e,{editor:n,attributes:r,nodeProps:o,text:i,leaf:a,leafToAttributes:s}=t,l=nI(t,["editor","attributes","nodeProps","text","leaf","leafToAttributes"]);return{ref:LP(e.ref,r.ref),props:tI(eI(eI(eI(eI({},r),l),o),null==s?void 0:s(a)),{className:jP(e.className,null==o?void 0:o.className)})}})(tI(eI({},e),{ref:t}));return Da.createElement(FP,tI(eI({},r),{ref:n}))});oI.displayName="PlateLeaf";var iI=(e,{type:t,options:{hotkey:n,clear:r}})=>o=>{o.defaultPrevented||n&&Ef(n,o)&&(o.preventDefault(),((e,{key:t,clear:n})=>{e.selection&&Gp(e,()=>{if(Lx(e,t))Mx(e,{key:t});else{if(n){const t=kv(n);Mx(e,{key:t})}e.addMark(t,!0)}})})(e,{key:t,clear:r}))};const aI={};function sI(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return lI(e.children,t,n)}return Array.isArray(e)?lI(e,t,n):""}function lI(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=sI(e[o],t,n);return r.join("")}const uI=document.createElement("i");function cI(e){const t="&"+e+";";uI.innerHTML=t;const n=uI.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}function dI(e,t,n,r){const o=e.length;let i,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)i=r.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function pI(e,t){return e.length>0?(dI(e,e.length,0,t),e):t}const fI={}.hasOwnProperty;function hI(e,t){let n;for(n in t){const r=(fI.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){fI.call(r,i)||(r[i]=[]);const e=o[i];gI(r[i],Array.isArray(e)?e:e?[e]:[])}}}function gI(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);dI(e,0,0,r)}function mI(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function vI(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const yI=OI(/[A-Za-z]/),bI=OI(/[\dA-Za-z]/),wI=OI(/[#-'*+\--9=?A-Z^-~]/);function EI(e){return null!==e&&(e<32||127===e)}const _I=OI(/\d/),xI=OI(/[\dA-Fa-f]/),kI=OI(/[!-/:-@[-`{-~]/);function CI(e){return null!==e&&e<-2}function SI(e){return null!==e&&(e<0||32===e)}function TI(e){return-2===e||-1===e||32===e}const DI=OI(/\p{P}|\p{S}/u),AI=OI(/\s/);function OI(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function PI(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(TI(r))return e.enter(n),a(r);return t(r)};function a(r){return TI(r)&&i++<o?(e.consume(r),a):(e.exit(n),t(r))}}const II={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),PI(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):CI(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const NI={tokenize:function(e){const t=this,n=[];let r,o,i,a=0;return s;function s(r){if(a<n.length){const o=n[a];return t.containerState=o[1],e.attempt(o[0].continuation,l,u)(r)}return u(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}v(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return dI(t.events,i+1,0,t.events.slice(n)),t.events.length=s,u(e)}return s(e)}function u(o){if(a===n.length){if(!r)return p(o);if(r.currentConstruct&&r.currentConstruct.concrete)return h(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(RI,c,d)(o)}function c(e){return r&&y(),v(a),p(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,h(e)}function p(n){return t.containerState={},e.attempt(RI,f,h)(n)}function f(e){return a++,n.push([t.currentConstruct,t.containerState]),p(e)}function h(n){return null===n?(r&&y(),v(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),g(n))}function g(n){return null===n?(m(e.exit("chunkFlow"),!0),v(0),void e.consume(n)):CI(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),g)}function m(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){s=t.events[l][1].end;break}o=!0}for(v(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;dI(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function v(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},RI={tokenize:function(e,t,n){return PI(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function BI(e){return null===e||SI(e)||AI(e)?1:DI(e)?2:void 0}function FI(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const LI={name:"attention",resolveAll:function(e,t){let n,r,o,i,a,s,l,u,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const d={...e[n][1].end},p={...e[c][1].start};MI(d,-s),MI(p,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[c][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=pI(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=pI(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=pI(l,FI(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=pI(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,l=pI(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,dI(e,n-1,c-n+3,l),c=n+l.length-u-2;break}c=-1;for(;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=BI(r);let i;return function(t){return i=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===i)return e.consume(s),a;const l=e.exit("attentionSequence"),u=BI(s),c=!u||2===u&&o||n.includes(s),d=!o||2===o&&u||n.includes(r);return l._open=Boolean(42===i?c:c&&(o||!d)),l._close=Boolean(42===i?d:d&&(u||!c)),t(s)}}};function MI(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const UI={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return yI(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(e){return 43===e||45===e||46===e||bI(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||bI(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||EI(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),u):wI(t)?(e.consume(t),l):n(t)}function u(e){return bI(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,u):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||bI(t))&&r++<63){const n=45===t?d:c;return e.consume(t),n}return n(t)}}};const jI={partial:!0,tokenize:function(e,t,n){return function(t){return TI(t)?PI(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||CI(e)?t(e):n(e)}}};const $I={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(TI(t))return PI(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt($I,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return TI(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const zI={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return kI(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const HI={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=bI,u(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=xI,u):(e.enter("characterReferenceValue"),o=7,i=_I,u(t))}function u(s){if(59===s&&a){const o=e.exit("characterReferenceValue");return i!==bI||cI(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&a++<o?(e.consume(s),u):n(s)}}};const VI={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},WI={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return a;function a(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),TI(t)?PI(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):u(t)}function u(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(o++,e.consume(t),c):o>=s?(e.exit("codeFencedFenceSequence"),TI(t)?PI(e,d,"whitespace")(t):d(t)):n(t)}function d(r){return null===r||CI(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),TI(t)?PI(e,u,"whitespace")(t):u(t))}function u(n){return null===n||CI(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(VI,f,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||CI(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(t)):TI(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),PI(e,d,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),c)}function d(t){return null===t||CI(t)?u(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(t))}function p(t){return null===t||CI(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(t)):96===t&&t===i?n(t):(e.consume(t),p)}function f(t){return e.attempt(o,y,h)(t)}function h(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),g}function g(t){return a>0&&TI(t)?PI(e,m,"linePrefix",a+1)(t):m(t)}function m(t){return null===t||CI(t)?e.check(VI,f,y)(t):(e.enter("codeFlowValue"),v(t))}function v(t){return null===t||CI(t)?(e.exit("codeFlowValue"),m(t)):(e.consume(t),v)}function y(n){return e.exit("codeFenced"),t(n)}}};const qI={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),PI(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):CI(t)?e.attempt(GI,i,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||CI(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}},GI={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):CI(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):PI(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):CI(e)?o(e):n(e)}}};const KI={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}t=o-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),i++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,u(t)):CI(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||CI(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function u(n){return 96===n?(e.consume(n),r++,u):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}};class YI{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&ZI(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),ZI(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ZI(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);ZI(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);ZI(this.left,t.reverse())}}}function ZI(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function XI(e){const t={};let n,r,o,i,a,s,l,u=-1;const c=new YI(e);for(;++u<c.length;){for(;u in t;)u=t[u];if(n=c.get(u),u&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(u-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,QI(c,u)),u=t[u],l=!0);else if(n[1]._container){for(o=u,r=void 0;o--;)if(i=c.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type&&"listItemIndent"!==i[1].type)break;r&&(n[1].end={...c.get(r)[1].start},a=c.slice(r,u),a.unshift(n),c.splice(r,u-r+1,a))}}return dI(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function QI(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],u={};let c,d,p=-1,f=n,h=0,g=0;const m=[g];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(c=r.sliceStream(f),f.next||c.push(null),d&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++p<s.length;)"exit"===s[p][0]&&"enter"===s[p-1][0]&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(g=p+1,m.push(g),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):m.pop(),p=m.length;p--;){const t=s.slice(m[p],m[p+1]),n=i.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),p=-1;++p<l.length;)u[h+l[p][0]]=h+l[p][1],h+=l[p][1]-l[p][0]-1;return u}const JI={resolve:function(e){return XI(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):CI(t)?e.check(eN,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},eN={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),PI(e,o,"linePrefix")};function o(o){if(null===o||CI(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function tN(e,t,n,r,o,i,a,s,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d;if(null===t||32===t||41===t||EI(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(t)};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||CI(t)?n(t):(e.consume(t),92===t?f:p)}function f(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(o){return c||null!==o&&41!==o&&!SI(o)?c<u&&40===o?(e.consume(o),c++,h):41===o?(e.consume(o),c--,h):null===o||32===o||40===o||EI(o)?n(o):(e.consume(o),92===o?g:h):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function g(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function nN(e,t,n,r,o,i){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),u};function u(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):CI(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(t){return null===t||91===t||93===t||CI(t)||l++>999?(e.exit("chunkString"),u(t)):(e.consume(t),s||(s=!TI(t)),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function rN(e,t,n,r,o,i){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):CI(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),PI(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===a||null===t||CI(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:u)}function c(t){return t===a||92===t?(e.consume(t),u):u(t)}}function oN(e,t){let n;return function r(o){if(CI(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(TI(o))return PI(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}const iN={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return nN.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=vI(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return SI(t)?oN(e,s)(t):s(t)}function s(t){return tN(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(aN,u,u)(t)}function u(t){return TI(t)?PI(e,c,"whitespace")(t):c(t)}function c(i){return null===i||CI(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},aN={partial:!0,tokenize:function(e,t,n){return function(t){return SI(t)?oN(e,r)(t):n(t)};function r(t){return rN(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return TI(t)?PI(e,i,"whitespace")(t):i(t)}function i(e){return null===e||CI(e)?t(e):n(e)}}};const sN={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return CI(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const lN={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},dI(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||SI(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||CI(n)?(e.exit("atxHeading"),t(n)):TI(n)?PI(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||SI(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const uN=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],cN=["pre","script","style","textarea"],dN={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let o,i,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),u}(t)};function u(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),i=!0,f):63===s?(e.consume(s),o=3,r.interrupt?t:R):yI(s)?(e.consume(s),a=String.fromCharCode(s),h):n(s)}function c(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,s=0,p):yI(i)?(e.consume(i),o=4,r.interrupt?t:R):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:R):n(o)}function p(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:S:p):n(o)}function f(t){return yI(t)?(e.consume(t),a=String.fromCharCode(t),h):n(t)}function h(s){if(null===s||47===s||62===s||SI(s)){const l=47===s,u=a.toLowerCase();return l||i||!cN.includes(u)?uN.includes(a.toLowerCase())?(o=6,l?(e.consume(s),g):r.interrupt?t(s):S(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?m(s):v(s)):(o=1,r.interrupt?t(s):S(s))}return 45===s||bI(s)?(e.consume(s),a+=String.fromCharCode(s),h):n(s)}function g(o){return 62===o?(e.consume(o),r.interrupt?t:S):n(o)}function m(t){return TI(t)?(e.consume(t),m):k(t)}function v(t){return 47===t?(e.consume(t),k):58===t||95===t||yI(t)?(e.consume(t),y):TI(t)?(e.consume(t),v):k(t)}function y(t){return 45===t||46===t||58===t||95===t||bI(t)?(e.consume(t),y):b(t)}function b(t){return 61===t?(e.consume(t),w):TI(t)?(e.consume(t),b):v(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,E):TI(t)?(e.consume(t),w):_(t)}function E(t){return t===l?(e.consume(t),l=null,x):null===t||CI(t)?n(t):(e.consume(t),E)}function _(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||SI(t)?b(t):(e.consume(t),_)}function x(e){return 47===e||62===e||TI(e)?v(e):n(e)}function k(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return null===t||CI(t)?S(t):TI(t)?(e.consume(t),C):n(t)}function S(t){return 45===t&&2===o?(e.consume(t),O):60===t&&1===o?(e.consume(t),P):62===t&&4===o?(e.consume(t),B):63===t&&3===o?(e.consume(t),R):93===t&&5===o?(e.consume(t),N):!CI(t)||6!==o&&7!==o?null===t||CI(t)?(e.exit("htmlFlowData"),T(t)):(e.consume(t),S):(e.exit("htmlFlowData"),e.check(pN,F,T)(t))}function T(t){return e.check(fN,D,F)(t)}function D(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return null===t||CI(t)?T(t):(e.enter("htmlFlowData"),S(t))}function O(t){return 45===t?(e.consume(t),R):S(t)}function P(t){return 47===t?(e.consume(t),a="",I):S(t)}function I(t){if(62===t){const n=a.toLowerCase();return cN.includes(n)?(e.consume(t),B):S(t)}return yI(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),I):S(t)}function N(t){return 93===t?(e.consume(t),R):S(t)}function R(t){return 62===t?(e.consume(t),B):45===t&&2===o?(e.consume(t),R):S(t)}function B(t){return null===t||CI(t)?(e.exit("htmlFlowData"),F(t)):(e.consume(t),B)}function F(n){return e.exit("htmlFlow"),t(n)}}},pN={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(jI,t,n)}}},fN={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(CI(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const hN={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),w):63===t?(e.consume(t),y):yI(t)?(e.consume(t),x):n(t)}function l(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),i=0,f):yI(t)?(e.consume(t),v):n(t)}function u(t){return 45===t?(e.consume(t),p):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),d):CI(t)?(a=c,I(t)):(e.consume(t),c)}function d(t){return 45===t?(e.consume(t),p):c(t)}function p(e){return 62===e?P(e):45===e?d(e):c(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?h:f):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),g):CI(t)?(a=h,I(t)):(e.consume(t),h)}function g(t){return 93===t?(e.consume(t),m):h(t)}function m(t){return 62===t?P(t):93===t?(e.consume(t),m):h(t)}function v(t){return null===t||62===t?P(t):CI(t)?(a=v,I(t)):(e.consume(t),v)}function y(t){return null===t?n(t):63===t?(e.consume(t),b):CI(t)?(a=y,I(t)):(e.consume(t),y)}function b(e){return 62===e?P(e):y(e)}function w(t){return yI(t)?(e.consume(t),E):n(t)}function E(t){return 45===t||bI(t)?(e.consume(t),E):_(t)}function _(t){return CI(t)?(a=_,I(t)):TI(t)?(e.consume(t),_):P(t)}function x(t){return 45===t||bI(t)?(e.consume(t),x):47===t||62===t||SI(t)?k(t):n(t)}function k(t){return 47===t?(e.consume(t),P):58===t||95===t||yI(t)?(e.consume(t),C):CI(t)?(a=k,I(t)):TI(t)?(e.consume(t),k):P(t)}function C(t){return 45===t||46===t||58===t||95===t||bI(t)?(e.consume(t),C):S(t)}function S(t){return 61===t?(e.consume(t),T):CI(t)?(a=S,I(t)):TI(t)?(e.consume(t),S):k(t)}function T(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,D):CI(t)?(a=T,I(t)):TI(t)?(e.consume(t),T):(e.consume(t),A)}function D(t){return t===o?(e.consume(t),o=void 0,O):null===t?n(t):CI(t)?(a=D,I(t)):(e.consume(t),D)}function A(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||SI(t)?k(t):(e.consume(t),A)}function O(e){return 47===e||62===e||SI(e)?k(e):n(e)}function P(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N}function N(t){return TI(t)?PI(e,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):R(t)}function R(t){return e.enter("htmlTextData"),a(t)}}};const gN={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&dI(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,o,i,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",l,t],["enter",u,t]],i=pI(i,e.slice(r+1,r+s+3)),i=pI(i,[["enter",c,t]]),i=pI(i,FI(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=pI(i,[["exit",c,t],e[o-2],e[o-1],["exit",u,t]]),i=pI(i,e.slice(o+1)),i=pI(i,[["exit",l,t]]),dI(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){o=r.events[a][1];break}return function(t){if(!o)return n(t);if(o._inactive)return c(t);return i=r.parser.defined.includes(vI(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(mN,u,i?u:c)(t):91===t?e.attempt(vN,u,i?l:c)(t):i?u(t):c(t)}function l(t){return e.attempt(yN,u,c)(t)}function u(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},mN={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return SI(t)?oN(e,o)(t):o(t)}function o(t){return 41===t?u(t):tN(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return SI(t)?oN(e,s)(t):u(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?rN(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function l(t){return SI(t)?oN(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},vN={tokenize:function(e,t,n){const r=this;return function(t){return nN.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(vI(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},yN={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const bN={name:"labelStartImage",resolveAll:gN.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const wN={name:"labelStartLink",resolveAll:gN.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const EN={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),PI(e,t,"linePrefix")}}};const _N={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),a(i)):o>=3&&(null===i||CI(i))?(e.exit("thematicBreak"),t(i)):n(i)}function a(t){return t===r?(e.consume(t),o++,a):(e.exit("thematicBreakSequence"),TI(t)?PI(e,i,"whitespace")(t):i(t))}}};const xN={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(jI,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,PI(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){if(r.containerState.furtherBlankLines||!TI(n))return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n);return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(CN,t,o)(n)});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,PI(e,e.attempt(xN,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:_I(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(_N,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return _I(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(jI,r.interrupt?n:u,e.attempt(kN,d,c))}function u(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function c(t){return TI(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},kN={partial:!0,tokenize:function(e,t,n){const r=this;return PI(e,function(e){const o=r.events[r.events.length-1];return!TI(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},CN={partial:!0,tokenize:function(e,t,n){const r=this;return PI(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const SN={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a;return e.push(["exit",a,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),TI(t)?PI(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||CI(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const TN={tokenize:function(e){const t=this,n=e.attempt(jI,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,PI(e,e.attempt(this.parser.constructs.flow,r,e.attempt(JI,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const DN={resolveAll:IN()},AN=PN("string"),ON=PN("text");function PN(e){return{resolveAll:IN("text"===e?NN:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function IN(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function NN(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,a=o.length,s=-1,l=0;for(;a--;){const e=o[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)i=!0,l++;else if(-1!==e){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const RN={42:xN,43:xN,45:xN,48:xN,49:xN,50:xN,51:xN,52:xN,53:xN,54:xN,55:xN,56:xN,57:xN,62:$I},BN={91:iN},FN={[-2]:qI,[-1]:qI,32:qI},LN={35:lN,42:_N,45:[SN,_N],60:dN,61:SN,95:_N,96:WI,126:WI},MN={38:HI,92:zI},UN={[-5]:EN,[-4]:EN,[-3]:EN,33:bN,38:HI,42:LI,60:[UI,hN],91:wN,92:[sN,zI],93:gN,95:LI,96:KI},jN={null:[LI,DN]};var $N=Object.freeze({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:BN,disable:{null:[]},document:RN,flow:LN,flowInitial:FN,insideSpan:jN,string:MN,text:UN});function zN(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let a=[],s=[];const l={attempt:m(function(e,t){v(e,t.from)}),check:m(g),consume:function(e){CI(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,y()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));u.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=p(),u.events.push(["enter",n,u]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=p(),u.events.push(["exit",t,u]),t},interrupt:m(g,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,y()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if("string"==typeof i)a=i;else switch(i){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&o)continue;a=" ";break;default:a=String.fromCharCode(i)}o=-2===i,r.push(a)}return r.join("")}(d(e),t)},sliceStream:d,write:function(e){if(a=pI(a,e),f(),null!==a[a.length-1])return[];return v(t,0),u.events=FI(i,u.events,u),u.events}};let c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function d(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}(a,e)}function p(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function f(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)h(t.charCodeAt(r._bufferIndex));else h(t)}}function h(e){c=c(e)}function g(e,t){t.restore()}function m(e,t){return function(n,o,i){let a,c,d,f;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return h([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function h(e){return a=e,c=0,0===e.length?i:g(e[c])}function g(e){return function(n){f=function(){const e=p(),t=u.previous,n=u.currentConstruct,o=u.events.length,i=Array.from(s);return{from:o,restore:a};function a(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=o,s=i,y()}}(),d=e,e.partial||(u.currentConstruct=e);if(e.name&&u.parser.constructs.disable.null.includes(e.name))return v();return e.tokenize.call(t?Object.assign(Object.create(u),t):u,l,m,v)(n)}}function m(t){return e(d,f),o}function v(e){return f.restore(),++c<a.length?g(a[c]):i}}}function v(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&dI(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function y(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function HN(e){const t=function(e){const t={};let n=-1;for(;++n<e.length;)hI(t,e[n]);return t}([$N,...(e||{}).extensions||[]]),n={constructs:t,content:r(II),defined:[],document:r(NI),flow:r(TN),lazy:{},string:r(AN),text:r(ON)};return n;function r(e){return function(t){return zN(n,e,t)}}}const VN=/[\0\t\n\r]/g;const WN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function qN(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return mI(n.slice(t?2:1),t?16:10)}return cI(n)||e}function GN(e){return e&&"object"==typeof e?"position"in e||"type"in e?YN(e.position):"start"in e||"end"in e?YN(e):"line"in e||"column"in e?KN(e):"":""}function KN(e){return ZN(e&&e.line)+":"+ZN(e&&e.column)}function YN(e){return KN(e&&e.start)+"-"+KN(e&&e.end)}function ZN(e){return e&&"number"==typeof e?e:1}const XN={}.hasOwnProperty;function QN(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(X),blockQuote:i(q),characterEscape:C,characterReference:C,codeFenced:i(G),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(G,a),codeText:i(K,a),codeTextData:C,data:C,codeFlowValue:C,definition:i(Y),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(Z),hardBreakEscape:i(Q),hardBreakTrailing:i(Q),htmlFlow:i(J,a),htmlFlowData:C,htmlText:i(J,a),htmlTextData:C,image:i(ee),label:a,link:i(te),listItem:i(re),listItemValue:p,listOrdered:i(ne,d),listUnordered:i(ne),paragraph:i(oe),reference:U,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(X),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:W,autolinkProtocol:V,blockQuote:l(),characterEscapeValue:S,characterReferenceMarkerHexadecimal:$,characterReferenceMarkerNumeric:$,characterReferenceValue:z,characterReference:H,codeFenced:l(m),codeFencedFence:g,codeFencedFenceInfo:f,codeFencedFenceMeta:h,codeFlowValue:S,codeIndented:l(v),codeText:l(P),codeTextData:S,data:S,definition:l(),definitionDestinationString:w,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(A),htmlFlowData:S,htmlText:l(O),htmlTextData:S,image:l(N),label:B,labelText:R,lineEnding:T,link:l(I),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:j,resourceDestinationString:F,resourceTitleString:L,resource:M,setextHeading:l(k),setextHeadingLineSequence:x,setextHeadingText:_,strong:l(),thematicBreak:l()}};eR(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:u,buffer:a,resume:c,data:n},l=[];let d=-1;for(;++d<e.length;)if("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)if("enter"===e[d][0])l.push(d);else{d=o(e,l.pop(),d)}for(d=-1;++d<e.length;){const n=t[e[d][0]];XN.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},i),e[d][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||nR).call(i,void 0,e[0])}for(r.position={start:JN(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:JN(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function o(e,t,n){let r,o,i,a,s=t-1,l=-1,u=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||i||(i=s),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=s;for(o=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",o=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,a=!0}}}return e[t][1]._spread=u,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:JN(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+GN({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||nR).call(this,e,r[0])}n.position.end=JN(e.end)}function c(){return function(e){return sI(e,"boolean"!=typeof aI.includeImageAlt||aI.includeImageAlt,"boolean"!=typeof aI.includeHtml||aI.includeHtml)}(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function f(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function h(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function m(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function y(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=vI(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function E(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function x(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function C(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=ae(),n.position={start:JN(e.start),end:void 0},t.push(n)),this.stack.push(n)}function S(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=JN(e.end)}function T(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=JN(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(C.call(this,e),S.call(this,e))}function D(){this.data.atHardBreak=!0}function A(){const e=this.resume();this.stack[this.stack.length-1].value=e}function O(){const e=this.resume();this.stack[this.stack.length-1].value=e}function P(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function R(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(WN,qN)}(t),n.identifier=vI(t).toLowerCase()}function B(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function F(){const e=this.resume();this.stack[this.stack.length-1].url=e}function L(){const e=this.resume();this.stack[this.stack.length-1].title=e}function M(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function j(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=vI(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function $(e){this.data.characterReferenceType=e.type}function z(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=mI(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=cI(t)}this.stack[this.stack.length-1].value+=r}function H(e){this.stack.pop().position.end=JN(e.end)}function V(e){S.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function W(e){S.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function q(){return{type:"blockquote",children:[]}}function G(){return{type:"code",lang:null,meta:null,value:""}}function K(){return{type:"inlineCode",value:""}}function Y(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Z(){return{type:"emphasis",children:[]}}function X(){return{type:"heading",depth:0,children:[]}}function Q(){return{type:"break"}}function J(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function ae(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!XI(e););return e}(HN(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,a){const s=[];let l,u,c,d,p;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(VN.lastIndex=c,l=VN.exec(o),d=l&&void 0!==l.index?l.index:o.length,p=o.charCodeAt(d),!l){n=o.slice(c);break}if(10===p&&c===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),c<d&&(s.push(o.slice(c,d)),t+=d-c),p){case 0:s.push(65533),t++;break;case 9:for(u=4*Math.ceil(t/4),s.push(-2);t++<u;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}c=d+1}return a&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function JN(e){return{line:e.line,column:e.column,offset:e.offset}}function eR(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?eR(e,r):tR(e,r)}}function tR(e,t){let n;for(n in t)if(XN.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function nR(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+GN({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+GN({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+GN({start:t.start,end:t.end})+") is still open")}function rR(e){const t=this;t.parser=function(n){return QN(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function oR(e){if(e)throw e}function iR(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function aR(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...a){const s=e[++n];let l=-1;if(i)r(i);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let a;r&&t.push(o);try{a=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(a&&a.then&&"function"==typeof a.then?a.then(i,o):a instanceof Error?o(a):i(a))}function o(e,...r){n||(n=!0,t(e,...r))}function i(e){o(null,e)}}(s,o)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}class sR extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=GN(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}sR.prototype.file="",sR.prototype.name="",sR.prototype.reason="",sR.prototype.message="",sR.prototype.stack="",sR.prototype.column=void 0,sR.prototype.line=void 0,sR.prototype.ancestors=void 0,sR.prototype.cause=void 0,sR.prototype.fatal=void 0,sR.prototype.place=void 0,sR.prototype.ruleId=void 0,sR.prototype.source=void 0;const lR={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');uR(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=a));r===o?o=a:o<0&&(o=e.length);return e.slice(r,o)},dirname:function(e){if(uR(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){uR(e);let t,n=e.length,r=-1,o=0,i=-1,a=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1);else if(t){o=n+1;break}}if(i<0||r<0||0===a||1===a&&i===r-1&&i===o+1)return"";return e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)uR(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){uR(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,a=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===s);else if(a!==l-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),a=l,s=0;continue}}else if(o.length>0){o="",i=0,a=l,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,l):o=e.slice(a+1,l),i=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function uR(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cR={cwd:function(){return"/"}};function dR(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function pR(e){if("string"==typeof e)e=new URL(e);else if(!dR(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const fR=["history","path","basename","stem","extname","dirname"];class hR{constructor(e){let t;t=e?dR(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":cR.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<fR.length;){const e=fR[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)fR.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?lR.basename(this.path):void 0}set basename(e){mR(e,"basename"),gR(e,"basename"),this.path=lR.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?lR.dirname(this.path):void 0}set dirname(e){vR(this.basename,"dirname"),this.path=lR.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?lR.extname(this.path):void 0}set extname(e){if(gR(e,"extname"),vR(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=lR.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){dR(e)&&(e=pR(e)),mR(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?lR.basename(this.path,this.extname):void 0}set stem(e){mR(e,"stem"),gR(e,"stem"),this.path=lR.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new sR(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function gR(e,t){if(e&&e.includes(lR.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+lR.sep+"`")}function mR(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function vR(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const yR=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};Object.setPrototypeOf(r,t);const o=Object.getOwnPropertyNames(n);for(const e of o){const t=Object.getOwnPropertyDescriptor(n,e);t&&Object.defineProperty(r,e,t)}return r},bR={}.hasOwnProperty;class wR extends yR{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=aR()}copy(){const t=new wR;let n=-1;for(;++n<this.attachers.length;){const e=this.attachers[n];t.use(...e)}return t.data(e(!0,{},this.namespace)),t}data(e,t){return"string"==typeof e?2===arguments.length?(kR("data",this.frozen),this.namespace[e]=t,this):bR.call(this.namespace,e)&&this.namespace[e]||void 0:e?(kR("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=TR(e),n=this.parser||this.Parser;return _R("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),_R("process",this.parser||this.Parser),xR("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=TR(e),a=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(a,i,function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);var a;"string"==typeof(a=i)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(a)?r.value=i:r.result=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),_R("processSync",this.parser||this.Parser),xR("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,oR(e),t=r}),SR("processSync","process",n),t}run(e,t,n){CR(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const a=TR(t);r.run(e,a,function(t,r,a){const s=r||e;t?i(t):o?o(s):n(void 0,s,a)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){oR(e),n=t,r=!0}),SR("runSync","run",r),n}stringify(e,t){this.freeze();const n=TR(t),r=this.compiler||this.Compiler;return xR("stringify",r),CR(e),r(e,n)}use(t,...n){const r=this.attachers,o=this.namespace;if(kR("use",this.frozen),null==t);else if("function"==typeof t)l(t,n);else{if("object"!=typeof t)throw new TypeError("Expected usable value, not `"+t+"`");Array.isArray(t)?s(t):a(t)}return this;function i(e){if("function"==typeof e)l(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;l(t,n)}else a(e)}}function a(t){if(!("plugins"in t)&&!("settings"in t))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(t.plugins),t.settings&&(o.settings=e(!0,o.settings,t.settings))}function s(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){i(e[t])}}}function l(t,n){let o=-1,i=-1;for(;++o<r.length;)if(r[o][0]===t){i=o;break}if(-1===i)r.push([t,...n]);else if(n.length>0){let[o,...a]=n;const s=r[i][1];iR(s)&&iR(o)&&(o=e(!0,s,o)),r[i]=[t,o,...a]}}}}const ER=(new wR).freeze();function _R(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function xR(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function kR(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function CR(e){if(!iR(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function SR(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function TR(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new hR(e)}const DR=["emphasis","strong","delete","inlineCode","html","text"];var AR="bold",OR=UA({key:AR,isLeaf:!0,deserializeHtml:{rules:[{validNodeName:["STRONG","B"]},{validStyle:{fontWeight:["600","700","bold"]}}],query:e=>!AO(e,e=>"normal"===e.style.fontWeight)},handlers:{onKeyDown:iI},options:{hotkey:"mod+b"}}),PR="code",IR=UA({key:PR,isLeaf:!0,deserializeHtml:{rules:[{validNodeName:["CODE"]},{validStyle:{fontFamily:"Consolas"}}],query(e){const t=Ex(e,"P");return"Consolas"!==(null==t?void 0:t.style.fontFamily)&&!Ex(e,"PRE")}},handlers:{onKeyDown:iI},options:{hotkey:"mod+e"}}),NR="italic",RR=UA({key:NR,isLeaf:!0,handlers:{onKeyDown:iI},options:{hotkey:"mod+i"},deserializeHtml:{rules:[{validNodeName:["EM","I"]},{validStyle:{fontStyle:"italic"}}],query:e=>!AO(e,e=>"normal"===e.style.fontStyle)}}),BR=UA({key:"strikethrough",isLeaf:!0,handlers:{onKeyDown:iI},options:{hotkey:"mod+shift+x"},deserializeHtml:{rules:[{validNodeName:["S","DEL","STRIKE"]},{validStyle:{textDecoration:"line-through"}}],query:e=>!AO(e,e=>"none"===e.style.textDecoration)}}),FR=UA({key:"subscript",isLeaf:!0,handlers:{onKeyDown:iI},options:{hotkey:"mod+,",clear:"superscript"},deserializeHtml:{rules:[{validNodeName:["SUB"]},{validStyle:{verticalAlign:"sub"}}]}}),LR=UA({key:"superscript",isLeaf:!0,handlers:{onKeyDown:iI},options:{hotkey:"mod+.",clear:"subscript"},deserializeHtml:{rules:[{validNodeName:["SUP"]},{validStyle:{verticalAlign:"super"}}]}}),MR=UA({key:"underline",isLeaf:!0,handlers:{onKeyDown:iI},options:{hotkey:"mod+u"},deserializeHtml:{rules:[{validNodeName:["U"]},{validStyle:{textDecoration:["underline"]}}],query:e=>!AO(e,e=>"none"===e.style.textDecoration)}});UA({key:"basicMarks",plugins:[OR(),IR(),RR(),BR(),FR(),LR(),MR()]});const UR={text:{},emphasis:{mark:({editor:e})=>LA(e,NR)},strong:{mark:({editor:e})=>LA(e,AR)},inlineCode:{mark:({editor:e})=>LA(e,PR)},html:{transform:e=>e.replace(/<br>/g,"\n")}},jR=(e,t,n={})=>{const{editor:r,textRules:o}=t,{type:i,value:a,children:s}=e,l=o[i]||UR.text,{mark:u,transform:c=e=>e}=l,d=u?{...n,[u({editor:r})]:!0}:n,p=s?.flatMap(e=>jR(e,t,d))||[];return[...a||0===p.length?[{text:c(a||""),...d}]:[],...p]},$R=(e,t,n)=>{const{type:r}=e;return DR.includes(r)?jR(e,n):((e,t,n)=>{const{elementRules:r}=n,{type:o}=e,i=r[o];return i?i.transform(e,t,n):[]})(e,t,n)};function zR(e){let t=1;this.Compiler=n=>n.children.flatMap(n=>{const r=$R(n,t,e);return t=n.position?.end.line||t,r})}var HR={exports:{}};!function(e){var t=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},o.util.type(t)){case"Object":if(i=o.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=o.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,o){r[o]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if(document.currentScript&&"SCRIPT"===document.currentScript.tagName)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var o=e.classList;if(o.contains(t))return!0;if(o.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=o.util.clone(o.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||o.languages)[e],a={};for(var s in i)if(i.hasOwnProperty(s)){if(s==t)for(var l in n)n.hasOwnProperty(l)&&(a[l]=n[l]);n.hasOwnProperty(s)||(a[s]=i[s])}var u=r[e];return r[e]=a,o.languages.DFS(o.languages,function(t,n){n===u&&t!=e&&(this[t]=a)}),a},DFS:function e(t,n,r,i){i=i||{};var a=o.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var l=t[s],u=o.util.type(l);"Object"!==u||i[a(l)]?"Array"!==u||i[a(l)]||(i[a(l)]=!0,e(l,n,s,i)):(i[a(l)]=!0,e(l,n,null,i))}}},plugins:{},highlightAll:function(e,t){o.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),o.hooks.run("before-all-elements-highlight",r);for(var i,a=0;i=r.elements[a++];)o.highlightElement(i,!0===t,r.callback)},highlightElement:function(t,n,r){var i=o.util.getLanguage(t),a=o.languages[i];o.util.setLanguage(t,i);var s=t.parentElement;s&&"pre"===s.nodeName.toLowerCase()&&o.util.setLanguage(s,i);var l={element:t,language:i,grammar:a,code:t.textContent};function u(e){l.highlightedCode=e,o.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,o.hooks.run("after-highlight",l),o.hooks.run("complete",l),r&&r.call(l.element)}if(o.hooks.run("before-sanity-check",l),(s=l.element.parentElement)&&"pre"===s.nodeName.toLowerCase()&&!s.hasAttribute("tabindex")&&s.setAttribute("tabindex","0"),!l.code)return o.hooks.run("complete",l),void(r&&r.call(l.element));if(o.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var c=new Worker(o.filename);c.onmessage=function(e){u(e.data)},c.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else u(o.highlight(l.code,l.grammar,l.language));else u(o.util.encode(l.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(o.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=o.tokenize(r.code,r.grammar),o.hooks.run("after-tokenize",r),i.stringify(o.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new l;return u(o,o.head,e),s(e,o,t,o.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=o.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=o.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function a(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function s(e,t,n,r,l,d){for(var p in n)if(n.hasOwnProperty(p)&&n[p]){var f=n[p];f=Array.isArray(f)?f:[f];for(var h=0;h<f.length;++h){if(d&&d.cause==p+","+h)return;var g=f[h],m=g.inside,v=!!g.lookbehind,y=!!g.greedy,b=g.alias;if(y&&!g.pattern.global){var w=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,w+"g")}for(var E=g.pattern||g,_=r.next,x=l;_!==t.tail&&!(d&&x>=d.reach);x+=_.value.length,_=_.next){var k=_.value;if(t.length>e.length)return;if(!(k instanceof i)){var C,S=1;if(y){if(!(C=a(E,x,e,v))||C.index>=e.length)break;var T=C.index,D=C.index+C[0].length,A=x;for(A+=_.value.length;T>=A;)A+=(_=_.next).value.length;if(x=A-=_.value.length,_.value instanceof i)continue;for(var O=_;O!==t.tail&&(A<D||"string"==typeof O.value);O=O.next)S++,A+=O.value.length;S--,k=e.slice(x,A),C.index-=x}else if(!(C=a(E,0,k,v)))continue;T=C.index;var P=C[0],I=k.slice(0,T),N=k.slice(T+P.length),R=x+k.length;d&&R>d.reach&&(d.reach=R);var B=_.prev;if(I&&(B=u(t,B,I),x+=I.length),c(t,B,S),_=u(t,B,new i(p,m?o.tokenize(P,m):P,b,P)),N&&u(t,_,N),S>1){var F={cause:p+","+h,reach:R};s(e,t,n,_.prev,x,F),d&&F.reach>d.reach&&(d.reach=F.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function u(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function c(e,t,n){for(var r=t.next,o=0;o<n&&r!==e.tail;o++)r=r.next;t.next=r,r.prev=t,e.length-=o}if(e.Prism=o,i.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach(function(t){r+=e(t,n)}),r}var i={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},a=t.alias;a&&(Array.isArray(a)?Array.prototype.push.apply(i.classes,a):i.classes.push(a)),o.hooks.run("wrap",i);var s="";for(var l in i.attributes)s+=" "+l+'="'+(i.attributes[l]||"").replace(/"/g,"&quot;")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+s+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener?(o.disableWorkerMessageHandler||e.addEventListener("message",function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,a=n.immediateClose;e.postMessage(o.highlight(i,o.languages[r],r)),a&&e.close()},!1),o):o;var d=o.util.currentScript();function p(){o.manual||o.highlightAll()}if(d&&(o.filename=d.src,d.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var f=document.readyState;"loading"===f||"interactive"===f&&d&&d.defer?document.addEventListener("DOMContentLoaded",p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});
20
+ /**
21
+ * Prism: Lightweight, robust, elegant syntax highlighting
22
+ *
23
+ * @license MIT <https://opensource.org/licenses/MIT>
24
+ * @author Lea Verou <https://lea.verou.me>
25
+ * @namespace
26
+ * @public
27
+ */e.exports&&(e.exports=t),void 0!==Rn&&(Rn.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(e,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:t.languages[n]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:o},t.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(e,n){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:t.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(void 0!==t&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},n="data-src-status",r="loading",o="loaded",i="pre[data-src]:not(["+n+'="'+o+'"]):not(['+n+'="'+r+'"])';t.hooks.add("before-highlightall",function(e){e.selector+=", "+i}),t.hooks.add("before-sanity-check",function(a){var s=a.element;if(s.matches(i)){a.code="",s.setAttribute(n,r);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var u=s.getAttribute("data-src"),c=a.language;if("none"===c){var d=(/\.(\w+)$/.exec(u)||[,"none"])[1];c=e[d]||d}t.util.setLanguage(l,c),t.util.setLanguage(s,c);var p=t.plugins.autoloader;p&&p.loadLanguages(c),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n("✖ Error "+r.status+" while fetching file: "+r.statusText):n("✖ Error: File does not exist or is empty"))},r.send(null)}(u,function(e){s.setAttribute(n,o);var r=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],o=t[3];return r?o?[n,Number(o)]:[n,void 0]:[n,n]}}(s.getAttribute("data-range"));if(r){var i=e.split(/\r\n?|\n/g),a=r[0],u=null==r[1]?i.length:r[1];a<0&&(a+=i.length),a=Math.max(0,Math.min(a-1,i.length)),u<0&&(u+=i.length),u=Math.max(0,Math.min(u,i.length)),e=i.slice(a,u).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(a+1))}l.textContent=e,t.highlightElement(l)},function(e){s.setAttribute(n,"failed"),l.textContent=e})}}),t.plugins.fileHighlight={highlight:function(e){for(var n,r=(e||document).querySelectorAll(i),o=0;n=r[o++];)t.highlightElement(n)}};var a=!1;t.fileHighlight=function(){a||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),a=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}}()}(HR);var VR=Bn(HR.exports);Prism.languages.antlr4={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,string:{pattern:/'(?:\\.|[^\\'\r\n])*'/,greedy:!0},"character-class":{pattern:/\[(?:\\.|[^\\\]\r\n])*\]/,greedy:!0,alias:"regex",inside:{range:{pattern:/([^[]|(?:^|[^\\])(?:\\\\)*\\\[)-(?!\])/,lookbehind:!0,alias:"punctuation"},escape:/\\(?:u(?:[a-fA-F\d]{4}|\{[a-fA-F\d]+\})|[pP]\{[=\w-]+\}|[^\r\nupP])/,punctuation:/[\[\]]/}},action:{pattern:/\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\}/,greedy:!0,inside:{content:{pattern:/(\{)[\s\S]+(?=\})/,lookbehind:!0},punctuation:/[{}]/}},command:{pattern:/(->\s*(?!\s))(?:\s*(?:,\s*)?\b[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i,lookbehind:!0,inside:{function:/\b\w+(?=\s*(?:[,(]|$))/,punctuation:/[,()]/}},annotation:{pattern:/@\w+(?:::\w+)*/,alias:"keyword"},label:{pattern:/#[ \t]*\w+/,alias:"punctuation"},keyword:/\b(?:catch|channels|finally|fragment|grammar|import|lexer|locals|mode|options|parser|returns|throws|tokens)\b/,definition:[{pattern:/\b[a-z]\w*(?=\s*:)/,alias:["rule","class-name"]},{pattern:/\b[A-Z]\w*(?=\s*:)/,alias:["token","constant"]}],constant:/\b[A-Z][A-Z_]*\b/,operator:/\.\.|->|[|~]|[*+?]\??/,punctuation:/[;:()=]/},Prism.languages.g4=Prism.languages.antlr4,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var o=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],i=r.variable[1].inside,a=0;a<o.length;a++)i[o[a]]=e.languages.bash[o[a]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,Prism.languages.cmake={comment:/#.*/,string:{pattern:/"(?:[^\\"]|\\.)*"/,greedy:!0,inside:{interpolation:{pattern:/\$\{(?:[^{}$]|\$\{[^{}$]*\})*\}/,inside:{punctuation:/\$\{|\}/,variable:/\w+/}}}},variable:/\b(?:CMAKE_\w+|\w+_(?:(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT|VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?)|(?:ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_NAME|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE))\b/,property:/\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/,keyword:/\b(?:add_compile_definitions|add_compile_options|add_custom_command|add_custom_target|add_definitions|add_dependencies|add_executable|add_library|add_link_options|add_subdirectory|add_test|aux_source_directory|break|build_command|build_name|cmake_host_system_information|cmake_minimum_required|cmake_parse_arguments|cmake_policy|configure_file|continue|create_test_sourcelist|ctest_build|ctest_configure|ctest_coverage|ctest_empty_binary_directory|ctest_memcheck|ctest_read_custom_files|ctest_run_script|ctest_sleep|ctest_start|ctest_submit|ctest_test|ctest_update|ctest_upload|define_property|else|elseif|enable_language|enable_testing|endforeach|endfunction|endif|endmacro|endwhile|exec_program|execute_process|export|export_library_dependencies|file|find_file|find_library|find_package|find_path|find_program|fltk_wrap_ui|foreach|function|get_cmake_property|get_directory_property|get_filename_component|get_property|get_source_file_property|get_target_property|get_test_property|if|include|include_directories|include_external_msproject|include_guard|include_regular_expression|install|install_files|install_programs|install_targets|link_directories|link_libraries|list|load_cache|load_command|macro|make_directory|mark_as_advanced|math|message|option|output_required_files|project|qt_wrap_cpp|qt_wrap_ui|remove|remove_definitions|return|separate_arguments|set|set_directory_properties|set_property|set_source_files_properties|set_target_properties|set_tests_properties|site_name|source_group|string|subdir_depends|subdirs|target_compile_definitions|target_compile_features|target_compile_options|target_include_directories|target_link_directories|target_link_libraries|target_link_options|target_sources|try_compile|try_run|unset|use_mangled_mesa|utility_source|variable_requires|variable_watch|while|write_file)(?=\s*\()\b/,boolean:/\b(?:FALSE|OFF|ON|TRUE)\b/,namespace:/\b(?:INTERFACE|PRIVATE|PROPERTIES|PUBLIC|SHARED|STATIC|TARGET_OBJECTS)\b/,operator:/\b(?:AND|DEFINED|EQUAL|GREATER|LESS|MATCHES|NOT|OR|STREQUAL|STRGREATER|STRLESS|VERSION_EQUAL|VERSION_GREATER|VERSION_LESS)\b/,inserted:{pattern:/\b\w+::\w+\b/,alias:"class-name"},number:/\b\d+(?:\.\d+)*\b/,function:/\b[a-z_]\w*(?=\s*\()\b/i,punctuation:/[()>}]|\$[<{]/},function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(Prism),function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism),function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+t[+n]+")"})}function n(e,n,r){return RegExp(t(e,n),"")}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,function(){return"(?:"+e+")"});return e.replace(/<<self>>/g,"[^\\s\\S]")}var o="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",i="class enum interface record struct",a="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",s="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var u=l(i),c=RegExp(l(o+" "+i+" "+a+" "+s)),d=l(i+" "+a+" "+s),p=l(o+" "+i+" "+s),f=r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),h=r(/\((?:[^()]|<<self>>)*\)/.source,2),g=/@?\b[A-Za-z_]\w*\b/.source,m=t(/<<0>>(?:\s*<<1>>)?/.source,[g,f]),v=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,m]),y=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[v,y]),w=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[f,h,y]),E=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),_=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[E,v,y]),x={keyword:c,punctuation:/[<>()?,.:[\]]/},k=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,C=/"(?:\\.|[^\\"\r\n])*"/.source,S=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[S]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[C]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[v]),lookbehind:!0,inside:x},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[g,_]),lookbehind:!0,inside:x},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[g]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[u,m]),lookbehind:!0,inside:x},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[v]),lookbehind:!0,inside:x},{pattern:n(/(\bwhere\s+)<<0>>/.source,[g]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:x},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[_,p,g]),inside:x}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[g]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[g]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[h]),lookbehind:!0,alias:"class-name",inside:x},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[_,v]),inside:x,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[_]),lookbehind:!0,inside:x,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[g,f]),inside:{function:n(/^<<0>>/.source,[g]),generic:{pattern:RegExp(f),alias:"class-name",inside:x}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[u,m,g,_,c.source,h,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[m,h]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:c,"class-name":{pattern:RegExp(_),greedy:!0,inside:x},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var T=C+"|"+k,D=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[T]),A=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[D]),2),O=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,P=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[v,A]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[O,P]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[O]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[A]),inside:e.languages.csharp},"class-name":{pattern:RegExp(v),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var I=/:[^}\r\n]+/.source,N=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[D]),2),R=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[N,I]),B=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[T]),2),F=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[B,I]);function L(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,I]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[R]),lookbehind:!0,greedy:!0,inside:L(R,N)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[F]),lookbehind:!0,greedy:!0,inside:L(F,B)}],char:{pattern:RegExp(k),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),function(e){var t=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],n=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};e.languages.dart=e.languages.extend("clike",{"class-name":[r,{pattern:RegExp(n+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:r.inside}],keyword:t,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),e.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:e.languages.dart}}},string:/[\s\S]+/}},string:void 0}),e.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),e.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})}(Prism),function(e){var t=/\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source,n=/(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source.replace(/<SP_BS>/g,function(){return t}),r=/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source,o=/--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(/<STR>/g,function(){return r}),i={pattern:RegExp(r),greedy:!0},a={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function s(e,t){return e=e.replace(/<OPT>/g,function(){return o}).replace(/<SP>/g,function(){return n}),RegExp(e,t)}e.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:s(/(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source,"i"),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[i,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:s(/(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/.source,"i"),lookbehind:!0,greedy:!0},{pattern:s(/(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/.source,"i"),lookbehind:!0,greedy:!0},{pattern:s(/(^ONBUILD<SP>)\w+/.source,"i"),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:a,string:i,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:a},e.languages.dockerfile=e.languages.docker}(Prism),Prism.languages.erlang={comment:/%.+/,string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},"quoted-function":{pattern:/'(?:\\.|[^\\'\r\n])+'(?=\()/,alias:"function"},"quoted-atom":{pattern:/'(?:\\.|[^\\'\r\n])+'/,alias:"atom"},boolean:/\b(?:false|true)\b/,keyword:/\b(?:after|begin|case|catch|end|fun|if|of|receive|try|when)\b/,number:[/\$\\?./,/\b\d+#[a-z0-9]+/i,/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i],function:/\b[a-z][\w@]*(?=\()/,variable:{pattern:/(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,lookbehind:!0},operator:[/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\b/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],atom:/\b[a-z][\w@]*/,punctuation:/[()[\]{}:;,.#|]|<<|>>/},Prism.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"],Prism.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:Prism.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},Prism.hooks.add("after-tokenize",function(e){if("graphql"===e.language)for(var t=e.tokens.filter(function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type}),n=0;n<t.length;){var r=t[n++];if("keyword"===r.type&&"mutation"===r.content){var o=[];if(d(["definition-mutation","punctuation"])&&"("===c(1).content){n+=2;var i=p(/^\($/,/^\)$/);if(-1===i)continue;for(;n<i;n++){var a=c(0);"variable"===a.type&&(f(a,"variable-input"),o.push(a.content))}n=i+1}if(d(["punctuation","property-query"])&&"{"===c(0).content&&(n++,f(c(0),"property-mutation"),o.length>0)){var s=p(/^\{$/,/^\}$/);if(-1===s)continue;for(var l=n;l<s;l++){var u=t[l];"variable"===u.type&&o.indexOf(u.content)>=0&&f(u,"variable-input")}}}}function c(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n<e.length;n++){var r=c(n+t);if(!r||r.type!==e[n])return!1}return!0}function p(e,r){for(var o=1,i=n;i<t.length;i++){var a=t[i],s=a.content;if("punctuation"===a.type&&"string"==typeof s)if(e.test(s))o++;else if(r.test(s)&&0===--o)return i}return-1}function f(e,t){var n=e.alias;n?Array.isArray(n)||(e.alias=n=[n]):e.alias=n=[],n.push(t)}}),function(e){var t={pattern:/((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:null}}};e.languages.groovy=e.languages.extend("clike",{string:{pattern:/'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,greedy:!0},keyword:/\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),e.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment",greedy:!0},"interpolation-string":{pattern:/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}}}),e.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:and|cleanup|expect|given|setup|then|when|where):/}),e.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),t.inside.expression.inside=e.languages.groovy}(Prism),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism),Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json,function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,o=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function i(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return o}),RegExp(e,t)}o=i(o).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:i(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var a=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(a).join(""):""},s=function(t){for(var n=[],r=0;r<t.length;r++){var o=t[r],i=!1;if("string"!=typeof o&&("tag"===o.type&&o.content[0]&&"tag"===o.content[0].type?"</"===o.content[0].content[0].content?n.length>0&&n[n.length-1].tagName===a(o.content[0].content[1])&&n.pop():"/>"===o.content[o.content.length-1].content||n.push({tagName:a(o.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===o.type&&"{"===o.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?n[n.length-1].openedBraces--:i=!0),(i||"string"==typeof o)&&n.length>0&&0===n[n.length-1].openedBraces){var l=a(o);r<t.length-1&&("string"==typeof t[r+1]||"plain-text"===t[r+1].type)&&(l+=a(t[r+1]),t.splice(r+1,1)),r>0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(l=a(t[r-1])+l,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",l,null,l)}o.content&&"string"!=typeof o.content&&s(o.content)}};e.hooks.add("after-tokenize",function(e){"jsx"!==e.language&&"tsx"!==e.language||s(e.tokens)})}(Prism),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(Prism),function(e){var t=/\\(?:[^a-z()[\]]|[a-z*]+)/i,n={"equation-command":{pattern:t,alias:"regex"}};e.languages.latex={comment:/%.*/,cdata:{pattern:/(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0},equation:[{pattern:/\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,inside:n,alias:"string"},{pattern:/(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0,inside:n,alias:"string"}],keyword:{pattern:/(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0},url:{pattern:/(\\url\{)[^}]+(?=\})/,lookbehind:!0},headline:{pattern:/(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0,alias:"class-name"},function:{pattern:t,alias:"selector"},punctuation:/[[\]{}&]/},e.languages.tex=e.languages.latex,e.languages.context=e.languages.latex}(Prism),Prism.languages.less=Prism.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),Prism.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/},Prism.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(t){["url","bold","italic","strike","code-snippet"].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add("after-tokenize",function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var o=t[n];if("code"===o.type){var i=o.content[1],a=o.content[3];if(i&&a&&"code-language"===i.type&&"code-block"===a.type&&"string"==typeof i.content){var s=i.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(s=(/[a-z][\w-]*/i.exec(s)||[""])[0].toLowerCase());a.alias?"string"==typeof a.alias?a.alias=[a.alias,l]:a.alias.push(l):a.alias=[l]}}else e(o.content)}}(e.tokens)}),e.hooks.add("wrap",function(t){if("code-block"===t.type){for(var n="",r=0,o=t.classes.length;r<o;r++){var i=t.classes[r],u=/language-(.+)/.exec(i);if(u){n=u[1];break}}var c=e.languages[n];if(c)t.content=e.highlight(function(e){var t=e.replace(a,"");return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n);var r=s[t];return r||e}),t}(t.content),c,n);else if(n&&"none"!==n&&e.plugins.autoloader){var d="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=d,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(d);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}});var a=RegExp(e.languages.markup.tag.pattern.source,"gi"),s={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism),Prism.languages.matlab={comment:[/%\{[\s\S]*?\}%/,/%.+/],string:{pattern:/\B'(?:''|[^'\r\n])*'/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?(?:[ij])?|\b[ij]\b/,keyword:/\b(?:NaN|break|case|catch|continue|else|elseif|end|for|function|if|inf|otherwise|parfor|pause|pi|return|switch|try|while)\b/,function:/\b(?!\d)\w+(?=\s*\()/,operator:/\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,punctuation:/\.{3}|[.,;\[\](){}!]/},Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,function(e){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;e.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}}(Prism),function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism),Prism.languages.properties={comment:/^[ \t]*[#!].*$/m,value:{pattern:/(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m,lookbehind:!0,alias:"attr-value"},key:{pattern:/^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m,alias:"attr-name"},punctuation:/[=:]/},function(e){var t=/\b(?:bool|bytes|double|s?fixed(?:32|64)|float|[su]?int(?:32|64)|string)\b/;e.languages.protobuf=e.languages.extend("clike",{"class-name":[{pattern:/(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,lookbehind:!0},{pattern:/(\b(?:rpc\s+\w+|returns)\s*\(\s*(?:stream\s+)?)\.?[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s*\))/,lookbehind:!0}],keyword:/\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|returns|rpc(?=\s+\w)|service|stream|syntax|to)\b(?!\s*=\s*\d)/,function:/\b[a-z_]\w*(?=\s*\()/i}),e.languages.insertBefore("protobuf","operator",{map:{pattern:/\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/[<>.,]/,builtin:t}},builtin:t,"positional-class-name":{pattern:/(?:\b|\B\.)[a-z_]\w*(?:\.[a-z_]\w*)*(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/\./}},annotation:{pattern:/(\[\s*)[a-z_]\w*(?=\s*=)/i,lookbehind:!0}})}(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,Prism.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/},function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism),function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(Prism),Prism.languages.scala=Prism.languages.extend("java",{"triple-quoted-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/<-|=>|\b(?:abstract|case|catch|class|def|derives|do|else|enum|extends|extension|final|finally|for|forSome|given|if|implicit|import|infix|inline|lazy|match|new|null|object|opaque|open|override|package|private|protected|return|sealed|self|super|this|throw|trait|transparent|try|type|using|val|var|while|with|yield)\b/,number:/\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i,builtin:/\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/,symbol:/'[^\d\s\\]\w*/}),Prism.languages.insertBefore("scala","triple-quoted-string",{"string-interpolation":{pattern:/\b[a-z]\w*(?:"""(?:[^$]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*?"""|"(?:[^$"\r\n]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*")/i,greedy:!0,inside:{id:{pattern:/^\w+/,greedy:!0,alias:"function"},escape:{pattern:/\\\$"|\$[$"]/,greedy:!0,alias:"symbol"},interpolation:{pattern:/\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,greedy:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:Prism.languages.scala}}},string:/[\s\S]+/}}}),delete Prism.languages.scala["class-name"],delete Prism.languages.scala.function,delete Prism.languages.scala.constant,function(e){e.languages.scheme={comment:/;.*|#;\s*(?:\((?:[^()]|\([^()]*\))*\)|\[(?:[^\[\]]|\[[^\[\]]*\])*\])|#\|(?:[^#|]|#(?!\|)|\|(?!#)|#\|(?:[^#|]|#(?!\|)|\|(?!#))*\|#)*\|#/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},symbol:{pattern:/'[^()\[\]#'\s]+/,greedy:!0},char:{pattern:/#\\(?:[ux][a-fA-F\d]+\b|[-a-zA-Z]+\b|[\uD800-\uDBFF][\uDC00-\uDFFF]|\S)/,greedy:!0},"lambda-parameter":[{pattern:/((?:^|[^'`#])[(\[]lambda\s+)(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)/,lookbehind:!0},{pattern:/((?:^|[^'`#])[(\[]lambda\s+[(\[])[^()\[\]']+/,lookbehind:!0}],keyword:{pattern:/((?:^|[^'`#])[(\[])(?:begin|case(?:-lambda)?|cond(?:-expand)?|define(?:-library|-macro|-record-type|-syntax|-values)?|defmacro|delay(?:-force)?|do|else|except|export|guard|if|import|include(?:-ci|-library-declarations)?|lambda|let(?:rec)?(?:-syntax|-values|\*)?|let\*-values|only|parameterize|prefix|(?:quasi-?)?quote|rename|set!|syntax-(?:case|rules)|unless|unquote(?:-splicing)?|when)(?=[()\[\]\s]|$)/,lookbehind:!0},builtin:{pattern:/((?:^|[^'`#])[(\[])(?:abs|and|append|apply|assoc|ass[qv]|binary-port\?|boolean=?\?|bytevector(?:-append|-copy|-copy!|-length|-u8-ref|-u8-set!|\?)?|caar|cadr|call-with-(?:current-continuation|port|values)|call\/cc|car|cdar|cddr|cdr|ceiling|char(?:->integer|-ready\?|\?|<\?|<=\?|=\?|>\?|>=\?)|close-(?:input-port|output-port|port)|complex\?|cons|current-(?:error|input|output)-port|denominator|dynamic-wind|eof-object\??|eq\?|equal\?|eqv\?|error|error-object(?:-irritants|-message|\?)|eval|even\?|exact(?:-integer-sqrt|-integer\?|\?)?|expt|features|file-error\?|floor(?:-quotient|-remainder|\/)?|flush-output-port|for-each|gcd|get-output-(?:bytevector|string)|inexact\??|input-port(?:-open\?|\?)|integer(?:->char|\?)|lcm|length|list(?:->string|->vector|-copy|-ref|-set!|-tail|\?)?|make-(?:bytevector|list|parameter|string|vector)|map|max|member|memq|memv|min|modulo|negative\?|newline|not|null\?|number(?:->string|\?)|numerator|odd\?|open-(?:input|output)-(?:bytevector|string)|or|output-port(?:-open\?|\?)|pair\?|peek-char|peek-u8|port\?|positive\?|procedure\?|quotient|raise|raise-continuable|rational\?|rationalize|read-(?:bytevector|bytevector!|char|error\?|line|string|u8)|real\?|remainder|reverse|round|set-c[ad]r!|square|string(?:->list|->number|->symbol|->utf8|->vector|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?|<\?|<=\?|=\?|>\?|>=\?)?|substring|symbol(?:->string|\?|=\?)|syntax-error|textual-port\?|truncate(?:-quotient|-remainder|\/)?|u8-ready\?|utf8->string|values|vector(?:->list|->string|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?)?|with-exception-handler|write-(?:bytevector|char|string|u8)|zero\?)(?=[()\[\]\s]|$)/,lookbehind:!0},operator:{pattern:/((?:^|[^'`#])[(\[])(?:[-+*%/]|[<>]=?|=>?)(?=[()\[\]\s]|$)/,lookbehind:!0},number:{pattern:RegExp(function(e){for(var t in e)e[t]=e[t].replace(/<[\w\s]+>/g,function(t){return"(?:"+e[t].trim()+")"});return e[t]}({"<ureal dec>":/\d+(?:\/\d+)|(?:\d+(?:\.\d*)?|\.\d+)(?:[esfdl][+-]?\d+)?/.source,"<real dec>":/[+-]?<ureal dec>|[+-](?:inf|nan)\.0/.source,"<imaginary dec>":/[+-](?:<ureal dec>|(?:inf|nan)\.0)?i/.source,"<complex dec>":/<real dec>(?:@<real dec>|<imaginary dec>)?|<imaginary dec>/.source,"<num dec>":/(?:#d(?:#[ei])?|#[ei](?:#d)?)?<complex dec>/.source,"<ureal box>":/[0-9a-f]+(?:\/[0-9a-f]+)?/.source,"<real box>":/[+-]?<ureal box>|[+-](?:inf|nan)\.0/.source,"<imaginary box>":/[+-](?:<ureal box>|(?:inf|nan)\.0)?i/.source,"<complex box>":/<real box>(?:@<real box>|<imaginary box>)?|<imaginary box>/.source,"<num box>":/#[box](?:#[ei])?|(?:#[ei])?#[box]<complex box>/.source,"<number>":/(^|[()\[\]\s])(?:<num dec>|<num box>)(?=[()\[\]\s]|$)/.source}),"i"),lookbehind:!0},boolean:{pattern:/(^|[()\[\]\s])#(?:[ft]|false|true)(?=[()\[\]\s]|$)/,lookbehind:!0},function:{pattern:/((?:^|[^'`#])[(\[])(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)(?=[()\[\]\s]|$)/,lookbehind:!0},identifier:{pattern:/(^|[()\[\]\s])\|(?:[^\\|]|\\.)*\|(?=[()\[\]\s]|$)/,lookbehind:!0,greedy:!0},punctuation:/[()\[\]']/}}(Prism),Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),Prism.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),Prism.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),Prism.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),Prism.languages.scss.atrule.inside.rest=Prism.languages.scss,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift}),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(Prism),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism),Prism.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/},function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),i=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function a(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+o+"|"+i+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:a(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:a(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:a(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:a(i),lookbehind:!0,greedy:!0},number:{pattern:a(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism);var{languages:WR,Token:qR,tokenize:GR}=VR;const KR=Math.min,YR=Math.max,ZR=Math.round,XR=Math.floor,QR=e=>({x:e,y:e}),JR={left:"right",right:"left",bottom:"top",top:"bottom"},eB={start:"end",end:"start"};function tB(e,t,n){return YR(e,KR(t,n))}function nB(e,t){return"function"==typeof e?e(t):e}function rB(e){return e.split("-")[0]}function oB(e){return e.split("-")[1]}function iB(e){return"x"===e?"y":"x"}function aB(e){return"y"===e?"height":"width"}const sB=new Set(["top","bottom"]);function lB(e){return sB.has(rB(e))?"y":"x"}function uB(e){return iB(lB(e))}function cB(e){return e.replace(/start|end/g,e=>eB[e])}const dB=["left","right"],pB=["right","left"],fB=["top","bottom"],hB=["bottom","top"];function gB(e,t,n,r){const o=oB(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?pB:dB:t?dB:pB;case"left":case"right":return t?fB:hB;default:return[]}}(rB(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(cB)))),i}function mB(e){return e.replace(/left|right|bottom|top/g,e=>JR[e])}function vB(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function yB(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function bB(e,t,n){let{reference:r,floating:o}=e;const i=lB(t),a=uB(t),s=aB(a),l=rB(t),u="y"===i,c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(l){case"top":f={x:c,y:r.y-o.height};break;case"bottom":f={x:c,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(oB(t)){case"start":f[a]-=p*(n&&u?-1:1);break;case"end":f[a]+=p*(n&&u?-1:1)}return f}async function wB(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=nB(t,e),h=vB(f),g=s[p?"floating"===d?"reference":"floating":d],m=yB(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:l})),v="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},w=yB(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-w.top+h.top)/b.y,bottom:(w.bottom-m.bottom+h.bottom)/b.y,left:(m.left-w.left+h.left)/b.x,right:(w.right-m.right+h.right)/b.x}}const EB=new Set(["left","top"]);function _B(){return"undefined"!=typeof window}function xB(e){return SB(e)?(e.nodeName||"").toLowerCase():"#document"}function kB(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function CB(e){var t;return null==(t=(SB(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function SB(e){return!!_B()&&(e instanceof Node||e instanceof kB(e).Node)}function TB(e){return!!_B()&&(e instanceof Element||e instanceof kB(e).Element)}function DB(e){return!!_B()&&(e instanceof HTMLElement||e instanceof kB(e).HTMLElement)}function AB(e){return!(!_B()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof kB(e).ShadowRoot)}const OB=new Set(["inline","contents"]);function PB(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=HB(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!OB.has(o)}const IB=new Set(["table","td","th"]);function NB(e){return IB.has(xB(e))}const RB=[":popover-open",":modal"];function BB(e){return RB.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const FB=["transform","translate","scale","rotate","perspective"],LB=["transform","translate","scale","rotate","perspective","filter"],MB=["paint","layout","strict","content"];function UB(e){const t=jB(),n=TB(e)?HB(e):e;return FB.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||LB.some(e=>(n.willChange||"").includes(e))||MB.some(e=>(n.contain||"").includes(e))}function jB(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const $B=new Set(["html","body","#document"]);function zB(e){return $B.has(xB(e))}function HB(e){return kB(e).getComputedStyle(e)}function VB(e){return TB(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function WB(e){if("html"===xB(e))return e;const t=e.assignedSlot||e.parentNode||AB(e)&&e.host||CB(e);return AB(t)?t.host:t}function qB(e){const t=WB(e);return zB(t)?e.ownerDocument?e.ownerDocument.body:e.body:DB(t)&&PB(t)?t:qB(t)}function GB(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=qB(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=kB(o);if(i){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}
28
+ /*!
29
+ * tabbable 6.4.0
6
30
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
7
- */(a);return t.concat(a,a.visualViewport||[],Ta(r)?r:[],e&&n?Na(e):[])}return t.concat(r,Na(r,[],n))}var La=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Da=La.join(","),Ma="undefined"==typeof Element,Ua=Ma?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ba=!Ma&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Fa=function e(t,n){var o;void 0===n&&(n=!0);var r=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return""===r||"true"===r||n&&t&&e(t.parentNode)},ja=function(e,t,n){if(Fa(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(Da));return t&&Ua.call(e,Da)&&o.unshift(e),o=o.filter(n)},za=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!Fa(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:a,candidates:l})}else{Ua.call(a,Da)&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var c=a.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(a),d=!Fa(c,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(c&&d){var u=e(!0===c?a.children:c.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},Ha=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Va=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Ha(e)?0:e.tabIndex},Ga=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Wa=function(e){return"INPUT"===e.tagName},qa=function(e){return function(e){return Wa(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ba(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!r||r===e}(e)},Ka=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},Ya=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=Ua.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ua.call(r,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ka(e)}else{if("function"==typeof o){for(var i=e;e;){var a=e.parentElement,s=Ba(e);if(a&&!a.shadowRoot&&!0===o(a))return Ka(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){var t,n,o,r,i=e&&Ba(e),a=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(a)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!s&&a;){var l,c,d;s=!(null===(c=a=null===(l=i=Ba(a))||void 0===l?void 0:l.host)||void 0===c||null===(d=c.ownerDocument)||void 0===d||!d.contains(a))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Xa=function(e,t){return!(t.disabled||Fa(t)||function(e){return Wa(e)&&"hidden"===e.type}(t)||Ya(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var o=t.children.item(n);if("LEGEND"===o.tagName)return!!Ua.call(t,"fieldset[disabled] *")||!o.contains(e)}return!0}t=t.parentElement}return!1}(t))},Za=function(e,t){return!(qa(t)||Va(t)<0||!Xa(e,t))},Ja=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Qa=function e(t){var n=[],o=[];return t.forEach((function(t,r){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=function(e,t){var n=Va(e);return n<0&&t&&!Ha(e)?0:n}(a,i),l=i?e(t.candidates):a;0===s?i?n.push.apply(n,l):n.push(a):o.push({documentOrder:r,tabIndex:s,item:t,isScope:i,content:l})})),o.sort(Ga).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},es=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ua.call(e,Da)&&Za(t,e)},ts=La.concat("iframe").join(","),ns=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ua.call(e,ts)&&Xa(t,e)};
31
+ */(a);return t.concat(a,a.visualViewport||[],PB(o)?o:[],e&&n?GB(e):[])}return t.concat(o,GB(o,[],n))}var KB=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],YB=KB.join(","),ZB="undefined"==typeof Element,XB=ZB?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,QB=!ZB&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},JB=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):JB(e.parentNode))},eF=function(e,t,n){if(JB(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(YB));return t&&XB.call(e,YB)&&r.unshift(e),r=r.filter(n)},tF=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!JB(i,!1))if("SLOT"===i.tagName){var a=i.assignedElements(),s=a.length?a:i.children,l=tF(s,!0,n);n.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{XB.call(i,YB)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var u=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),c=!JB(u,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(u&&c){var d=tF(!0===u?i.children:u.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:i,candidates:d})}else o.unshift.apply(o,i.children)}}return r},nF=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},rF=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!nF(e)?0:e.tabIndex},oF=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},iF=function(e){return"INPUT"===e.tagName},aF=function(e){return function(e){return iF(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||QB(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},sF=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},lF=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=XB.call(e,"details>summary:first-of-type")?e.parentElement:e;if(XB.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return sF(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,s=QB(e);if(a&&!a.shadowRoot&&!0===r(a))return sF(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){var t,n,r,o,i=e&&QB(e),a=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&a;){var l,u,c;s=!(null===(u=a=null===(l=i=QB(a))||void 0===l?void 0:l.host)||void 0===u||null===(c=u.ownerDocument)||void 0===c||!c.contains(a))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},uF=function(e,t){return!(t.disabled||function(e){return iF(e)&&"hidden"===e.type}(t)||lF(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!XB.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},cF=function(e,t){return!(aF(t)||rF(t)<0||!uF(e,t))},dF=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},pF=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,i=o?e.scopeParent:e,a=function(e,t){var n=rF(e);return n<0&&t&&!nF(e)?0:n}(i,o),s=o?pF(e.candidates):i;0===a?o?t.push.apply(t,s):t.push(i):n.push({documentOrder:r,tabIndex:a,item:e,isScope:o,content:s})}),n.sort(oF).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},fF=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==XB.call(e,YB)&&cF(t,e)},hF=KB.concat("iframe:not([inert]):not([inert] *)").join(","),gF=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==XB.call(e,hF)&&uF(t,e)},mF=Object.defineProperty,vF=Object.defineProperties,yF=Object.getOwnPropertyDescriptors,bF=Object.getOwnPropertySymbols,wF=Object.prototype.hasOwnProperty,EF=Object.prototype.propertyIsEnumerable,_F=(e,t,n)=>t in e?mF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xF=(e,t)=>{for(var n in t||(t={}))wF.call(t,n)&&_F(e,n,t[n]);if(bF)for(var n of bF(t))EF.call(t,n)&&_F(e,n,t[n]);return e},kF=(e,t)=>{const{allowedSchemes:n,defaultLinkAttributes:r,dangerouslySkipSanitization:o}=BO(e,AF),i=xF({},r),a=o?t.url:((e,{allowedSchemes:t,permitInvalid:n=!1})=>{if(!e)return null;let r=null;try{r=new URL(e)}catch(t){return n?e:null}return t&&!t.includes(r.protocol.slice(0,-1))?null:r.href})(t.url,{allowedSchemes:n})||void 0;return void 0!==a&&(i.href=a),"target"in t&&(i.target=t.target),i},CF=cc("floatingLink")({openEditorId:null,mouseDown:!1,updated:!1,url:"",text:"",newTab:!1,mode:"",isEditing:!1}).extendActions(e=>({reset:()=>{e.url(""),e.text(""),e.newTab(!1),e.mode(""),e.isEditing(!1)}})).extendActions(e=>({show:(t,n)=>{e.mode(t),e.isEditing(!1),e.openEditorId(n)},hide:()=>{e.openEditorId(null),e.reset()}})).extendSelectors(e=>({isOpen:t=>e.openEditorId===t})),SF=CF.set,TF=CF.get,DF=()=>CF.use;MP("input")({propsHook:({checked:e,ref:t,setChecked:n})=>{const r=Da.useCallback(e=>{n(e.target.checked),SF.newTab(e.target.checked)},[n]);return{ref:t,props:{onChange:r,checked:e,type:"checkbox"}}},stateHook:()=>{const e=DF().updated(),t=Da.useRef(null),[n,r]=Da.useState(TF.newTab());return Da.useEffect(()=>{t.current&&e&&setTimeout(()=>{var e;null==(e=t.current)||e.focus()},0)},[e]),{ref:t,checked:n,setChecked:r}}});MP("input")({propsHook:e=>{const t=Da.useCallback(e=>{SF.url(e.target.value)},[]);return{ref:e.ref,props:{onChange:t,defaultValue:TF.url()}}},stateHook:()=>{const e=DF().updated(),t=Da.useRef(null);return Da.useEffect(()=>{t.current&&e&&setTimeout(()=>{var e;null==(e=t.current)||e.focus()},0)},[e]),{ref:t}}});MP("a")({stateHook:()=>{const e=oP(),t=((e,t={})=>tP(e,xA({debugHookName:"useEditorSelection"},t)).trackedSelection().selection)(),n=Da.useMemo(()=>((e,t={})=>{try{const n=qp(e,jp({at:e.selection||[]},Vp(e,t)));for(const[e,t]of n)return[e,t]}catch(e){return}})(e,{match:{type:LA(e,AF)}}),[e,t]);if(!n)return{};const[r]=n;return{element:r}},propsHook:({element:e})=>{const t=oP();if(!e)return{props:{}};const n=kF(t,e);return{props:(r=xF({},n),o={target:"_blank","aria-label":"Open link in a new tab",onMouseOver:e=>{e.stopPropagation()}},vF(r,yF(o)))};var r,o}});var AF="a";!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t=function(e){if("string"!=typeof e)return{};var t,n={},r=(e=e.split("+").join(" ")).match(/(?:[?](?:[^=]+)=(?:[^&#]*)(?:[&](?:[^=]+)=(?:[^&#]*))*(?:[#].*)?)|(?:[#].*)/);if(null===r)return{};t=r[0].substr(1).split(/[&#=]/);for(var o=0;o<t.length;o+=2)n[decodeURIComponent(t[o])]=decodeURIComponent(t[o+1]||"");return n},n=function(t,n){if("object"!==e(t))return"";var r="",o=0,i=Object.keys(t);if(0===i.length)return"";for(i.sort(),n||(r+="?"+i[0]+"="+t[i[0]],o+=1);o<i.length;o+=1)r+="&"+i[o]+"="+t[i[o]];return r};function r(e){var t,n=0,r={s:1,m:60,h:3600,d:86400,w:604800};t=(e=e.replace(/([smhdw])/g," $1 ").trim()).split(" ");for(var o=0;o<t.length;o+=2)n+=parseInt(t[o],10)*r[t[o+1]||"s"];return n}function o(e){for(var t=0,n=[1,60,3600,86400,604800],r=e.split(":"),o=0;o<r.length;o++)t+=parseInt(r[o],10)*n[r.length-o-1];return t}var i={getQueryParams:t,combineParams:n,getTime:function(e){return void 0===e?0:e.match(/^(\d+[smhdw]?)+$/)?r(e):e.match(/^(\d+:?)+$/)?o(e):0}},a=i.getQueryParams;function s(){for(var e=0,t=["parseProvider","parse","bind","create"];e<t.length;e++){var n=t[e];this[n]=this[n].bind(this)}this.plugins={}}var l=s;function u(e){return e.params&&0===Object.keys(e.params).length&&delete e.params,e}s.prototype.parseProvider=function(e){var t=e.match(/(?:(?:https?:)?\/\/)?(?:[^.]+\.)?(\w+)\./i);return t?t[1]:void 0},s.prototype.parse=function(e){if(void 0!==e){var t,n=this.parseProvider(e),r=this.plugins[n];if(n&&r&&r.parse)return(t=r.parse.call(r,e,a(e)))&&((t=u(t)).provider=r.provider),t}},s.prototype.bind=function(e){if(this.plugins[e.provider]=e,e.alternatives)for(var t=0;t<e.alternatives.length;t+=1)this.plugins[e.alternatives[t]]=e},s.prototype.create=function(t){if("object"===e(t)&&"object"===e(t.videoInfo)){var n=t.videoInfo,r=t.params,o=this.plugins[n.provider];return r="internal"===r?n.params:r||{},o&&(t.format=t.format||o.defaultFormat,o.formats.hasOwnProperty(t.format))?o.formats[t.format].apply(o,[n,Object.assign({},r)]):void 0}};var c=new l;function d(){this.provider="allocine",this.alternatives=[],this.defaultFormat="embed",this.formats={embed:this.createEmbedUrl},this.mediaTypes={VIDEO:"video"}}d.prototype.parseUrl=function(e){var t=e.match(/(?:\/video\/player_gen_cmedia=)([A-Za-z0-9]+)/i);return t?t[1]:void 0},d.prototype.parse=function(e){var t={mediaType:this.mediaTypes.VIDEO,id:this.parseUrl(e)};return t.id?t:void 0},d.prototype.createEmbedUrl=function(e){if(e.id&&e.mediaType===this.mediaTypes.VIDEO)return"https://player.allocine.fr/"+e.id+".html"},c.bind(new d);var p=i.combineParams;function f(){this.provider="canalplus",this.defaultFormat="embed",this.formats={embed:this.createEmbedUrl},this.mediaTypes={VIDEO:"video"}}f.prototype.parseParameters=function(e){return delete e.vid,e},f.prototype.parse=function(e,t){var n=this,r={mediaType:this.mediaTypes.VIDEO,id:t.vid};if(r.params=n.parseParameters(t),r.id)return r},f.prototype.createEmbedUrl=function(e,t){if(e.id&&e.mediaType===this.mediaTypes.VIDEO){var n="http://player.canalplus.fr/embed/";return t.vid=e.id,n+=p(t)}},c.bind(new f);var h=i.combineParams;function g(){this.provider="coub",this.defaultFormat="long",this.formats={long:this.createLongUrl,embed:this.createEmbedUrl},this.mediaTypes={VIDEO:"video"}}g.prototype.parseUrl=function(e){var t=e.match(/(?:embed|view)\/([a-zA-Z\d]+)/i);return t?t[1]:void 0},g.prototype.parse=function(e,t){var n={mediaType:this.mediaTypes.VIDEO,params:t,id:this.parseUrl(e)};if(n.id)return n},g.prototype.createUrl=function(e,t,n){if(t.id&&t.mediaType===this.mediaTypes.VIDEO){var r=e+t.id;return r+=h(n)}},g.prototype.createLongUrl=function(e,t){return this.createUrl("https://coub.com/view/",e,t)},g.prototype.createEmbedUrl=function(e,t){return this.createUrl("//coub.com/embed/",e,t)},c.bind(new g);var m=i.combineParams,v=i.getTime;function y(){this.provider="dailymotion",this.alternatives=["dai"],this.defaultFormat="long",this.formats={short:this.createShortUrl,long:this.createLongUrl,embed:this.createEmbedUrl,image:this.createImageUrl},this.mediaTypes={VIDEO:"video"}}y.prototype.parseParameters=function(e){return this.parseTime(e)},y.prototype.parseTime=function(e){return e.start&&(e.start=v(e.start)),e},y.prototype.parseUrl=function(e){var t=e.match(/(?:\/video|ly)\/([A-Za-z0-9]+)/i);return t?t[1]:void 0},y.prototype.parse=function(e,t){var n=this,r={mediaType:this.mediaTypes.VIDEO,params:n.parseParameters(t),id:n.parseUrl(e)};return r.id?r:void 0},y.prototype.createUrl=function(e,t,n){if(t.id&&t.mediaType===this.mediaTypes.VIDEO)return e+t.id+m(n)},y.prototype.createShortUrl=function(e,t){return this.createUrl("https://dai.ly/",e,t)},y.prototype.createLongUrl=function(e,t){return this.createUrl("https://dailymotion.com/video/",e,t)},y.prototype.createEmbedUrl=function(e,t){return this.createUrl("https://www.dailymotion.com/embed/video/",e,t)},y.prototype.createImageUrl=function(e,t){return delete t.start,this.createUrl("https://www.dailymotion.com/thumbnail/video/",e,t)},c.bind(new y);var b=i.combineParams;function w(){this.provider="loom",this.defaultFormat="long",this.formats={long:this.createLongUrl,embed:this.createEmbedUrl},this.mediaTypes={VIDEO:"video"}}w.prototype.parseUrl=function(e){var t=e.match(/(?:share|embed)\/([a-zA-Z\d]+)/i);return t?t[1]:void 0},w.prototype.parse=function(e,t){var n={mediaType:this.mediaTypes.VIDEO,params:t,id:this.parseUrl(e)};return n.id?n:void 0},w.prototype.createUrl=function(e,t,n){if(t.id&&t.mediaType===this.mediaTypes.VIDEO){var r=e+t.id;return r+=b(n)}},w.prototype.createLongUrl=function(e,t){return this.createUrl("https://loom.com/share/",e,t)},w.prototype.createEmbedUrl=function(e,t){return this.createUrl("//loom.com/embed/",e,t)},c.bind(new w);var E=i.combineParams,_=i.getTime;function x(){this.provider="twitch",this.defaultFormat="long",this.formats={long:this.createLongUrl,embed:this.createEmbedUrl},this.mediaTypes={VIDEO:"video",STREAM:"stream",CLIP:"clip"}}x.prototype.seperateId=function(e){return{pre:e[0],id:e.substr(1)}},x.prototype.parseChannel=function(e,t){var n=t.channel||t.utm_content||e.channel;return delete t.utm_content,delete t.channel,n},x.prototype.parseUrl=function(e,t,n){var r;return(r=e.match(/(clips\.)?twitch\.tv\/(?:(?:videos\/(\d+))|(\w+(?:-[\w\d-]+)?)(?:\/clip\/(\w+))?)/i))&&r[2]?t.id="v"+r[2]:n.video?(t.id=n.video,delete n.video):n.clip?(t.id=n.clip,t.isClip=!0,delete n.clip):r&&r[1]&&r[3]?(t.id=r[3],t.isClip=!0):r&&r[3]&&r[4]?(t.channel=r[3],t.id=r[4],t.isClip=!0):r&&r[3]&&(t.channel=r[3]),t},x.prototype.parseMediaType=function(e){var t;return e.id?e.isClip?(t=this.mediaTypes.CLIP,delete e.isClip):t=this.mediaTypes.VIDEO:e.channel&&(t=this.mediaTypes.STREAM),t},x.prototype.parseParameters=function(e){return e.t&&(e.start=_(e.t),delete e.t),e},x.prototype.parse=function(e,t){var n=this,r={};return(r=n.parseUrl(e,r,t)).channel=n.parseChannel(r,t),r.mediaType=n.parseMediaType(r),r.params=n.parseParameters(t),r.channel||r.id?r:void 0},x.prototype.createLongUrl=function(e,t){var n="";if(e.mediaType===this.mediaTypes.STREAM&&e.channel)n="https://twitch.tv/"+e.channel;else if(e.mediaType===this.mediaTypes.VIDEO&&e.id)n="https://twitch.tv/videos/"+this.seperateId(e.id).id,t.start&&(t.t=t.start+"s",delete t.start);else{if(e.mediaType!==this.mediaTypes.CLIP||!e.id)return;n=e.channel?"https://www.twitch.tv/"+e.channel+"/clip/"+e.id:"https://clips.twitch.tv/"+e.id}return n+=E(t)},x.prototype.createEmbedUrl=function(e,t){var n="https://player.twitch.tv/";if(e.mediaType===this.mediaTypes.STREAM&&e.channel)t.channel=e.channel;else if(e.mediaType===this.mediaTypes.VIDEO&&e.id)t.video=e.id,t.start&&(t.t=t.start+"s",delete t.start);else{if(e.mediaType!==this.mediaTypes.CLIP||!e.id)return;n="https://clips.twitch.tv/embed",t.clip=e.id}return n+=E(t)},c.bind(new x);var k=i.combineParams,C=i.getTime;function S(){this.provider="vimeo",this.alternatives=["vimeopro"],this.defaultFormat="long",this.formats={long:this.createLongUrl,embed:this.createEmbedUrl},this.mediaTypes={VIDEO:"video"}}S.prototype.parseUrl=function(e){var t=e.match(/(?:\/showcase\/\d+)?(?:\/(?:channels\/[\w]+|(?:(?:album\/\d+|groups\/[\w]+)\/)?videos?))?\/(\d+)/i);return t?t[1]:void 0},S.prototype.parseHash=function(e){var t=e.match(/\/\d+\/(\w+)$/i);return t?t[1]:void 0},S.prototype.parseParameters=function(e){return e.t&&(e.start=C(e.t),delete e.t),e.h&&(e.hash=e.h,delete e.h),e},S.prototype.parse=function(e,t){var n={mediaType:this.mediaTypes.VIDEO,params:this.parseParameters(t),id:this.parseUrl(e)},r=this.parseHash(e,t);return r&&(n.params.hash=r),n.id?n:void 0},S.prototype.createUrl=function(e,t,n,r){if(t.id&&t.mediaType===this.mediaTypes.VIDEO){var o=e+t.id,i=n.start;return delete n.start,n.hash&&("embed"===r?n.h=n.hash:"long"===r&&(o+="/"+n.hash),delete n.hash),o+=k(n),i&&(o+="#t="+i),o}},S.prototype.createLongUrl=function(e,t){return this.createUrl("https://vimeo.com/",e,t,"long")},S.prototype.createEmbedUrl=function(e,t){return this.createUrl("//player.vimeo.com/video/",e,t,"embed")},c.bind(new S);var T=i.combineParams,D=i.getTime;function A(){this.provider="wistia",this.alternatives=[],this.defaultFormat="long",this.formats={long:this.createLongUrl,embed:this.createEmbedUrl,embedjsonp:this.createEmbedJsonpUrl},this.mediaTypes={VIDEO:"video",EMBEDVIDEO:"embedvideo"}}A.prototype.parseUrl=function(e){var t=e.match(/(?:(?:medias|iframe)\/|wvideo=)([\w-]+)/);return t?t[1]:void 0},A.prototype.parseChannel=function(e){var t=e.match(/(?:(?:https?:)?\/\/)?([^.]*)\.wistia\./),n=t?t[1]:void 0;if("fast"!==n&&"content"!==n)return n},A.prototype.parseParameters=function(e,t){return e.wtime&&(e.start=D(e.wtime),delete e.wtime),e.wvideo===t.id&&delete e.wvideo,e},A.prototype.parseMediaType=function(e){return e.id&&e.channel?this.mediaTypes.VIDEO:e.id?(delete e.channel,this.mediaTypes.EMBEDVIDEO):void 0},A.prototype.parse=function(e,t){var n={id:this.parseUrl(e),channel:this.parseChannel(e)};if(n.params=this.parseParameters(t,n),n.mediaType=this.parseMediaType(n),n.id)return n},A.prototype.createUrl=function(e,t,n){return t.start&&(t.wtime=t.start,delete t.start),n+=T(t)},A.prototype.createLongUrl=function(e,t){if(e.id&&e.mediaType===this.mediaTypes.VIDEO){var n="https://"+e.channel+".wistia.com/medias/"+e.id;return this.createUrl(e,t,n)}},A.prototype.createEmbedUrl=function(e,t){if(e.id&&(e.mediaType===this.mediaTypes.VIDEO||e.mediaType===this.mediaTypes.EMBEDVIDEO)){var n="https://fast.wistia.com/embed/iframe/"+e.id;return this.createUrl(e,t,n)}},A.prototype.createEmbedJsonpUrl=function(e){if(e.id&&(e.mediaType===this.mediaTypes.VIDEO||e.mediaType===this.mediaTypes.EMBEDVIDEO))return"https://fast.wistia.com/embed/medias/"+e.id+".jsonp"},c.bind(new A);var O=i.combineParams;function P(){this.provider="youku",this.defaultFormat="long",this.formats={embed:this.createEmbedUrl,long:this.createLongUrl,flash:this.createFlashUrl,static:this.createStaticUrl},this.mediaTypes={VIDEO:"video"}}P.prototype.parseUrl=function(e){var t=e.match(/(?:(?:embed|sid)\/|v_show\/id_|VideoIDS=)([a-zA-Z0-9]+)/);return t?t[1]:void 0},P.prototype.parseParameters=function(e){return e.VideoIDS&&delete e.VideoIDS,e},P.prototype.parse=function(e,t){var n=this,r={mediaType:this.mediaTypes.VIDEO,id:n.parseUrl(e),params:n.parseParameters(t)};if(r.id)return r},P.prototype.createUrl=function(e,t,n){if(t.id&&t.mediaType===this.mediaTypes.VIDEO){var r=e+t.id;return r+=O(n)}},P.prototype.createEmbedUrl=function(e,t){return this.createUrl("http://player.youku.com/embed/",e,t)},P.prototype.createLongUrl=function(e,t){return this.createUrl("http://v.youku.com/v_show/id_",e,t)},P.prototype.createStaticUrl=function(e,t){return this.createUrl("http://static.youku.com/v1.0.0638/v/swf/loader.swf?VideoIDS=",e,t)},P.prototype.createFlashUrl=function(e,t){if(e.id&&e.mediaType===this.mediaTypes.VIDEO){var n="http://player.youku.com/player.php/sid/"+e.id+"/v.swf";return n+=O(t)}},c.bind(new P);var I=i.combineParams,N=i.getTime;function R(){this.provider="youtube",this.alternatives=["youtu","ytimg"],this.defaultFormat="long",this.formats={short:this.createShortUrl,long:this.createLongUrl,embed:this.createEmbedUrl,shortImage:this.createShortImageUrl,longImage:this.createLongImageUrl},this.imageQualities={0:"0",1:"1",2:"2",3:"3",DEFAULT:"default",HQDEFAULT:"hqdefault",SDDEFAULT:"sddefault",MQDEFAULT:"mqdefault",MAXRESDEFAULT:"maxresdefault"},this.defaultImageQuality=this.imageQualities.HQDEFAULT,this.mediaTypes={VIDEO:"video",PLAYLIST:"playlist",SHARE:"share",CHANNEL:"channel"}}R.prototype.parseVideoUrl=function(e){var t=e.match(/(?:(?:v|vi|be|videos|embed)\/(?!videoseries)|(?:v|ci)=)([\w-]{11})/i);return t?t[1]:void 0},R.prototype.parseChannelUrl=function(e){var t=e.match(/\/channel\/([\w-]+)/);return t?{id:t[1],mediaType:this.mediaTypes.CHANNEL}:(t=e.match(/\/(?:c|user)\/([\w-]+)/))?{name:t[1],mediaType:this.mediaTypes.CHANNEL}:void 0},R.prototype.parseParameters=function(e,t){return(e.start||e.t)&&(e.start=N(e.start||e.t),delete e.t),e.v===t.id&&delete e.v,e.list===t.id&&delete e.list,e},R.prototype.parseMediaType=function(e){if(e.params.list&&(e.list=e.params.list,delete e.params.list),e.id&&!e.params.ci)e.mediaType=this.mediaTypes.VIDEO;else if(e.list)delete e.id,e.mediaType=this.mediaTypes.PLAYLIST;else{if(!e.params.ci)return;delete e.params.ci,e.mediaType=this.mediaTypes.SHARE}return e},R.prototype.parse=function(e,t){var n=this.parseChannelUrl(e);if(n)return n;var r={params:t,id:this.parseVideoUrl(e)};return r.params=this.parseParameters(t,r),r=this.parseMediaType(r)},R.prototype.createShortUrl=function(e,t){if(e.id&&e.mediaType===this.mediaTypes.VIDEO){var n="https://youtu.be/"+e.id;return t.start&&(n+="#t="+t.start),n}},R.prototype.createLongUrl=function(e,t){var n="",r=t.start;if(delete t.start,e.mediaType===this.mediaTypes.CHANNEL)if(e.id)n+="https://www.youtube.com/channel/"+e.id;else{if(!e.name)return;n+="https://www.youtube.com/c/"+e.name}else if(e.mediaType===this.mediaTypes.PLAYLIST&&e.list)t.feature="share",n+="https://www.youtube.com/playlist";else if(e.mediaType===this.mediaTypes.VIDEO&&e.id)t.v=e.id,n+="https://www.youtube.com/watch";else{if(e.mediaType!==this.mediaTypes.SHARE||!e.id)return;t.ci=e.id,n+="https://www.youtube.com/shared"}return e.list&&(t.list=e.list),n+=I(t),e.mediaType!==this.mediaTypes.PLAYLIST&&r&&(n+="#t="+r),n},R.prototype.createEmbedUrl=function(e,t){var n="https://www.youtube.com/embed";if(e.mediaType===this.mediaTypes.PLAYLIST&&e.list)t.listType="playlist";else{if(e.mediaType!==this.mediaTypes.VIDEO||!e.id)return;n+="/"+e.id,"1"===t.loop&&(t.playlist=e.id)}return e.list&&(t.list=e.list),n+=I(t)},R.prototype.createImageUrl=function(e,t,n){if(t.id&&t.mediaType===this.mediaTypes.VIDEO)return e+t.id+"/"+(n.imageQuality||this.defaultImageQuality)+".jpg"},R.prototype.createShortImageUrl=function(e,t){return this.createImageUrl("https://i.ytimg.com/vi/",e,t)},R.prototype.createLongImageUrl=function(e,t){return this.createImageUrl("https://img.youtube.com/vi/",e,t)},c.bind(new R);var B=i.combineParams,F=i.getTime;function L(){this.provider="soundcloud",this.defaultFormat="long",this.formats={long:this.createLongUrl,embed:this.createEmbedUrl},this.mediaTypes={TRACK:"track",PLAYLIST:"playlist",APITRACK:"apitrack",APIPLAYLIST:"apiplaylist"}}L.prototype.parseUrl=function(e,t){var n=e.match(/(?:m\.)?soundcloud\.com\/(?:([\w-]+)\/(sets\/)?)([\w-]+)/i);return n?(t.channel=n[1],"playlists"===n[1]||n[2]?t.list=n[3]:t.id=n[3],t):t},L.prototype.parseParameters=function(e){return e.t&&(e.start=F(e.t),delete e.t),e},L.prototype.parseMediaType=function(e){return e.id&&("tracks"===e.channel?(delete e.channel,delete e.params.url,e.mediaType=this.mediaTypes.APITRACK):e.mediaType=this.mediaTypes.TRACK),e.list&&("playlists"===e.channel?(delete e.channel,delete e.params.url,e.mediaType=this.mediaTypes.APIPLAYLIST):e.mediaType=this.mediaTypes.PLAYLIST),e},L.prototype.parse=function(e,t){var n={};if((n=this.parseUrl(e,n)).params=this.parseParameters(t),(n=this.parseMediaType(n)).id||n.list)return n},L.prototype.createLongUrl=function(e,t){var n="",r=t.start;if(delete t.start,e.mediaType===this.mediaTypes.TRACK&&e.id&&e.channel)n="https://soundcloud.com/"+e.channel+"/"+e.id;else if(e.mediaType===this.mediaTypes.PLAYLIST&&e.list&&e.channel)n="https://soundcloud.com/"+e.channel+"/sets/"+e.list;else if(e.mediaType===this.mediaTypes.APITRACK&&e.id)n="https://api.soundcloud.com/tracks/"+e.id;else{if(e.mediaType!==this.mediaTypes.APIPLAYLIST||!e.list)return;n="https://api.soundcloud.com/playlists/"+e.list}return n+=B(t),r&&(n+="#t="+r),n},L.prototype.createEmbedUrl=function(e,t){var n="https://w.soundcloud.com/player/";if(delete t.start,e.mediaType===this.mediaTypes.APITRACK&&e.id)t.url="https%3A//api.soundcloud.com/tracks/"+e.id;else{if(e.mediaType!==this.mediaTypes.APIPLAYLIST||!e.list)return;t.url="https%3A//api.soundcloud.com/playlists/"+e.list}return n+=B(t)},c.bind(new L);var M=i.combineParams;function U(){this.provider="teachertube",this.alternatives=[],this.defaultFormat="long",this.formats={long:this.createLongUrl,embed:this.createEmbedUrl},this.mediaTypes={VIDEO:"video",AUDIO:"audio",DOCUMENT:"document",CHANNEL:"channel",COLLECTION:"collection",GROUP:"group"}}U.prototype.parse=function(e,t){var n={};n.list=this.parsePlaylist(t),n.params=t;var r=e.match(/\/(audio|video|document|user\/channel|collection|group)\/(?:[\w-]+-)?(\w+)/);if(r)return n.mediaType=this.parseMediaType(r[1]),n.id=r[2],n},U.prototype.parsePlaylist=function(e){if(e["playlist-id"]){var t=e["playlist-id"];return delete e["playlist-id"],t}},U.prototype.parseMediaType=function(e){switch(e){case"audio":return this.mediaTypes.AUDIO;case"video":return this.mediaTypes.VIDEO;case"document":return this.mediaTypes.DOCUMENT;case"user/channel":return this.mediaTypes.CHANNEL;case"collection":return this.mediaTypes.COLLECTION;case"group":return this.mediaTypes.GROUP}},U.prototype.createLongUrl=function(e,t){if(e.id){var n="https://www.teachertube.com/";return e.list&&(t["playlist-id"]=e.list),e.mediaType===this.mediaTypes.CHANNEL?n+="user/channel/":n+=e.mediaType+"/",n+=e.id,n+=M(t)}},U.prototype.createEmbedUrl=function(e,t){if(e.id){var n="https://www.teachertube.com/embed/";if(e.mediaType===this.mediaTypes.VIDEO||e.mediaType===this.mediaTypes.AUDIO)return n+=e.mediaType+"/"+e.id,n+=M(t)}},c.bind(new U);var j=i.combineParams;function $(){this.provider="tiktok",this.defaultFormat="long",this.formats={long:this.createLongUrl},this.mediaTypes={VIDEO:"video"}}$.prototype.parse=function(e,t){var n={params:t,mediaType:this.mediaTypes.VIDEO},r=e.match(/@([^/]+)\/video\/(\d{19})/);if(r)return n.channel=r[1],n.id=r[2],n},$.prototype.createLongUrl=function(e,t){var n="";if(e.mediaType===this.mediaTypes.VIDEO&&e.id&&e.channel)return n+="https://www.tiktok.com/@".concat(e.channel,"/video/").concat(e.id),n+=j(t)},c.bind(new $);var z=i.combineParams;function H(){this.provider="ted",this.formats={long:this.createLongUrl,embed:this.createEmbedUrl},this.mediaTypes={VIDEO:"video",PLAYLIST:"playlist"}}H.prototype.parseUrl=function(e,t){var n=e.match(/\/(talks|playlists\/(\d+))\/([\w-]+)/i),r=n?n[1]:void 0;return r?(t.channel=r.split("/")[0],t.id=n[3],"playlists"===t.channel&&(t.list=n[2]),t):t},H.prototype.parseMediaType=function(e){return e.id&&"playlists"===e.channel&&(delete e.channel,e.mediaType=this.mediaTypes.PLAYLIST),e.id&&"talks"===e.channel&&(delete e.channel,e.mediaType=this.mediaTypes.VIDEO),e},H.prototype.parse=function(e,t){var n={params:t};if(n=this.parseUrl(e,n),(n=this.parseMediaType(n)).id)return n},H.prototype.createLongUrl=function(e,t){var n="";if(e.mediaType===this.mediaTypes.VIDEO&&e.id)n+="https://ted.com/talks/"+e.id;else{if(e.mediaType!==this.mediaTypes.PLAYLIST||!e.id)return;n+="https://ted.com/playlists/"+e.list+"/"+e.id}return n+=z(t)},H.prototype.createEmbedUrl=function(e,t){var n="https://embed.ted.com/";if(e.mediaType===this.mediaTypes.PLAYLIST&&e.id)n+="playlists/"+e.list+"/"+e.id;else{if(e.mediaType!==this.mediaTypes.VIDEO||!e.id)return;n+="talks/"+e.id}return n+=z(t)},c.bind(new H);var V=i.combineParams;function W(){this.provider="facebook",this.alternatives=[],this.defaultFormat="long",this.formats={long:this.createLongUrl,watch:this.createWatchUrl},this.mediaTypes={VIDEO:"video"}}W.prototype.parse=function(e,t){var n={params:t,mediaType:this.mediaTypes.VIDEO},r=e.match(/(?:\/(\d+))?\/videos(?:\/.*?)?\/(\d+)/i);if(r&&(r[1]&&(n.pageId=r[1]),n.id=r[2]),t.v&&!n.id&&(n.id=t.v,delete t.v,n.params=t),n.id)return n},W.prototype.createWatchUrl=function(e,t){var n="https://facebook.com/watch/";if(e.mediaType===this.mediaTypes.VIDEO&&e.id)return t={v:e.id},n+=V(t)},W.prototype.createLongUrl=function(e,t){var n="https://facebook.com/";if(e.pageId&&(n+=e.pageId,e.mediaType===this.mediaTypes.VIDEO&&e.id))return n+="/videos/"+e.id,n+=V(t)},c.bind(new W);var q=c}();MP("img")({propsHook:()=>{const{url:e}=AA();return{props:{src:e,draggable:!0}}}});var OF=cc("floatingMedia")({url:"",isEditing:!1}).extendActions(e=>({reset:()=>{e.url(""),e.isEditing(!1)}})),PF=OF.set,IF=OF.get;MP("button")({propsHook:()=>{const e=AA();return{props:{onClick:Da.useCallback(()=>{PF.url(e.url),PF.isEditing(!0)},[e.url])}}}});var NF=(e,{element:t,pluginKey:n="media"})=>{let r=IF.url();if(r===t.url)return PF.reset(),!0;const{isUrl:o=Sx,transformUrl:i}=BO(e,n);return o(r)?(i&&(r=i(r)),((e,t,n)=>{Vd.setNodes(e,t,n)})(e,{url:r}),PF.reset(),wv(e,e.selection),!0):void 0};MP("input")({stateHook:({pluginKey:e}={})=>{const t=oP(),n=AA();return fl("enter",r=>{NF(t,{element:n,pluginKey:e})&&r.preventDefault()},{enableOnFormTags:["INPUT"]},[]),fl("escape",()=>{IF.isEditing()&&(PF.reset(),wv(t,t.selection))},{enableOnFormTags:["INPUT"],enableOnContentEditable:!0},[]),{defaultValue:IF.url()}},propsHook:({defaultValue:e})=>{const t=Da.useCallback(e=>{PF.url(e.target.value)},[]);return{props:{onChange:t,autoFocus:!0,defaultValue:e}}}});var RF="p";const BF=(e,t,n)=>{const{children:r}=e;return r?r.flatMap(e=>$R(e,t,n)):[]},FF={heading:{transform:(e,t,n)=>{const r={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}[e.depth??1];return[...LF(e,t,n),{type:LA(n.editor,r),children:BF(e,e.position.end.line,n)}]}},list:{transform:(e,t,n)=>{if(n.indentList){const r=e.ordered?"decimal":"disc",o=(t,i=[],a=1)=>(t.children.forEach(t=>{const[s,...l]=t.children;i.push({type:LA(n.editor,RF),listStyleType:r,indent:a,children:BF(s||"",e.position.end.line,n)}),l.forEach(e=>{o(e,i,a+1)})}),i);return[...LF(e,t,n),o(e)]}return[...LF(e,t,n),{type:LA(n.editor,e.ordered?"ol":"ul"),children:BF(e,e.position.end.line,n)}]}},listItem:{transform:(e,t,n)=>({type:LA(n.editor,"li"),children:BF(e,e.position.end.line,n).map(e=>({...e,type:e.type===LA(n.editor,RF)?LA(n.editor,"lic"):e.type}))})},paragraph:{transform:(e,t,n)=>{const r=BF(e,e.position.end.line,n),o=LA(n.editor,RF),i=new Set([LA(n.editor,"img")]),a=[];let s=[];const l=()=>{s.length>0&&(a.push({type:o,children:s}),s=[])};return r.forEach(e=>{const{type:t}=e;t&&i.has(t)?(l(),a.push(e)):s.push(e)}),l(),[...LF(e,t,n),...a]}},link:{transform:(e,t,n)=>[...LF(e,t,n),{type:LA(n.editor,AF),url:e.url,children:BF(e,e.position.end.line,n)}]},image:{transform:(e,t,n)=>[...LF(e,t,n),{type:LA(n.editor,"img"),children:[{text:""}],url:e.url,caption:[{text:e.alt}]}]},blockquote:{transform:(e,t,n)=>[...LF(e,t,n),{type:LA(n.editor,"blockquote"),children:e.children.flatMap(t=>BF(t,e.position.end.line,n))}]},code:{transform:(e,t,n)=>[...LF(e,t,n),{type:LA(n.editor,"code_block"),lang:e.lang??void 0,children:(e.value||"").split("\n").map(e=>({type:LA(n.editor,"code_line"),children:[{text:e}]}))}]},thematicBreak:{transform:(e,t,n)=>[...LF(e,t,n),{type:LA(n.editor,"hr"),children:[{text:""}]}]}},LF=(e,t,n)=>{const r=e.position.start.line-t;let o=[];return r>1&&o.push(...Array(r-1).fill({type:LA(n.editor,RF),children:[{text:""}]})),o},MF="deserializeMd",UF=UA({key:MF,then:e=>({editor:{insertData:{format:"text/plain",query:({data:e,dataTransfer:t})=>{if(t.getData("text/html"))return!1;const{files:n}=t;return!(!n?.length&&Sx(e))},getFragment:({data:t})=>((e,t)=>{const{elementRules:n,textRules:r,indentList:o}=BO(e,MF);return ER().use(rR).use(zR,{editor:e,elementRules:n,textRules:r,indentList:o}).processSync(t).result})(e,t)}}}),options:{elementRules:FF,textRules:UR,indentList:!1}});function jF(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let $F={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function zF(e){$F=e}const HF=/[&<>"']/,VF=new RegExp(HF.source,"g"),WF=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,qF=new RegExp(WF.source,"g"),GF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},KF=e=>GF[e];function YF(e,t){if(t){if(HF.test(e))return e.replace(VF,KF)}else if(WF.test(e))return e.replace(qF,KF);return e}const ZF=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function XF(e){return e.replace(ZF,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const QF=/(^|[^\[])\^/g;function JF(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,r)=>(r=(r="object"==typeof r&&"source"in r?r.source:r).replace(QF,"$1"),e=e.replace(t,r),n),getRegex:()=>new RegExp(e,t)};return n}function eL(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const tL={exec:()=>null};function nL(e,t){const n=e.replace(/\|/g,(e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function rL(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){if(e.charAt(r-o-1)!==t)break;o++}return e.slice(0,r-o)}function oL(e,t,n,r){const o=t.href,i=t.title?YF(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){r.state.inLink=!0;const e={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,e}return{type:"image",raw:n,href:o,title:i,text:YF(a)}}class iL{options;rules;lexer;constructor(e){this.options=e||$F}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:rL(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const r=n[1];return t.split("\n").map(e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=r.length?e.slice(r.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=rL(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let a="",s="",l=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let r=t[2].split("\n",1)[0].replace(/^\t+/,e=>" ".repeat(3*e.length)),u=e.split("\n",1)[0],c=0;this.options.pedantic?(c=2,s=r.trimStart()):(c=t[2].search(/[^ ]/),c=c>4?1:c,s=r.slice(c),c+=t[1].length);let d=!1;if(!r&&/^ *$/.test(u)&&(a+=u+"\n",e=e.substring(u.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,c-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),o=new RegExp(`^ {0,${Math.min(3,c-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,c-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(u=l,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),o.test(u))break;if(i.test(u))break;if(t.test(u))break;if(n.test(e))break;if(u.search(/[^ ]/)>=c||!u.trim())s+="\n"+u.slice(c);else{if(d)break;if(r.search(/[^ ]/)>=4)break;if(o.test(r))break;if(i.test(r))break;if(n.test(r))break;s+="\n"+u}d||u.trim()||(d=!0),a+=l+"\n",e=e.substring(l.length+1),r=u.slice(c)}}o.loose||(l?o.loose=!0:/\n *\n *$/.test(a)&&(l=!0));let p,f=null;this.options.gfm&&(f=/^\[[ xX]\] /.exec(s),f&&(p="[ ] "!==f[0],s=s.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:a,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),o.raw+=a}o.items[o.items.length-1].raw=a.trimEnd(),o.items[o.items.length-1].text=s.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e<o.items.length;e++)if(this.lexer.state.top=!1,o.items[e].tokens=this.lexer.blockTokens(o.items[e].text,[]),!o.loose){const t=o.items[e].tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw));o.loose=n}if(o.loose)for(let e=0;e<o.items.length;e++)o.items[e].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:nL(t[1]).map(e=>({text:e,tokens:[]})),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,n,r,o,i=e.align.length;for(t=0;t<i;t++){const n=e.align[t];n&&(/^ *-+: *$/.test(n)?e.align[t]="right":/^ *:-+: *$/.test(n)?e.align[t]="center":/^ *:-+ *$/.test(n)?e.align[t]="left":e.align[t]=null)}for(i=e.rows.length,t=0;t<i;t++)e.rows[t]=nL(e.rows[t],e.header.length).map(e=>({text:e,tokens:[]}));for(i=e.header.length,n=0;n<i;n++)e.header[n].tokens=this.lexer.inline(e.header[n].text);for(i=e.rows.length,n=0;n<i;n++)for(o=e.rows[n],r=0;r<o.length;r++)o[r].tokens=this.lexer.inline(o[r].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:YF(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=rL(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),oL(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:r?r.replace(this.rules.inline._escapes,"$1"):r},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return oL(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r)return;if(r[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let o,i,a=n,s=0;const l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+r[0].length-1);null!=(r=l.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=[...o].length,r[3]||r[4]){a+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){s+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+s);const t=[...e].slice(0,n+r.index+i+1).join("");if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=YF(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=YF(t[1]),n="mailto:"+e):(e=YF(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=YF(t[0]),n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(r!==t[0]);e=YF(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:YF(t[0]),{type:"text",raw:t[0],text:e}}}}const aL={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:tL,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};aL.def=JF(aL.def).replace("label",aL._label).replace("title",aL._title).getRegex(),aL.bullet=/(?:[*+-]|\d{1,9}[.)])/,aL.listItemStart=JF(/^( *)(bull) */).replace("bull",aL.bullet).getRegex(),aL.list=JF(aL.list).replace(/bull/g,aL.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+aL.def.source+")").getRegex(),aL._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",aL._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,aL.html=JF(aL.html,"i").replace("comment",aL._comment).replace("tag",aL._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),aL.lheading=JF(aL.lheading).replace(/bull/g,aL.bullet).getRegex(),aL.paragraph=JF(aL._paragraph).replace("hr",aL.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",aL._tag).getRegex(),aL.blockquote=JF(aL.blockquote).replace("paragraph",aL.paragraph).getRegex(),aL.normal={...aL},aL.gfm={...aL.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},aL.gfm.table=JF(aL.gfm.table).replace("hr",aL.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",aL._tag).getRegex(),aL.gfm.paragraph=JF(aL._paragraph).replace("hr",aL.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",aL.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",aL._tag).getRegex(),aL.pedantic={...aL.normal,html:JF("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",aL._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:tL,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:JF(aL.normal._paragraph).replace("hr",aL.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",aL.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const sL={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:tL,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:tL,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/,_punctuation:"\\p{P}$+<=>`^|~"};sL.punctuation=JF(sL.punctuation,"u").replace(/punctuation/g,sL._punctuation).getRegex(),sL.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,sL.anyPunctuation=/\\[punct]/g,sL._escapes=/\\([punct])/g,sL._comment=JF(aL._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),sL.emStrong.lDelim=JF(sL.emStrong.lDelim,"u").replace(/punct/g,sL._punctuation).getRegex(),sL.emStrong.rDelimAst=JF(sL.emStrong.rDelimAst,"gu").replace(/punct/g,sL._punctuation).getRegex(),sL.emStrong.rDelimUnd=JF(sL.emStrong.rDelimUnd,"gu").replace(/punct/g,sL._punctuation).getRegex(),sL.anyPunctuation=JF(sL.anyPunctuation,"gu").replace(/punct/g,sL._punctuation).getRegex(),sL._escapes=JF(sL._escapes,"gu").replace(/punct/g,sL._punctuation).getRegex(),sL._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,sL._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,sL.autolink=JF(sL.autolink).replace("scheme",sL._scheme).replace("email",sL._email).getRegex(),sL._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,sL.tag=JF(sL.tag).replace("comment",sL._comment).replace("attribute",sL._attribute).getRegex(),sL._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,sL._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,sL._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,sL.link=JF(sL.link).replace("label",sL._label).replace("href",sL._href).replace("title",sL._title).getRegex(),sL.reflink=JF(sL.reflink).replace("label",sL._label).replace("ref",aL._label).getRegex(),sL.nolink=JF(sL.nolink).replace("ref",aL._label).getRegex(),sL.reflinkSearch=JF(sL.reflinkSearch,"g").replace("reflink",sL.reflink).replace("nolink",sL.nolink).getRegex(),sL.normal={...sL},sL.pedantic={...sL.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:JF(/^!?\[(label)\]\((.*?)\)/).replace("label",sL._label).getRegex(),reflink:JF(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sL._label).getRegex()},sL.gfm={...sL.normal,escape:JF(sL.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},sL.gfm.url=JF(sL.gfm.url,"i").replace("email",sL.gfm._extended_email).getRegex(),sL.breaks={...sL.gfm,br:JF(sL.br).replace("{2,}","*").getRegex(),text:JF(sL.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class lL{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$F,this.options.tokenizer=this.options.tokenizer||new iL,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:aL.normal,inline:sL.normal};this.options.pedantic?(t.block=aL.pedantic,t.inline=sL.pedantic):this.options.gfm&&(t.block=aL.gfm,this.options.breaks?t.inline=sL.breaks:t.inline=sL.gfm),this.tokenizer.rules=t}static get rules(){return{block:aL,inline:sL}}static lex(e,t){return new lL(t).lex(e)}static lexInline(e,t){return new lL(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,r,o,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,(e,t,n)=>t+" ".repeat(n.length));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?t.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),r=t[t.length-1],!r||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(o=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o)))r=t[t.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),i=o.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,o,i,a,s,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,i.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(s=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&"text"===n.type&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,s))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(o=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(o))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(s=n.raw.slice(-1)),a=!0,r=t[t.length-1],r&&"text"===r.type?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class uL{options;constructor(e){this.options=e||$F}code(e,t,n){const r=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+YF(r)+'">'+(n?e:YF(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:YF(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const r=eL(e);if(null===r)return n;let o='<a href="'+(e=r)+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){const r=eL(e);if(null===r)return n;let o=`<img src="${e=r}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return e}}class cL{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class dL{options;renderer;textRenderer;constructor(e){this.options=e||$F,this.options.renderer=this.options.renderer||new uL,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new cL}static parse(e,t){return new dL(t).parse(e)}static parseInline(e,t){return new dL(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=o,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(o.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=o;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,XF(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=o;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=o;let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let i="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];r="";for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});i+=this.renderer.tablerow(r)}n+=this.renderer.table(t,i);continue}case"blockquote":{const e=o,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=o,t=e.ordered,r=e.start,i=e.loose;let a="";for(let t=0;t<e.items.length;t++){const n=e.items[t],r=n.checked,o=n.task;let s="";if(n.task){const e=this.renderer.checkbox(!!r);i?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):s+=e+" "}s+=this.parse(n.tokens,i),a+=this.renderer.listitem(s,o,!!r)}n+=this.renderer.list(a,t,r);continue}case"html":{const e=o;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=o;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=o,a=i.tokens?this.parseInline(i.tokens):i.text;for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],a+="\n"+(i.tokens?this.parseInline(i.tokens):i.text);n+=t?this.renderer.paragraph(a):a;continue}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=e||"";continue}}switch(o.type){case"escape":{const e=o;n+=t.text(e.text);break}case"html":{const e=o;n+=t.html(e.text);break}case"link":{const e=o;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=o;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=o;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=o;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=o;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=o;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=o;n+=t.text(e.text);break}default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class pL{options;constructor(e){this.options=e||$F}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}const fL=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(lL.lex,dL.parse);parseInline=this.#e(lL.lexInline,dL.parseInline);Parser=dL;parser=dL.parse;Renderer=uL;TextRenderer=cL;Lexer=lL;lexer=lL.lex;Tokenizer=iL;Hooks=pL;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{n=n.concat(this.walkTokens(e[r],t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){const t=this.defaults.renderer||new uL(this.defaults);for(const n in e.renderer){const r=e.renderer[n],o=n,i=t[o];t[o]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new iL(this.defaults);for(const n in e.tokenizer){const r=e.tokenizer[n],o=n,i=t[o];t[o]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new pL;for(const n in e.hooks){const r=e.hooks[n],o=n,i=t[o];pL.passThroughHooks.has(n)?t[o]=e=>{if(this.defaults.async)return Promise.resolve(r.call(t,e)).then(e=>i.call(t,e));const n=r.call(t,e);return i.call(t,n)}:t[o]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}#e(e,t){return(n,r)=>{const o={...r},i={...this.defaults,...o};!0===this.defaults.async&&!1===o.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const a=this.#t(!!i.silent,!!i.async);if(null==n)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(t=>e(t,i)).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>t(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));const r=e(n,i);i.walkTokens&&this.walkTokens(r,i.walkTokens);let o=t(r,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(e){return a(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+YF(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function hL(e,t){return fL.parse(e,t)}hL.options=hL.setOptions=function(e){return fL.setOptions(e),hL.defaults=fL.defaults,zF(hL.defaults),hL},hL.getDefaults=jF,hL.defaults=$F,hL.use=function(...e){return fL.use(...e),hL.defaults=fL.defaults,zF(hL.defaults),hL},hL.walkTokens=function(e,t){return fL.walkTokens(e,t)},hL.parseInline=fL.parseInline,hL.Parser=dL,hL.parser=dL.parse,hL.Renderer=uL,hL.TextRenderer=cL,hL.Lexer=lL,hL.lexer=lL.lex,hL.Tokenizer=iL,hL.Hooks=pL,hL.parse=hL,hL.options,hL.setOptions,hL.use,hL.walkTokens,hL.parseInline;var gL={exports:{}};
32
+ /*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */gL.exports=function(){const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:o}=Object;let{freeze:i,seal:a,create:s}=Object,{apply:l,construct:u}="undefined"!=typeof Reflect&&Reflect;i||(i=function(e){return e}),a||(a=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),u||(u=function(e,t){return new e(...t)});const c=E(Array.prototype.forEach),d=E(Array.prototype.pop),p=E(Array.prototype.push),f=E(String.prototype.toLowerCase),h=E(String.prototype.toString),g=E(String.prototype.match),m=E(String.prototype.replace),v=E(String.prototype.indexOf),y=E(String.prototype.trim),b=E(RegExp.prototype.test),w=_(TypeError);function E(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return l(e,t,r)}}function _(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return u(e,n)}}function x(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f;t&&t(e,null);let i=r.length;for(;i--;){let t=r[i];if("string"==typeof t){const e=o(t);e!==t&&(n(r)||(r[i]=e),t=e)}e[t]=!0}return e}function k(t){const n=s(null);for(const[r,i]of e(t))void 0!==o(t,r)&&(n[r]=i);return n}function C(e,t){for(;null!==e;){const n=o(e,t);if(n){if(n.get)return E(n.get);if("function"==typeof n.value)return E(n.value)}e=r(e)}function n(e){return console.warn("fallback value for",e),null}return n}const S=i(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),T=i(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),D=i(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),A=i(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),O=i(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P=i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),I=i(["#text"]),N=i(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),R=i(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),B=i(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),L=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),M=a(/<%[\w\W]*|[\w\W]*%>/gm),U=a(/\${[\w\W]*}/gm),j=a(/^data-[\-\w.\u00B7-\uFFFF]/),$=a(/^aria-[\-\w]+$/),z=a(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),H=a(/^(?:\w+script|data):/i),V=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W=a(/^html$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:L,ERB_EXPR:M,TMPLIT_EXPR:U,DATA_ATTR:j,ARIA_ATTR:$,IS_ALLOWED_URI:z,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:V,DOCTYPE_NAME:W});const G=function(){return"undefined"==typeof window?null:window},K=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function Y(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G();const n=e=>Y(e);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const o=r,a=o.currentScript,{DocumentFragment:l,HTMLTemplateElement:u,Node:E,Element:_,NodeFilter:L,NamedNodeMap:M=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:U,DOMParser:j,trustedTypes:$}=t,H=_.prototype,V=C(H,"cloneNode"),Z=C(H,"nextSibling"),X=C(H,"childNodes"),Q=C(H,"parentNode");if("function"==typeof u){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let J,ee="";const{implementation:te,createNodeIterator:ne,createDocumentFragment:re,getElementsByTagName:oe}=r,{importNode:ie}=o;let ae={};n.isSupported="function"==typeof e&&"function"==typeof Q&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:se,ERB_EXPR:le,TMPLIT_EXPR:ue,DATA_ATTR:ce,ARIA_ATTR:de,IS_SCRIPT_OR_DATA:pe,ATTR_WHITESPACE:fe}=q;let{IS_ALLOWED_URI:he}=q,ge=null;const me=x({},[...S,...T,...D,...O,...I]);let ve=null;const ye=x({},[...N,...R,...B,...F]);let be=Object.seal(s(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,Ee=null,_e=!0,xe=!0,ke=!1,Ce=!0,Se=!1,Te=!1,De=!1,Ae=!1,Oe=!1,Pe=!1,Ie=!1,Ne=!0,Re=!1;const Be="user-content-";let Fe=!0,Le=!1,Me={},Ue=null;const je=x({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $e=null;const ze=x({},["audio","video","img","source","image","track"]);let He=null;const Ve=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml";let Ke=Ge,Ye=!1,Ze=null;const Xe=x({},[We,qe,Ge],h);let Qe=null;const Je=["application/xhtml+xml","text/html"],et="text/html";let tt=null,nt=null;const rt=r.createElement("form"),ot=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!nt||nt!==e){if(e&&"object"==typeof e||(e={}),e=k(e),Qe=Qe=-1===Je.indexOf(e.PARSER_MEDIA_TYPE)?et:e.PARSER_MEDIA_TYPE,tt="application/xhtml+xml"===Qe?h:f,ge="ALLOWED_TAGS"in e?x({},e.ALLOWED_TAGS,tt):me,ve="ALLOWED_ATTR"in e?x({},e.ALLOWED_ATTR,tt):ye,Ze="ALLOWED_NAMESPACES"in e?x({},e.ALLOWED_NAMESPACES,h):Xe,He="ADD_URI_SAFE_ATTR"in e?x(k(Ve),e.ADD_URI_SAFE_ATTR,tt):Ve,$e="ADD_DATA_URI_TAGS"in e?x(k(ze),e.ADD_DATA_URI_TAGS,tt):ze,Ue="FORBID_CONTENTS"in e?x({},e.FORBID_CONTENTS,tt):je,we="FORBID_TAGS"in e?x({},e.FORBID_TAGS,tt):{},Ee="FORBID_ATTR"in e?x({},e.FORBID_ATTR,tt):{},Me="USE_PROFILES"in e&&e.USE_PROFILES,_e=!1!==e.ALLOW_ARIA_ATTR,xe=!1!==e.ALLOW_DATA_ATTR,ke=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Se=e.SAFE_FOR_TEMPLATES||!1,Te=e.WHOLE_DOCUMENT||!1,Oe=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,Ae=e.FORCE_BODY||!1,Ne=!1!==e.SANITIZE_DOM,Re=e.SANITIZE_NAMED_PROPS||!1,Fe=!1!==e.KEEP_CONTENT,Le=e.IN_PLACE||!1,he=e.ALLOWED_URI_REGEXP||z,Ke=e.NAMESPACE||Ge,be=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(be.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ot(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(be.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(be.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Se&&(xe=!1),Pe&&(Oe=!0),Me&&(ge=x({},[...I]),ve=[],!0===Me.html&&(x(ge,S),x(ve,N)),!0===Me.svg&&(x(ge,T),x(ve,R),x(ve,F)),!0===Me.svgFilters&&(x(ge,D),x(ve,R),x(ve,F)),!0===Me.mathMl&&(x(ge,O),x(ve,B),x(ve,F))),e.ADD_TAGS&&(ge===me&&(ge=k(ge)),x(ge,e.ADD_TAGS,tt)),e.ADD_ATTR&&(ve===ye&&(ve=k(ve)),x(ve,e.ADD_ATTR,tt)),e.ADD_URI_SAFE_ATTR&&x(He,e.ADD_URI_SAFE_ATTR,tt),e.FORBID_CONTENTS&&(Ue===je&&(Ue=k(Ue)),x(Ue,e.FORBID_CONTENTS,tt)),Fe&&(ge["#text"]=!0),Te&&x(ge,["html","head","body"]),ge.table&&(x(ge,["tbody"]),delete we.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw w('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');J=e.TRUSTED_TYPES_POLICY,ee=J.createHTML("")}else void 0===J&&(J=K($,a)),null!==J&&"string"==typeof ee&&(ee=J.createHTML(""));i&&i(e),nt=e}},at=x({},["mi","mo","mn","ms","mtext"]),st=x({},["foreignobject","desc","title","annotation-xml"]),lt=x({},["title","style","font","a","script"]),ut=x({},T);x(ut,D),x(ut,A);const ct=x({},O);x(ct,P);const dt=function(e){let t=Q(e);t&&t.tagName||(t={namespaceURI:Ke,tagName:"template"});const n=f(e.tagName),r=f(t.tagName);return!!Ze[e.namespaceURI]&&(e.namespaceURI===qe?t.namespaceURI===Ge?"svg"===n:t.namespaceURI===We?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(ut[n]):e.namespaceURI===We?t.namespaceURI===Ge?"math"===n:t.namespaceURI===qe?"math"===n&&st[r]:Boolean(ct[n]):e.namespaceURI===Ge?!(t.namespaceURI===qe&&!st[r])&&!(t.namespaceURI===We&&!at[r])&&!ct[n]&&(lt[n]||!ut[n]):!("application/xhtml+xml"!==Qe||!Ze[e.namespaceURI]))},pt=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},ft=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!ve[e])if(Oe||Pe)try{pt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ht=function(e){let t=null,n=null;if(Ae)e="<remove></remove>"+e;else{const t=g(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Qe&&Ke===Ge&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=J?J.createHTML(e):e;if(Ke===Ge)try{t=(new j).parseFromString(o,Qe)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Ke,"template",null);try{t.documentElement.innerHTML=Ye?ee:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Ke===Ge?oe.call(t,Te?"html":"body")[0]:Te?t.documentElement:i},gt=function(e){return ne.call(e.ownerDocument||e,e,L.SHOW_ELEMENT|L.SHOW_COMMENT|L.SHOW_TEXT,null)},mt=function(e){return e instanceof U&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof M)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof E&&e instanceof E},yt=function(e,t,r){ae[e]&&c(ae[e],e=>{e.call(n,t,r,nt)})},bt=function(e){let t=null;if(yt("beforeSanitizeElements",e,null),mt(e))return pt(e),!0;const r=tt(e.nodeName);if(yt("uponSanitizeElement",e,{tagName:r,allowedTags:ge}),e.hasChildNodes()&&!vt(e.firstElementChild)&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return pt(e),!0;if(!ge[r]||we[r]){if(!we[r]&&Et(r)){if(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,r))return!1;if(be.tagNameCheck instanceof Function&&be.tagNameCheck(r))return!1}if(Fe&&!Ue[r]){const t=Q(e)||e.parentNode,n=X(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r)t.insertBefore(V(n[r],!0),Z(e))}return pt(e),!0}return e instanceof _&&!dt(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Se&&3===e.nodeType&&(t=e.textContent,c([se,le,ue],e=>{t=m(t,e," ")}),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),yt("afterSanitizeElements",e,null),!1):(pt(e),!0)},wt=function(e,t,n){if(Ne&&("id"===t||"name"===t)&&(n in r||n in rt))return!1;if(xe&&!Ee[t]&&b(ce,t));else if(_e&&b(de,t));else if(!ve[t]||Ee[t]){if(!(Et(e)&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,e)||be.tagNameCheck instanceof Function&&be.tagNameCheck(e))&&(be.attributeNameCheck instanceof RegExp&&b(be.attributeNameCheck,t)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(t))||"is"===t&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&b(be.tagNameCheck,n)||be.tagNameCheck instanceof Function&&be.tagNameCheck(n))))return!1}else if(He[t]);else if(b(he,m(n,fe,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!$e[e])if(ke&&!b(pe,m(n,fe,"")));else if(n)return!1;return!0},Et=function(e){return e.indexOf("-")>0},_t=function(e){yt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ve};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:l}=i,u=tt(a);let p="value"===a?l:y(l);if(r.attrName=u,r.attrValue=p,r.keepAttr=!0,r.forceKeepAttr=void 0,yt("uponSanitizeAttribute",e,r),p=r.attrValue,r.forceKeepAttr)continue;if(ft(a,e),!r.keepAttr)continue;if(!Ce&&b(/\/>/i,p)){ft(a,e);continue}Se&&c([se,le,ue],e=>{p=m(p,e," ")});const f=tt(e.nodeName);if(wt(f,u,p)){if(!Re||"id"!==u&&"name"!==u||(ft(a,e),p=Be+p),J&&"object"==typeof $&&"function"==typeof $.getAttributeType)if(s);else switch($.getAttributeType(f,u)){case"TrustedHTML":p=J.createHTML(p);break;case"TrustedScriptURL":p=J.createScriptURL(p)}try{s?e.setAttributeNS(s,a,p):e.setAttribute(a,p),d(n.removed)}catch(e){}}}yt("afterSanitizeAttributes",e,null)},xt=function e(t){let n=null;const r=gt(t);for(yt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)yt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof l&&e(n.content),_t(n));yt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,s=null;if(Ye=!e,Ye&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw w("toString is not a function");if("string"!=typeof(e=e.toString()))throw w("dirty is not a string, aborting")}if(!n.isSupported)return e;if(De||it(t),n.removed=[],"string"==typeof e&&(Le=!1),Le){if(e.nodeName){const t=tt(e.nodeName);if(!ge[t]||we[t])throw w("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof E)r=ht("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!Oe&&!Se&&!Te&&-1===e.indexOf("<"))return J&&Ie?J.createHTML(e):e;if(r=ht(e),!r)return Oe?null:Ie?ee:""}r&&Ae&&pt(r.firstChild);const u=gt(Le?e:r);for(;a=u.nextNode();)bt(a)||(a.content instanceof l&&xt(a.content),_t(a));if(Le)return e;if(Oe){if(Pe)for(s=re.call(r.ownerDocument);r.firstChild;)s.appendChild(r.firstChild);else s=r;return(ve.shadowroot||ve.shadowrootmode)&&(s=ie.call(o,s,!0)),s}let d=Te?r.outerHTML:r.innerHTML;return Te&&ge["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&b(W,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Se&&c([se,le,ue],e=>{d=m(d,e," ")}),J&&Ie?J.createHTML(d):d},n.setConfig=function(){it(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),De=!0},n.clearConfig=function(){nt=null,De=!1},n.isValidAttribute=function(e,t,n){nt||it({});const r=tt(e),o=tt(t);return wt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(ae[e]=ae[e]||[],p(ae[e],t))},n.removeHook=function(e){if(ae[e])return d(ae[e])},n.removeHooks=function(e){ae[e]&&(ae[e]=[])},n.removeAllHooks=function(){ae={}},n}var Z=Y();return Z}();var mL=Bn(gL.exports);hL.use({renderer:{link:(e,t,n)=>`<a href="${e}" target="_blank" rel="noopener noreferrer">${n}</a>`},gfm:!0});const vL=e=>e.map(e=>e.text??vL(e.children)).join("");function yL(e,t){return"html"===(t?.format??"richText")?((e,t)=>{if(!e)return"";const{enableCodeBlocksMode:n}=t??{};if(!n){const t=hL.parse(e,{breaks:!0}).replace(/&lt;u&gt;/g,"<u>").replace(/&lt;\/u&gt;/g,"</u>");return mL.sanitize(t,{ADD_ATTR:["target"]})}const r=e.split("```").map((e,t)=>{if(t%2==0)return e.split("\n\n").map(e=>{const t=hL.parse(e.replace(/【.+】/g,""),{breaks:!0}).replace(/&lt;u&gt;/g,"<u>").replace(/&lt;\/u&gt;/g,"</u>");return mL.sanitize(t,{ADD_ATTR:["target"]})}).join("");const n=hL.parse("```"+e+"```",{breaks:!0}).replace(/&lt;u&gt;/g,"<u>").replace(/&lt;\/u&gt;/g,"</u>");return mL.sanitize(n,{ADD_ATTR:["target"]})}).join("");return r})(e,{enableCodeBlocksMode:t?.enableCodeBlocksMode??!1}):(e=>{const t=[UF()],n=NO({plugins:t}),{elementRules:r,textRules:o,indentList:i}=BO(n,MF);return ER().use(rR).use(zR,{editor:n,elementRules:r,textRules:o,indentList:i}).processSync(e).result})(e)}const bL=ui.enum(["true","false"]).transform(e=>"true"===e),wL={TEST_ENV:bL.optional().default("false"),NODE_ENV:ui.enum(["development","staging","production"]).optional(),DATABASE_URL:ui.string().url().refine(e=>e.startsWith("postgres")),ENCRYPTION_SECRET:ui.string().length(32),NEXTAUTH_URL:ui.preprocess(e=>{if(e&&"string"==typeof e&&e.length>0||"preview"!==process.env.VERCEL_ENV||!process.env.VERCEL_BUILDER_PROJECT_NAME||!process.env.NEXT_PUBLIC_VERCEL_VIEWER_PROJECT_NAME)return e;return process.env.VERCEL_BRANCH_URL.includes(process.env.VERCEL_BUILDER_PROJECT_NAME)?`https://${process.env.VERCEL_BRANCH_URL}`:`https://${process.env.VERCEL_BRANCH_URL}`.replace(process.env.NEXT_PUBLIC_VERCEL_VIEWER_PROJECT_NAME,process.env.VERCEL_BUILDER_PROJECT_NAME)},ui.string().url()),DISABLE_SIGNUP:bL.optional().default("false"),ADMIN_EMAIL:ui.string().min(1).optional().transform(e=>e?.split(",")),DEFAULT_WORKSPACE_PLAN:ui.enum(["FREE","PERSONAL","BUSINESS","ENTERPRISE","UNLIMITED"]).refine(e=>["FREE","PERSONAL","BUSINESS","ENTERPRISE","UNLIMITED"].includes(e)).default("FREE"),DEBUG:bL.optional().default("false"),CHAT_API_TIMEOUT:ui.coerce.number().optional(),RADAR_HIGH_RISK_KEYWORDS:ui.string().min(1).transform(e=>e.split(",")).optional(),RADAR_INTERMEDIATE_RISK_KEYWORDS:ui.string().min(1).transform(e=>e.split(",")).optional(),RADAR_CUMULATIVE_KEYWORDS:ui.string().min(1).transform(e=>e.split("/").map(e=>e.split(",").map(e=>e.split("|")))).optional(),INVITATION_TTL_DAYS:ui.coerce.number().optional().default(7)},EL={NEXT_PUBLIC_VIEWER_URL:ui.preprocess(e=>{if(e&&"string"==typeof e&&e.length>0||"preview"!==process.env.VERCEL_ENV||!process.env.VERCEL_BUILDER_PROJECT_NAME||!process.env.NEXT_PUBLIC_VERCEL_VIEWER_PROJECT_NAME)return e;return process.env.VERCEL_BRANCH_URL.includes(process.env.NEXT_PUBLIC_VERCEL_VIEWER_PROJECT_NAME)?`https://${process.env.VERCEL_BRANCH_URL}`:`https://${process.env.VERCEL_BRANCH_URL}`.replace(process.env.VERCEL_BUILDER_PROJECT_NAME,process.env.NEXT_PUBLIC_VERCEL_VIEWER_PROJECT_NAME)},ui.string().min(1).transform(e=>e.split(","))),NEXT_PUBLIC_ONBOARDING_BOT_ID:ui.string().min(1).optional(),NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE:ui.coerce.number().optional(),NEXT_PUBLIC_CHAT_API_URL:ui.string().url().optional(),NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON:ui.string().min(1).transform(e=>e.split("/").map(e=>e.split(",").map(e=>e.split("|")))).optional(),NEXT_PUBLIC_VIEWER_404_TITLE:ui.string().optional().default("404"),NEXT_PUBLIC_VIEWER_404_SUBTITLE:ui.string().optional().default("The bot you're looking for doesn't exist"),NEXT_PUBLIC_SUPPORT_BOT:ui.string().min(1).optional(),NEXT_PUBLIC_BETA_ENV:bL.optional().default("true")},_L={NEXT_PUBLIC_VIEWER_URL:Ct("NEXT_PUBLIC_VIEWER_URL"),NEXT_PUBLIC_ONBOARDING_BOT_ID:Ct("NEXT_PUBLIC_ONBOARDING_BOT_ID"),NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE:Ct("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE"),NEXT_PUBLIC_CHAT_API_URL:Ct("NEXT_PUBLIC_CHAT_API_URL"),NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON:Ct("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON"),NEXT_PUBLIC_VIEWER_404_TITLE:Ct("NEXT_PUBLIC_VIEWER_404_TITLE"),NEXT_PUBLIC_VIEWER_404_SUBTITLE:Ct("NEXT_PUBLIC_VIEWER_404_SUBTITLE"),NEXT_PUBLIC_SUPPORT_BOT:Ct("NEXT_PUBLIC_SUPPORT_BOT"),NEXT_PUBLIC_BETA_ENV:Ct("NEXT_PUBLIC_BETA_ENV")},xL={GITHUB_CLIENT_ID:ui.string().min(1).optional(),GITHUB_CLIENT_SECRET:ui.string().min(1).optional()},kL={FACEBOOK_CLIENT_ID:ui.string().min(1).optional(),FACEBOOK_CLIENT_SECRET:ui.string().min(1).optional()},CL={SMTP_USERNAME:ui.string().min(1).optional(),SMTP_PASSWORD:ui.string().min(1).optional(),SMTP_HOST:ui.string().min(1).optional(),SMTP_PORT:ui.coerce.number().optional().default(25),SMTP_AUTH_DISABLED:bL.optional().default("false"),SMTP_SECURE:bL.optional().default("false")},SL={NEXT_PUBLIC_SMTP_FROM:ui.string().min(1).optional()},TL={NEXT_PUBLIC_SMTP_FROM:Ct("NEXT_PUBLIC_SMTP_FROM")},DL={GITLAB_CLIENT_ID:ui.string().min(1).optional(),GITLAB_CLIENT_SECRET:ui.string().min(1).optional(),GITLAB_BASE_URL:ui.string().url().optional().default("https://gitlab.com"),GITLAB_NAME:ui.string().min(1).optional().default("GitLab"),GITLAB_REQUIRED_GROUPS:ui.string().transform(e=>e?e.split(","):void 0).optional()},AL={AZURE_AD_CLIENT_ID:ui.string().min(1).optional(),AZURE_AD_CLIENT_SECRET:ui.string().min(1).optional(),AZURE_AD_TENANT_ID:ui.string().min(1).optional()},OL={CUSTOM_OAUTH_NAME:ui.string().min(1).optional().default("Custom OAuth"),CUSTOM_OAUTH_SCOPE:ui.string().min(1).optional().default("openid profile email"),CUSTOM_OAUTH_CLIENT_ID:ui.string().min(1).optional(),CUSTOM_OAUTH_CLIENT_SECRET:ui.string().min(1).optional(),CUSTOM_OAUTH_WELL_KNOWN_URL:ui.string().url().optional(),CUSTOM_OAUTH_USER_ID_PATH:ui.string().min(1).optional().default("id"),CUSTOM_OAUTH_USER_EMAIL_PATH:ui.string().min(1).optional().default("email"),CUSTOM_OAUTH_USER_NAME_PATH:ui.string().min(1).optional().default("name"),CUSTOM_OAUTH_USER_IMAGE_PATH:ui.string().min(1).optional().default("image")},PL={GOOGLE_CLIENT_ID:ui.string().min(1).optional(),GOOGLE_CLIENT_SECRET:ui.string().min(1).optional(),PLAYWRIGHT_GOOGLE_ACCESS_TOKEN:ui.string().min(1).optional(),PLAYWRIGHT_GOOGLE_REFRESH_TOKEN:ui.string().min(1).optional()},IL={NEXT_PUBLIC_GOOGLE_API_KEY:ui.string().min(1).optional()},NL={NEXT_PUBLIC_GOOGLE_API_KEY:Ct("NEXT_PUBLIC_GOOGLE_API_KEY")},RL={PLAYWRIGHT_STRIPE_PERSONAL_CUSTOMER_ID:ui.string().min(1).optional(),PLAYWRIGHT_STRIPE_BUSINESS_CUSTOMER_ID:ui.string().min(1).optional(),PLAYWRIGHT_STRIPE_ENTERPRISE_CUSTOMER_ID:ui.string().min(1).optional()},BL={},FL={},LL={STRIPE_SECRET_KEY:ui.string().min(1).optional(),STRIPE_WEBHOOK_SECRET:ui.string().min(1).optional(),STRIPE_PERSONAL_PRICE_ID:ui.string().min(1).optional(),STRIPE_PERSONAL_CHATS_PRICE_ID:ui.string().min(1).optional(),STRIPE_BUSINESS_PRICE_ID:ui.string().min(1).optional(),STRIPE_BUSINESS_CHATS_PRICE_ID:ui.string().min(1).optional(),STRIPE_ENTERPRISE_PRICE_ID:ui.string().min(1).optional(),STRIPE_ENTERPRISE_CHATS_PRICE_ID:ui.string().min(1).optional(),STRIPE_BILLING_ADDRESS_COLLECTION:ui.enum(["auto","required"]).default("auto"),STRIPE_AUTOMATIC_TAXES:bL.optional().default("false")},ML={NEXT_PUBLIC_STRIPE_PUBLIC_KEY:ui.string().min(1).optional()},UL={NEXT_PUBLIC_STRIPE_PUBLIC_KEY:Ct("NEXT_PUBLIC_STRIPE_PUBLIC_KEY")},jL={S3_ACCESS_KEY:ui.string().min(1).optional(),S3_SECRET_KEY:ui.string().min(1).optional(),S3_BUCKET:ui.string().min(1).optional().default("bot"),S3_PORT:ui.coerce.number().optional(),S3_ENDPOINT:ui.string().min(1).optional(),S3_SSL:bL.optional().default("true"),S3_REGION:ui.string().min(1).optional(),S3_PUBLIC_CUSTOM_DOMAIN:ui.string().url().optional()},$L={NEXT_PUBLIC_GIPHY_API_KEY:ui.string().min(1).optional()},zL={NEXT_PUBLIC_GIPHY_API_KEY:Ct("NEXT_PUBLIC_GIPHY_API_KEY")},HL={VERCEL_TOKEN:ui.string().min(1).optional(),VERCEL_TEAM_ID:ui.string().min(1).optional(),VERCEL_GIT_COMMIT_SHA:ui.string().min(1).optional(),VERCEL_BUILDER_PROJECT_NAME:ui.string().min(1).optional(),VERCEL_LANDING_PROJECT_NAME:ui.string().min(1).optional()},VL={NEXT_PUBLIC_VERCEL_VIEWER_PROJECT_NAME:ui.string().min(1).optional(),NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA:ui.string().min(1).optional(),NEXT_PUBLIC_VERCEL_ENV:ui.string().min(1).optional()},WL={NEXT_PUBLIC_VERCEL_VIEWER_PROJECT_NAME:Ct("NEXT_PUBLIC_VERCEL_VIEWER_PROJECT_NAME"),NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA:Ct("NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA"),NEXT_PUBLIC_VERCEL_ENV:Ct("NEXT_PUBLIC_VERCEL_ENV")},qL={SLEEKPLAN_SSO_KEY:ui.string().min(1).optional()},GL={NEXT_PUBLIC_UNSPLASH_APP_NAME:ui.string().min(1).optional(),NEXT_PUBLIC_UNSPLASH_ACCESS_KEY:ui.string().min(1).optional()},KL={NEXT_PUBLIC_UNSPLASH_APP_NAME:Ct("NEXT_PUBLIC_UNSPLASH_APP_NAME"),NEXT_PUBLIC_UNSPLASH_ACCESS_KEY:Ct("NEXT_PUBLIC_UNSPLASH_ACCESS_KEY")},YL={NEXT_PUBLIC_PEXELS_API_KEY:ui.string().min(1).optional()},ZL={NEXT_PUBLIC_PEXELS_API_KEY:Ct("NEXT_PUBLIC_PEXELS_API_KEY")},XL={META_SYSTEM_USER_TOKEN:ui.string().min(1).optional(),WHATSAPP_PREVIEW_FROM_PHONE_NUMBER_ID:ui.string().min(1).optional(),WHATSAPP_PREVIEW_TEMPLATE_NAME:ui.string().min(1).optional(),WHATSAPP_PREVIEW_TEMPLATE_LANG:ui.string().min(1).optional().default("en_US"),WHATSAPP_CLOUD_API_URL:ui.string().url().optional().default("https://graph.facebook.com"),WHATSAPP_INTERACTIVE_GROUP_SIZE:ui.coerce.number().optional().default(3),WHATSAPP_MESSAGE_MAX_AGE_MS:ui.coerce.number().optional().default(864e5)},QL={REDIS_URL:ui.string().url().optional()},JL={NEXT_PUBLIC_SENTRY_DSN:ui.string().min(1).optional(),NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE:ui.coerce.number().optional().default(.1)},eM={SENTRY_AUTH_TOKEN:ui.string().min(1).optional(),SENTRY_PROJECT:ui.string().min(1).optional(),SENTRY_ORG:ui.string().min(1).optional()},tM={NEXT_PUBLIC_SENTRY_DSN:Ct("NEXT_PUBLIC_SENTRY_DSN"),NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE:Ct("NEXT_PUBLIC_SENTRY_TRACES_SAMPLE_RATE")},nM={NEXT_PUBLIC_POSTHOG_KEY:ui.string().min(1).optional(),NEXT_PUBLIC_POSTHOG_HOST:ui.string().min(1).optional().default("https://us.i.posthog.com")},rM={NEXT_PUBLIC_POSTHOG_KEY:Ct("NEXT_PUBLIC_POSTHOG_KEY"),NEXT_PUBLIC_POSTHOG_HOST:Ct("NEXT_PUBLIC_POSTHOG_HOST")},oM={NEXT_PUBLIC_TOLGEE_API_KEY:ui.string().min(1).optional(),NEXT_PUBLIC_TOLGEE_API_URL:ui.string().url().optional().default("https://tolgee.server.urbiport.com")},iM={NEXT_PUBLIC_TOLGEE_API_KEY:Ct("NEXT_PUBLIC_TOLGEE_API_KEY"),NEXT_PUBLIC_TOLGEE_API_URL:Ct("NEXT_PUBLIC_TOLGEE_API_URL","https://tolgee.server.urbiport.com")},aM=function(e){const t="object"==typeof e.client?e.client:{},n="object"==typeof e.server?e.server:{},r=e.shared,o=e.runtimeEnv?e.runtimeEnv:{...process.env,...e.experimental__runtimeEnv};return function(e){const t=e.runtimeEnvStrict??e.runtimeEnv??process.env;if(e.emptyStringAsUndefined)for(const[e,n]of Object.entries(t))""===n&&delete t[e];if(e.skipValidation)return t;const n="object"==typeof e.client?e.client:{},r="object"==typeof e.server?e.server:{},o="object"==typeof e.shared?e.shared:{},i=ui.object(n),a=ui.object(r),s=ui.object(o),l=e.isServer??"undefined"==typeof window,u=i.merge(s),c=a.merge(s).merge(i),d=l?c.safeParse(t):u.safeParse(t),p=e.onValidationError??(e=>{throw console.error("❌ Invalid environment variables:",e.flatten().fieldErrors),new Error("Invalid environment variables")}),f=e.onInvalidAccess??(e=>{throw new Error("❌ Attempted to access a server-side environment variable on the client")});if(!1===d.success)return p(d.error);const h=new Proxy(d.data,{get(t,n){if("string"==typeof n&&"__esModule"!==n&&"$$typeof"!==n)return l||!e.clientPrefix||n.startsWith(e.clientPrefix)||void 0!==s.shape[n]?t[n]:f(n)}});return h}({...e,shared:r,client:t,server:n,clientPrefix:"NEXT_PUBLIC_",runtimeEnv:o})}({server:{...wL,...xL,...kL,...CL,...PL,...RL,...LL,...jL,...HL,...qL,...XL,...QL,...DL,...AL,...OL,...eM,...{KEYCLOAK_CLIENT_ID:ui.string().min(1).optional(),KEYCLOAK_CLIENT_SECRET:ui.string().min(1).optional(),KEYCLOAK_REALM:ui.string().min(1).optional(),KEYCLOAK_BASE_URL:ui.string().url().optional()},...{EMAIL_HOST:ui.string().optional(),EMAIL_PORT:ui.string().optional(),EMAIL_SECURE:bL.optional().default("false"),EMAIL_USER:ui.string().optional(),EMAIL_PASSWORD:ui.string().optional(),EMAIL_FROM:ui.string().optional()},...{CREDENTIALS_AUTH:bL.optional().default("false")}},client:{...EL,...SL,...IL,...BL,...ML,...$L,...VL,...GL,...YL,...JL,...nM,...oM},experimental__runtimeEnv:{..._L,...TL,...NL,...FL,...UL,...zL,...WL,...KL,...ZL,...tM,...rM,...iM},skipValidation:"true"===process.env.SKIP_ENV_CHECK||"undefined"!=typeof window&&void 0===window.__ENV,onValidationError(e){throw console.error("❌ Invalid environment variables:",e.flatten().fieldErrors),new Error(`Invalid environment variables: ${JSON.stringify(e.flatten().fieldErrors)}`)},onInvalidAccess:e=>{throw new Error(`❌ Attempted to access a server-side environment variable on the client: ${e}`)}});"undefined"==typeof window&&aM.ENCRYPTION_SECRET;const sM=De('<div><div class="flex w-full items-center"><div class="flex items-start max-w-full"><div data-testid="host-bubble">'),lM=De('<div class="animate-fade-in">');let uM;const cM=e=>{let t;const[n,r]=O(!!e.onTransitionEnd),o=()=>{n()&&(r(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},400))};return B(()=>{if(!n)return;const t=e.content?.richText?(r=e.content.richText,vL(r)):"";var r;const i=!1===e.typingEmulation?.enabled||e.isTypingSkipped?0:(({bubbleContent:e,typingSettings:t})=>{let n=e.match(/(\w+)/g)?.length??0;0===n&&(n=e.length);const{enabled:r,speed:o,maxDelay:i}={enabled:t?.enabled??un.enabled,speed:t?.speed??un.speed,maxDelay:t?.maxDelay??un.maxDelay};let a=r?n/o*6e4:0;return a>1e3*i&&(a=1e3*i),a})({bubbleContent:t,typingSettings:e.typingEmulation});uM=setTimeout(o,i)}),F(()=>{uM&&clearTimeout(uM)}),(()=>{const r=sM(),o=r.firstChild.firstChild.firstChild;return"function"==typeof t?Re(t,r):t=r,Be(o,(()=>{const t=N(()=>!!n());return()=>t()?ie(Wi,{}):ie(ye,{get children(){return[ie(be,{get when(){return Array.isArray(e.content?.richText)&&(e.content?.richText?.length??0)>0},get children(){return ie(ge,{get each(){return e.content?.richText},children:e=>(()=>{const t=lM();return Be(t,ie(_a,{element:e})),t})()})}}),ie(be,{get when(){return e.content?.markdown},children:e=>(()=>{const t=lM();return P(()=>t.innerHTML=yL(e(),{format:"html",enableCodeBlocksMode:!0})),t})()})]}})})()),P(t=>{const i=it("flex flex-col",e.onTransitionEnd?"animate-fade-in":void 0),a=it("bubble bubble--host relative transition-all duration-300",n()?"bubble--typing":"text-ellipsis whitespace-pre-wrap slate-html-container overflow-auto");return i!==t._v$&&Pe(r,t._v$=i),a!==t._v$2&&Pe(o,t._v$2=a),t},{_v$:void 0,_v$2:void 0}),r})()};let dM=function(e){return e.URL="url",e.YOUTUBE="youtube",e.VIMEO="vimeo",e.TIKTOK="tiktok",e.GUMLET="gumlet",e}({});const pM=[dM.YOUTUBE,dM.VIMEO,dM.TIKTOK,dM.GUMLET],fM=400,hM="100%",gM=!0,mM=!0,vM={[dM.VIMEO]:"https://player.vimeo.com/video",[dM.YOUTUBE]:"https://www.youtube.com/embed",[dM.TIKTOK]:"https://www.tiktok.com/embed/v2",[dM.GUMLET]:"https://play.gumlet.io/embed"},yM=De('<div><div class="flex w-full items-center"><div class="flex z-10 items-start overflow-hidden w-full max-w-full"><div>'),bM=De('<div class="focus:outline-none w-full animate-fade-in"><video class="w-full rounded-md">'),wM=De('<div class="z-10 w-full animate-fade-in"><iframe class="w-full h-full rounded-md" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>');let EM;const _M=e=>{let t;const[n,r]=O(!!e.onTransitionEnd);return B(()=>{const o=e.content?.type&&pM.includes(e.content?.type)?2e3:100;EM=setTimeout(()=>{n()&&(r(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},400))},o)}),F(()=>{EM&&clearTimeout(EM)}),(()=>{const r=yM(),o=r.firstChild.firstChild.firstChild;return"function"==typeof t?Re(t,r):t=r,Be(o,(()=>{const t=N(()=>!!n());return()=>t()?ie(Wi,{}):ie(ye,{get children(){return[ie(be,{get when(){return e.content?.type&&e.content.type===dM.URL},get children(){const t=bM(),n=t.firstChild;return P(t=>{const r=!!e.onTransitionEnd&&(e.content?.isAutoplayEnabled??mM),o=e.content?.url,i=e.content?.areControlsDisplayed??gM,a=e.content?.aspectRatio;return r!==t._v$4&&(n.autoplay=t._v$4=r),o!==t._v$5&&Oe(n,"src",t._v$5=o),i!==t._v$6&&(n.controls=t._v$6=i),a!==t._v$7&&(null!=(t._v$7=a)?n.style.setProperty("aspect-ratio",a):n.style.removeProperty("aspect-ratio")),t},{_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0}),t}}),ie(be,{get when(){return N(()=>!!e.content?.type)()&&pM.includes(e.content.type)},get children(){const t=wM(),n=t.firstChild;return P(r=>{const o=e.content?.aspectRatio?void 0:`${e.content?.height??fM}px`,i=e.content?.aspectRatio,a=`${vM[e.content?.type]}/${e.content?.id??""}${e.content?.queryParamsStr??""}`;return o!==r._v$8&&(null!=(r._v$8=o)?t.style.setProperty("height",o):t.style.removeProperty("height")),i!==r._v$9&&(null!=(r._v$9=i)?t.style.setProperty("aspect-ratio",i):t.style.removeProperty("aspect-ratio")),a!==r._v$0&&Oe(n,"src",r._v$0=a),r},{_v$8:void 0,_v$9:void 0,_v$0:void 0}),t}})]}})})()),P(t=>{const i=it("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),a=it("bubble bubble--host relative transition-all duration-300",n()&&"bubble--typing"),s=n()?e.content?.maxWidth??hM:void 0;return i!==t._v$&&Pe(r,t._v$=i),a!==t._v$2&&Pe(o,t._v$2=a),s!==t._v$3&&(null!=(t._v$3=s)?o.style.setProperty("max-width",s):o.style.removeProperty("max-width")),t},{_v$:void 0,_v$2:void 0,_v$3:void 0}),r})()};let xM=function(e){return e.TEXT="text",e.IMAGE="image",e.VIDEO="video",e.EMBED="embed",e.AUDIO="audio",e}({});const kM=e=>ie(ye,{get children(){return[ie(be,{get when(){return e.message.type===xM.TEXT},get children(){return ie(cM,{get content(){return e.message.content},get isTypingSkipped(){return e.isTypingSkipped},get typingEmulation(){return e.typingEmulation},get onTransitionEnd(){return e.onTransitionEnd}})}}),ie(be,{get when(){return e.message.type===xM.IMAGE},get children(){return ie(pa,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),ie(be,{get when(){return e.message.type===xM.VIDEO},get children(){return ie(_M,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}}),ie(be,{get when(){return e.message.type===xM.EMBED},get children(){return ie(oa,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd},get onCompleted(){return e.onCompleted}})}}),ie(be,{get when(){return e.message.type===xM.AUDIO},get children(){return ie(Zi,{get content(){return e.message.content},get onTransitionEnd(){return e.onTransitionEnd}})}})]}}),CM=De('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-testid="avatar-placeholder"><circle cx="12" cy="12" r="12" fill="#5DDE8A"></circle><g transform="translate(2.4,2.4) scale(0.8)"><path d="M14.085 18.295H5.272V9.679C5.272 7.121 7.357 5.075 9.875 5.075H14.046C16.603 5.075 18.649 7.161 18.649 9.679V13.692C18.689 16.210 16.643 18.295 14.085 18.295ZM6.492 17.115H14.125C16.013 17.115 17.548 15.580 17.548 13.692V9.679C17.548 7.790 16.013 6.256 14.125 6.256H9.915C8.026 6.256 6.492 7.790 6.492 9.679V17.115Z" fill="#fff"></path><circle cx="11.961" cy="11.685" r="0.945" fill="#fff"></circle><circle cx="8.971" cy="11.685" r="0.945" fill="#fff"></circle><circle cx="15.030" cy="11.685" r="0.945" fill="#fff">'),SM=({boxSize:e,width:t}={})=>{const n=e||t||"2.5rem";return(()=>{const e=CM();return null!=n?e.style.setProperty("width",n):e.style.removeProperty("width"),null!=n?e.style.setProperty("height",n):e.style.removeProperty("height"),e})()},TM=De('<img alt="Bot avatar" class="rounded-full object-cover w-full h-full" elementtiming="Bot avatar" fetchpriority="high">'),DM=De("<figure>"),AM=e=>{const[t,n]=O(e.initialAvatarSrc);return I(()=>{!t()?.startsWith("{{")&&t()||!e.initialAvatarSrc?.startsWith("http")||n(e.initialAvatarSrc)}),(()=>{const e=DM();return Be(e,ie(ve,{get when(){return nt(t())},keyed:!0,get fallback(){return ie(SM,{})},get children(){const e=TM();return P(()=>Oe(e,"src",t())),e}})),P(()=>Pe(e,"flex justify-center items-center rounded-full text-white relative animate-fade-in flex-shrink-0 "+(zi()?"w-6 h-6 text-sm":"w-10 h-10 text-xl"))),e})()};function OM(e,t){const n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;return n?(n[e]||(n[e]=t()),n[e]):t()}var PM=e=>"object"==typeof e&&null!==e,IM=OM("__zag__proxyStateMap",()=>new WeakMap),NM=OM("__zag__refSet",()=>new WeakSet),[RM]=((e=Object.is,t=(e,t)=>new Proxy(e,t),n=e=>PM(e)&&!NM.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer),r=e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}},o=new WeakMap,i=(e,t,n=r)=>{const i=o.get(e);if(i?.[0]===t)return i[1];const a=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return Pu(a,!0),o.set(e,[t,a]),Reflect.ownKeys(e).forEach(t=>{const r=Reflect.get(e,t);NM.has(r)?(Pu(r,!1),a[t]=r):r instanceof Promise?Object.defineProperty(a,t,{get:()=>n(r)}):IM.has(r)?a[t]=LM(r,n):a[t]=r}),Object.freeze(a)},a=new WeakMap,s=[1,1],l=r=>{if(!PM(r))throw new Error("object required");const o=a.get(r);if(o)return o;let l=s[0];const u=new Set,c=(e,t=++s[0])=>{l!==t&&(l=t,u.forEach(n=>n(e,t)))};let d=s[1];const p=e=>(t,n)=>{const r=[...t];r[1]=[e,...r[1]],c(r,n)},f=new Map,h=e=>{const t=f.get(e);t&&(f.delete(e),t[1]?.())},g=Array.isArray(r)?[]:Object.create(Object.getPrototypeOf(r)),m={deleteProperty(e,t){const n=Reflect.get(e,t);h(t);const r=Reflect.deleteProperty(e,t);return r&&c(["delete",[t],n]),r},set(t,r,o,i){const s=Reflect.has(t,r),l=Reflect.get(t,r,i);if(s&&(e(l,o)||a.has(o)&&e(l,a.get(o))))return!0;var d;h(r),PM(o)&&(o=ku(d=o)&&d[mu]||null||o);let g=o;if(Object.getOwnPropertyDescriptor(t,r)?.set);else if(o instanceof Promise)o.then(e=>{Object.assign(o,{status:"fulfilled",value:e}),c(["resolve",[r],e])}).catch(e=>{Object.assign(o,{status:"rejected",reason:e}),c(["reject",[r],e])});else{!IM.has(o)&&n(o)&&(g=BM(o));const e=!NM.has(g)&&IM.get(g);e&&((e,t)=>{if(u.size){const n=t[3](p(e));f.set(e,[t,n])}else f.set(e,[t])})(r,e)}return Reflect.set(t,r,g,i),c(["set",[r],o,l]),!0}},v=t(g,m);a.set(r,v);const y=[g,(e=++s[1])=>(d===e||u.size||(d=e,f.forEach(([t])=>{const n=t[1](e);n>l&&(l=n)})),l),i,e=>{u.add(e),1===u.size&&f.forEach(([e,t],n)=>{const r=e[3](p(n));f.set(n,[e,r])});return()=>{u.delete(e),0===u.size&&f.forEach(([e,t],n)=>{t&&(t(),f.set(n,[e]))})}}];return IM.set(v,y),Reflect.ownKeys(r).forEach(e=>{const t=Object.getOwnPropertyDescriptor(r,e);t.get||t.set?Object.defineProperty(g,e,t):v[e]=r[e]}),v})=>[l,IM,NM,e,t,n,r,o,i,a,s])();function BM(e={}){return RM(e)}function FM(e,t,n){const r=IM.get(e);let o;const i=[],a=r[3];let s=!1;const l=a(e=>{i.push(e),n?t(i.splice(0)):o||(o=Promise.resolve().then(()=>{o=void 0,s&&t(i.splice(0))}))});return s=!0,()=>{s=!1,l()}}function LM(e,t){const n=IM.get(e),[r,o,i]=n;return i(r,o(),t)}function MM(e){return NM.add(e),e}function UM(e,t){Object.keys(t).forEach(r=>{if(Object.getOwnPropertyDescriptor(e,r))throw new Error("object property already defined");const o=t[r],{get:i,set:a}="function"==typeof o?{get:o}:o,s={get:()=>i(LM(n))};a&&(s.set=e=>a(n,e)),Object.defineProperty(e,r,s)});const n=BM(e);return n}function jM(e,t,n){"object"==typeof n.value&&(n.value=$M(n.value)),n.enumerable&&!n.get&&!n.set&&n.configurable&&n.writable&&"__proto__"!==t?e[t]=n.value:Object.defineProperty(e,t,n)}function $M(e){if("object"!=typeof e)return e;var t,n,r,o=0,i=Object.prototype.toString.call(e);if("[object Object]"===i?r=Object.create(e.__proto__||null):"[object Array]"===i?r=Array(e.length):"[object Set]"===i?(r=new Set,e.forEach(function(e){r.add($M(e))})):"[object Map]"===i?(r=new Map,e.forEach(function(e,t){r.set($M(t),$M(e))})):"[object Date]"===i?r=new Date(+e):"[object RegExp]"===i?r=new RegExp(e.source,e.flags):"[object DataView]"===i?r=new e.constructor($M(e.buffer)):"[object ArrayBuffer]"===i?r=e.slice(0):"Array]"===i.slice(-6)&&(r=new e.constructor(e)),r){for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)jM(r,n[o],Object.getOwnPropertyDescriptor(e,n[o]));for(o=0,n=Object.getOwnPropertyNames(e);o<n.length;o++)Object.hasOwnProperty.call(r,t=n[o])&&r[t]===e[t]||jM(r,t,Object.getOwnPropertyDescriptor(e,t))}return r||e}var zM=Object.defineProperty,HM=(e,t,n)=>((e,t,n)=>t in e?zM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);var VM=(e,...t)=>("function"==typeof e?e(...t):e)??void 0,WM=()=>{},qM=(...e)=>(...t)=>{e.forEach(function(e){e?.(...t)})},GM=(()=>{let e=0;return()=>(e++,e.toString(36))})(),KM=e=>Array.isArray(e),YM=e=>!(null==e||"object"!=typeof e||KM(e)),ZM=e=>"string"==typeof e,XM=e=>"function"==typeof e;function QM(e){if(!JM(e)||void 0===e)return e;const t=Reflect.ownKeys(e).filter(e=>"string"==typeof e),n={};for(const r of t){const t=e[r];void 0!==t&&(n[r]=QM(t))}return n}var JM=e=>e&&"object"==typeof e&&e.constructor===Object;function eU(...e){1===e.length?e[0]:e[1],2!==e.length||e[0]}function tU(...e){1===e.length?e[0]:e[1],2!==e.length||e[0]}function nU(e,...t){for(const n of t){const t=QM(n);for(const r in t)YM(n[r])?(e[r]||(e[r]={}),nU(e[r],n[r])):e[r]=n[r]}return e}function rU(e){return $M(e)}function oU(e){return ZM(e)?{type:e}:e}function iU(e){return e?KM(e)?e.slice():[e]:[]}function aU(e){return YM(e)&&null!=e.predicate}var sU=()=>!0;function lU(e,t,n,r){return o=>ZM(o)?!!e[o]?.(t,n,r):XM(o)?o(t,n,r):o.predicate(e)(t,n,r)}var uU={or:function(...e){return{predicate:t=>(n,r,o)=>e.map(lU(t,n,r,o)).some(Boolean)}},and:function(...e){return{predicate:t=>(n,r,o)=>e.map(lU(t,n,r,o)).every(Boolean)}},not:function(e){return{predicate:t=>(n,r,o)=>!lU(t,n,r,o)(e)}}};function cU(e,t){return e=e??sU,(n,r,o)=>{if(ZM(e)){const i=t[e];return XM(i)?i(n,r,o):i}return aU(e)?e.predicate(t)(n,r,o):e?.(n,r,o)}}function dU(e,t){return(n,r,o)=>aU(e)?e.predicate(t)(n,r,o):e}function pU(e,t){return(n,r)=>{if("number"==typeof(o=e)&&!Number.isNaN(o))return e;var o;if(XM(e))return e(n,r);if(ZM(e)){const o=Number.parseFloat(e);if(!Number.isNaN(o))return o;if(t){const o=t?.[e];return tU(null==o,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),XM(o)?o(n,r):o}}}}function fU(e){return ZM(e)?{target:e}:e}var hU=class{constructor(e,t){HM(this,"status","Not Started"),HM(this,"state"),HM(this,"initialState"),HM(this,"initialContext"),HM(this,"id"),HM(this,"type","machine"),HM(this,"activityEvents",new Map),HM(this,"delayedEvents",new Map),HM(this,"stateListeners",new Set),HM(this,"doneListeners",new Set),HM(this,"contextWatchers",new Set),HM(this,"removeStateListener",WM),HM(this,"parent"),HM(this,"children",new Map),HM(this,"guardMap"),HM(this,"actionMap"),HM(this,"delayMap"),HM(this,"activityMap"),HM(this,"sync"),HM(this,"options"),HM(this,"config"),HM(this,"_created",()=>{const e=oU("machine.created");this.executeActions(this.config?.created,e)}),HM(this,"start",e=>{if(this.state.value="",this.state.tags=[],"Running"===this.status)return this;this.status="Running",this.removeStateListener=FM(this.state,()=>{this.stateListeners.forEach(e=>{e(this.stateSnapshot)})},this.sync),this.setupContextWatchers(),this.executeActivities(oU("machine.start"),iU(this.config.activities),"machine.start"),this.executeActions(this.config.entry,oU("machine.start"));const t=oU("machine.init"),n=YM(e)?e.value:e,r=YM(e)?e.context:void 0;r&&this.setContext(r);const o={target:n??this.config.initial},i=this.getNextStateInfo(o,t);return this.initialState=i,this.performStateChangeEffects(this.state.value,i,t),this}),HM(this,"setupContextWatchers",()=>{const{watch:e}=this.config;if(!e)return;let t=LM(this.state.context);const n=FM(this.state.context,()=>{const n=LM(this.state.context);for(const[r,o]of Object.entries(e)){(this.options.compareFns?.[r]??Object.is)(t[r],n[r])||this.executeActions(o,this.state.event)}t=n});this.contextWatchers.add(n)}),HM(this,"stop",()=>{if("Stopped"!==this.status)return this.performExitEffects(this.state.value,oU("machine.stop")),this.executeActions(this.config.exit,oU("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),HM(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),HM(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(e=>e()),this.contextWatchers.clear()}),HM(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(e=>{e.forEach(e=>e())}),this.delayedEvents.clear()}),HM(this,"stopActivities",e=>{e?(this.activityEvents.get(e)?.forEach(e=>e()),this.activityEvents.get(e)?.clear(),this.activityEvents.delete(e)):(this.activityEvents.forEach(e=>{e.forEach(e=>e()),e.clear()}),this.activityEvents.clear())}),HM(this,"sendChild",(e,t)=>{const n=oU(e),r=VM(t,this.contextSnapshot),o=this.children.get(r);o||tU(`[@zag-js/core] Cannot send '${n.type}' event to unknown child`),o.send(n)}),HM(this,"stopChild",e=>{this.children.has(e)||tU(`[@zag-js/core > stop-child] Cannot stop unknown child ${e}`),this.children.get(e).stop(),this.children.delete(e)}),HM(this,"removeChild",e=>{this.children.delete(e)}),HM(this,"stopChildren",()=>{this.children.forEach(e=>e.stop()),this.children.clear()}),HM(this,"setParent",e=>{this.parent=e}),HM(this,"spawn",(e,t)=>{const n=VM(e);return t&&(n.id=t),n.type="machine.actor",n.setParent(this),this.children.set(n.id,n),n.onDone(()=>{this.removeChild(n.id)}).start(),MM(n)}),HM(this,"stopActivity",e=>{if(!this.state.value)return;const t=this.activityEvents.get(this.state.value);t?.get(e)?.(),t?.delete(e)}),HM(this,"addActivityCleanup",(e,t,n)=>{e&&(this.activityEvents.has(e)?this.activityEvents.get(e)?.set(t,n):this.activityEvents.set(e,new Map([[t,n]])))}),HM(this,"setState",e=>{this.state.previousValue=this.state.value,this.state.value=e;const t=this.getStateNode(e);null==e?function(e){for(;e.length>0;)e.pop()}(this.state.tags):this.state.tags=iU(t?.tags)}),HM(this,"setContext",e=>{e&&nU(this.state.context,QM(e))}),HM(this,"setOptions",e=>{const t=QM(e);this.actionMap={...this.actionMap,...t.actions},this.delayMap={...this.delayMap,...t.delays},this.activityMap={...this.activityMap,...t.activities},this.guardMap={...this.guardMap,...t.guards}}),HM(this,"getStateNode",e=>{if(e)return this.config.states?.[e]}),HM(this,"getNextStateInfo",(e,t)=>{const n=this.determineTransition(e,t),r=!n?.target,o=n?.target??this.state.value,i=this.state.value!==o,a=this.getStateNode(o),s={reenter:!r&&!i&&!n?.internal,transition:n,stateNode:a,target:o,changed:i};return this.log("NextState:",`[${t.type}]`,this.state.value,"----\x3e",s.target),s}),HM(this,"getAfterActions",(e,t)=>{let n;return{entry:()=>{n=globalThis.setTimeout(()=>{const t=this.getNextStateInfo(e,this.state.event);this.performStateChangeEffects(this.state.value,t,this.state.event)},t)},exit:()=>{globalThis.clearTimeout(n)}}}),HM(this,"getDelayedEventActions",e=>{const t=this.getStateNode(e),n=this.state.event;if(!t||!t.after)return;const r=[],o=[];if(KM(t.after)){const e=this.determineTransition(t.after,n);if(!e)return;if(!((e,t)=>Object.prototype.hasOwnProperty.call(e,t))(e,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(e)}`);const i=pU(e.delay,this.delayMap)(this.contextSnapshot,n),a=this.getAfterActions(e,i);return r.push(a.entry),o.push(a.exit),{entries:r,exits:o}}if(YM(t.after))for(const e in t.after){const i=t.after[e],a=pU(e,this.delayMap)(this.contextSnapshot,n),s=this.getAfterActions(i,a);r.push(s.entry),o.push(s.exit)}return{entries:r,exits:o}}),HM(this,"executeActions",(e,t)=>{const n=dU(e,this.guardMap)(this.contextSnapshot,t,this.guardMeta);for(const e of iU(n)){const n=ZM(e)?this.actionMap?.[e]:e;eU(ZM(e)&&!n,`[@zag-js/core > execute-actions] No implementation found for action: \`${e}\``),n?.(this.state.context,t,this.meta)}}),HM(this,"executeActivities",(e,t,n)=>{for(const r of t){const t=ZM(r)?this.activityMap?.[r]:r;if(!t){eU(`[@zag-js/core > execute-activity] No implementation found for activity: \`${r}\``);continue}const o=t(this.state.context,e,this.meta);if(o){const e=ZM(r)?r:r.name||GM();this.addActivityCleanup(n??this.state.value,e,o)}}}),HM(this,"createEveryActivities",(e,t)=>{if(e)if(KM(e)){const n=iU(e).find(e=>{const t=pU(e.delay,this.delayMap)(this.contextSnapshot,this.state.event);return cU(e.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??null!=t});if(!n)return;const r=pU(n.delay,this.delayMap)(this.contextSnapshot,this.state.event),o=()=>{const e=globalThis.setInterval(()=>{this.executeActions(n.actions,this.state.event)},r);return()=>{globalThis.clearInterval(e)}};t(o)}else for(const n in e){const r=e?.[n],o=pU(n,this.delayMap)(this.contextSnapshot,this.state.event),i=()=>{const e=globalThis.setInterval(()=>{this.executeActions(r,this.state.event)},o);return()=>{globalThis.clearInterval(e)}};t(i)}}),HM(this,"setEvent",e=>{this.state.previousEvent=this.state.event,this.state.event=MM(oU(e))}),HM(this,"performExitEffects",(e,t)=>{const n=this.state.value;if(""===n)return;const r=e?this.getStateNode(e):void 0;this.stopActivities(n);const o=iU(dU(r?.exit,this.guardMap)(this.contextSnapshot,t,this.guardMeta)),i=this.delayedEvents.get(n);i&&o.push(...i),this.executeActions(o,t)}),HM(this,"performEntryEffects",(e,t)=>{const n=this.getStateNode(e),r=iU(n?.activities);this.createEveryActivities(n?.every,e=>{r.unshift(e)}),r.length>0&&this.executeActivities(t,r);const o=iU(dU(n?.entry,this.guardMap)(this.contextSnapshot,t,this.guardMeta)),i=this.getDelayedEventActions(e);n?.after&&i&&(this.delayedEvents.set(e,i?.exits),o.push(...i.entries)),this.executeActions(o,t),"final"===n?.type&&(this.state.done=!0,this.doneListeners.forEach(e=>{e(this.stateSnapshot)}),this.stop())}),HM(this,"performTransitionEffects",(e,t)=>{const n=this.determineTransition(e,t);this.executeActions(n?.actions,t)}),HM(this,"performStateChangeEffects",(e,t,n)=>{this.setEvent(n);const r=t.changed||t.reenter;r&&this.performExitEffects(e,n),this.performTransitionEffects(t.transition,n),this.setState(t.target),r&&this.performEntryEffects(t.target,n)}),HM(this,"determineTransition",(e,t)=>{const n=(r=e,o=this.guardMap,(e,t,n)=>iU(r).map(fU).find(r=>cU(r.guard,o)(e,t,n)??r.target??r.actions));var r,o;return n?.(this.contextSnapshot,t,this.guardMeta)}),HM(this,"sendParent",e=>{this.parent||tU("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const t=oU(e);this.parent?.send(t)}),HM(this,"log",(...e)=>{}),HM(this,"send",e=>{const t=oU(e);this.transition(this.state.value,t)}),HM(this,"transition",(e,t)=>{const n=ZM(e)?this.getStateNode(e):e?.stateNode,r=oU(t);if(!n&&!this.config.on){return void eU("Stopped"===this.status?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${e}, \`event\`: ${r.type}`)}const o=n?.on?.[r.type]??this.config.on?.[r.type],i=this.getNextStateInfo(o,r);return this.performStateChangeEffects(this.state.value,i,r),i.stateNode}),HM(this,"subscribe",e=>(this.stateListeners.add(e),"Running"===this.status&&e(this.stateSnapshot),()=>{this.stateListeners.delete(e)})),HM(this,"onDone",e=>(this.doneListeners.add(e),this)),HM(this,"onTransition",e=>(this.stateListeners.add(e),"Running"===this.status&&e(this.stateSnapshot),this)),this.config=rU(e),this.options=rU(t??{}),this.id=this.config.id??`machine-${GM()}`,this.guardMap=this.options?.guards??{},this.actionMap=this.options?.actions??{},this.delayMap=this.options?.delays??{},this.activityMap=this.options?.activities??{},this.sync=this.options?.sync??!1,this.state=function(e){const t=e.computed??{},n=e.context??{},r=e.initial?e.states?.[e.initial]?.tags:[];return BM({value:e.initial??"",previousValue:"",event:{},previousEvent:{},context:UM(n,t),done:!1,tags:r??[],hasTag(e){return this.tags.includes(e)},matches(...e){return e.includes(this.value)},can(e){return this.nextEvents.includes(e)},get nextEvents(){const t=e.states?.[this.value]?.on??{},n=e?.on??{};return Object.keys({...t,...n})},get changed(){return!("machine.init"===this.event.value||!this.previousValue)&&this.value!==this.previousValue}})}(this.config),this.initialContext=LM(this.state.context)}get stateSnapshot(){return LM(this.state)}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){return e.initialState?.target??""}}}get meta(){return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:this.initialState?.target??"",getState:()=>this.stateSnapshot,getAction:e=>this.actionMap[e],getGuard:e=>this.guardMap[e]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}},gU=(e,t)=>new hU(e,t),mU=(...e)=>e.map(e=>e?.trim?.()).filter(Boolean).join(" "),vU=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,yU=e=>{const t={};let n;for(;n=vU.exec(e);)t[n[1]]=n[2];return t},bU=(e,t)=>{if(ZM(e)){if(ZM(t))return`${e};${t}`;e=yU(e)}else ZM(t)&&(t=yU(t));return Object.assign({},e??{},t??{})};function wU(...e){let t={};for(let n of e){for(let e in t)e.startsWith("on")&&"function"==typeof t[e]&&"function"==typeof n[e]?t[e]=qM(n[e],t[e]):t[e]="className"!==e&&"class"!==e?"style"!==e?void 0!==n[e]?n[e]:t[e]:bU(t[e],n[e]):mU(t[e],n[e]);for(let e in n)void 0===t[e]&&(t[e]=n[e])}return t}var EU=()=>e=>Array.from(new Set(e));function _U(...e){const t={};for(let n=0;n<e.length;n++){let r=e[n];if("function"==typeof r&&(r=r()),r){const n=Object.getOwnPropertyDescriptors(r);for(const r in n)r in t||Object.defineProperty(t,r,{enumerable:!0,get(){let t={};if("style"===r||"class"===r||"className"===r||r.startsWith("on")){for(let n=0;n<e.length;n++){let o=e[n];"function"==typeof o&&(o=o()),t=wU(t,{[r]:(o||{})[r]})}return t[r]}for(let t=e.length-1;t>=0;t--){let n,o=e[t];if("function"==typeof o&&(o=o()),n=(o||{})[r],void 0!==n)return n}}})}}return t}var xU=e=>!(null==e||"object"!=typeof e||(e=>Array.isArray(e))(e)),kU=e=>"number"==typeof e&&!Number.isNaN(e),CU=e=>"string"==typeof e,SU={onFocus:"onFocusIn",onBlur:"onFocusOut",onDoubleClick:"onDblClick",onChange:"onInput",defaultChecked:"checked",defaultValue:"value",htmlFor:"for",className:"class"},TU=e=>e.startsWith("--")?e:function(e){if(RU.hasOwnProperty(e))return RU[e];var t=e.replace(IU,BU);return RU[e]=NU.test(t)?"-"+t:t}(e);function DU(e){return e in SU?SU[e]:e}var AU,OU=(AU=e=>{const t={};for(const n in e){const r=e[n];"readOnly"===n&&!1===r||("style"===n&&xU(r)?t.style=PU(r):"children"!==n?t[DU(n)]=r:CU(r)&&(t.textContent=r))}return t},new Proxy({},{get:()=>AU}));function PU(e){let t={};for(const n in e){const r=e[n];(CU(r)||kU(r))&&(t[TU(n)]=r)}return t}var IU=/[A-Z]/g,NU=/^ms-/,RU={};function BU(e){return"-"+e.toLowerCase()}function FU(e,t){const{actions:n,context:r}=t??{},[o,i]=xn(e.getState());return B(()=>{const t=e.subscribe(e=>{i(Sn(e))});F(()=>{t()})}),I(()=>{const t="function"==typeof r?r():r;e.setContext(t)}),I(()=>{e.setOptions({actions:n})}),o}function LU(e,t){const n=function(e,t){const{state:n,context:r}=t??{},o=(()=>{const t="function"==typeof e?e():e,n="function"==typeof r?r():r;return n&&t.setContext(n),t._created(),t})();return B(()=>{o.start(n),F(()=>{o.stop()})}),o}(e,t);return[FU(n,t),n.send,n]}var MU=e=>e?"":void 0,UU=e=>"object"==typeof e&&e?.nodeType===Node.ELEMENT_NODE&&"string"==typeof e?.nodeName,jU=e=>e.nodeType===Node.DOCUMENT_NODE;function $U(e,t){return!(!e||!t)&&(!(!UU(e)||!UU(t))&&(e===t||e.contains(t)))}function zU(e){return jU(e)?e:(e=>null!=e&&e===e.window)(e)?e.document:e?.ownerDocument??document}function HU(e){return(e=>e&&(e=>void 0!==e.nodeType)(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e)(e)?HU(e.host):jU(e)?e.defaultView??window:UU(e)?e.ownerDocument?.defaultView??window:window}var VU=()=>"undefined"!=typeof document;var WU=e=>VU()&&e.test(function(){const e=navigator.userAgentData;return e?.platform??navigator.platform}()),qU=()=>{return e=/firefox\//i,VU()&&e.test(navigator.userAgent);var e};function GU(e){const t=function(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}(e);return t?.[0]??e.target}function KU(e){const t=e.currentTarget;if(!t)return!1;const n=WU(/mac|iphone|ipad|ipod/i);if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const r=t.localName;return"a"===r||("button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}function YU(e){const t=e.currentTarget;if(!t)return!1;const n=t.localName;return!!e.altKey&&("a"===n||("button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type))}var ZU=e=>e.id;function XU(e,t,n=ZU){const r=function(e,t,n=ZU){return e.find(e=>n(e)===t)}(e,t,n);return r?e.indexOf(r):-1}function QU(e,t,n,r=ZU){const o=n?XU(e,n,r):-1;let i=n?((e,t)=>e.map((n,r)=>e[(Math.max(t,0)+r)%e.length]))(e,o):e;return 1===t.length&&(i=i.filter(e=>r(e)!==n)),i.find(e=>{return n=(e=>(e.dataset.valuetext??e.textContent??"").split("").map(e=>{const t=e.charCodeAt(0);return t>0&&t<128?e:t>=128&&t<=255?`/x${t.toString(16)}`.replace("/","\\"):""}).join("").trim())(e),r=t,n.trim().toLowerCase().startsWith(r.toLowerCase());var n,r})}function JU(e,t){const{state:n,activeId:r,key:o,timeout:i=350,itemToId:a}=t,s=n.keysSoFar+o,l=s.length>1&&Array.from(s).every(e=>e===s[0])?s[0]:s;const u=QU(e.slice(),l,r,a);function c(){clearTimeout(n.timer),n.timer=-1}return function e(t){n.keysSoFar=t,c(),""!==t&&(n.timer=+setTimeout(()=>{e(""),c()},i))}(s),u}var ej=Object.assign(JU,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:function(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}});var tj=e=>"object"==typeof e&&null!==e&&1===e.nodeType;var nj="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function rj(e){return!(!e||e.closest("[inert]"))&&(e.matches(nj)&&(!!tj(t=e)&&(t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0)));var t}function oj(e,t){if(!e)return[];const n=Array.from(e.querySelectorAll(nj)).filter(ij);return n.forEach((e,t)=>{if((e=>tj(e)&&"IFRAME"===e.tagName)(e)&&e.contentDocument){const r=oj(e.contentDocument.body);n.splice(t,1,...r)}}),n.length,n}function ij(e){return null!=e&&e.tabIndex>0||rj(e)&&!function(e){return parseInt(e.getAttribute("tabindex")||"0",10)<0}(e)}function aj(e){const{root:t,getInitialEl:n,filter:r,enabled:o=!0}=e;if(!o)return;let i=null;if(i||(i="function"==typeof n?n():n),i||(i=t?.querySelector("[data-autofocus],[autofocus]")),!i){const e=oj(t);i=r?e.filter(r)[0]:e[0]}return i||t||void 0}function sj(e){const t=e.currentTarget;if(!t)return!1;const[n,r]=function(e){const t=oj(e);return[t[0]||null,t[t.length-1]||null]}(t),o=t.ownerDocument||document;return(o.activeElement!==n||!e.shiftKey)&&(!(o.activeElement===r&&!e.shiftKey)&&!(!n&&!r))}function lj(e){if(null==e||!UU(e))return!1;try{return e instanceof HU(e).HTMLInputElement&&null!=e.selectionStart||/(textarea|select)/.test(e.localName)||e.isContentEditable}catch{return!1}}var uj=/auto|scroll|overlay|hidden|clip/;function cj(e){const t=globalThis.requestAnimationFrame(e);return()=>{globalThis.cancelAnimationFrame(t)}}function dj(e,t){const n=cj,r=[];return r.push(n(()=>{const n="function"==typeof e?e():e;r.push(function(e,t){if(!e)return;const{attributes:n,callback:r}=t,o=new(e.ownerDocument.defaultView||window).MutationObserver(e=>{for(const t of e)"attributes"===t.type&&t.attributeName&&n.includes(t.attributeName)&&r(t)});return o.observe(e,{attributes:!0,attributeFilter:n}),()=>o.disconnect()}(n,t))})),()=>{r.forEach(e=>e?.())}}function pj(e,t){return Array.from(e?.querySelectorAll(t)??[])}function fj(e){const t={getRootNode:e=>e.getRootNode?.()??document,getDoc:e=>zU(t.getRootNode(e)),getWin:e=>t.getDoc(e).defaultView??window,getActiveElement:e=>t.getDoc(e).activeElement,isActiveElement:(e,n)=>n===t.getActiveElement(e),getById:(e,n)=>t.getRootNode(e).getElementById(n),setValue:(e,t)=>{if(null==e||null==t)return;const n=t.toString();e.value!==n&&(e.value=t.toString())}};return{...t,...e}}function hj(e,t){const{rootEl:n,...r}=t||{};e&&n&&function(e){const t=HU(e),{overflow:n,overflowX:r,overflowY:o,display:i}=t.getComputedStyle(e);return uj.test(n+o+r)&&!["inline","contents"].includes(i)}(n)&&function(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}(n)&&e.scrollIntoView(r)}var gj=new WeakMap;function mj(e,t){if(!e)return()=>{};return function(e,t,n){gj.has(e)||gj.set(e,new Map);const r=gj.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{r.get(t)?.(),r.delete(t)};const i=n(),a=()=>{i(),o(),r.delete(t)};return r.set(t,a),()=>{r.get(t)===a&&(i(),r.set(t,o))}}(e,"style",()=>{const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}})}var vj=1e3/60;function yj(e,t){const n=[];return e?.forEach(e=>{const r=function(e,t){const n=e();if(UU(n)&&n.isConnected)return t(n),()=>{};{const n=setInterval(()=>{const r=e();UU(r)&&r.isConnected&&(t(r),clearInterval(n))},vj);return()=>clearInterval(n)}}(e,t);n.push(r)}),()=>{n.forEach(e=>e())}}var bj=e=>"Array"===e?.constructor.name,wj=(e,t)=>{if(Object.is(e,t))return!0;if(null==e&&null!=t||null!=e&&null==t)return!1;if("function"==typeof e?.isEqual&&"function"==typeof t?.isEqual)return e.isEqual(t);if("function"==typeof e&&"function"==typeof t)return e.toString()===t.toString();if(bj(e)&&bj(t))return Array.from(e).toString()===Array.from(t).toString();if("object"!=typeof e||"object"!=typeof t)return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let t=0;t<r;t++){if(!Reflect.has(e,n[t]))return!1}for(let o=0;o<r;o++){const r=n[o];if(!wj(e[r],t[r]))return!1}return!0},Ej=(e,...t)=>("function"==typeof e?e(...t):e)??void 0,_j=()=>{},xj=(...e)=>(...t)=>{e.forEach(function(e){e?.(...t)})},kj=(()=>{let e=0;return()=>(e++,e.toString(36))})(),Cj=e=>"number"==typeof e&&!Number.isNaN(e),Sj=e=>"function"==typeof e;function Tj(e){if(!Dj(e)||void 0===e)return e;const t=Reflect.ownKeys(e).filter(e=>"string"==typeof e),n={};for(const r of t){const t=e[r];void 0!==t&&(n[r]=Tj(t))}return n}var Dj=e=>e&&"object"==typeof e&&e.constructor===Object;function Aj(...e){1===e.length?e[0]:e[1],2!==e.length||e[0]}var Oj=(e,t,n,r)=>{const o="function"==typeof e?e():e;return o?.addEventListener(t,n,r),()=>{o?.removeEventListener(t,n,r)}};var Pj=e=>0===e.button,Ij=e=>2===e.button||WU(/^Mac/)&&e.ctrlKey&&0===e.button;function Nj(e){if(!function(e){return e?.matches("a[href]")??!1}(e))return;const t=()=>e.click();qU()?function(e,t,n){const r=(e=>{const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,o,!0),n()}),o=()=>{r(),n()};e.addEventListener(t,o,{once:!0,capture:!0})}(e,"keyup",t):queueMicrotask(t)}function Rj(e,t,n){if(!e)return;const r=new(e.ownerDocument.defaultView||window).CustomEvent(t,n);return e.dispatchEvent(r)}var Bj={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Fj={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function Lj(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let{key:o}=e;o=Bj[o]??o;return"rtl"===n&&"horizontal"===r&&o in Fj&&(o=Fj[o]),o}function Mj(e,t="client"){return(e=>"touches"in e&&e.touches.length>0)(e)?function(e,t="client"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}(e,t):function(e,t="client"){return{x:e[`${t}X`],y:e[`${t}Y`]}}(e,t)}var Uj=(e,t=[])=>({parts:(...n)=>{if($j(t))return Uj(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Uj(e,[...t,...n]),rename:e=>Uj(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${jj(e)}"][data-part="${jj(n)}"]`,`& [data-scope="${jj(e)}"][data-part="${jj(n)}"]`].join(", "),attrs:{"data-scope":jj(e),"data-part":jj(n)}}}),{})}),jj=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),$j=e=>0===e.length;function zj(e){return(e=>e.nodeType===Node.DOCUMENT_NODE)(e)?e:(e=>null!=e&&e===e.window)(e)?e.document:e?.ownerDocument??document}var Hj=()=>e=>Array.from(new Set(e)),Vj=Uj("carousel").parts("root","viewport","itemGroup","item","nextTrigger","prevTrigger","indicatorGroup","indicator");Vj.build();var Wj=function(e){const t={getRootNode:e=>e.getRootNode?.()??document,getDoc:e=>zj(t.getRootNode(e)),getWin:e=>t.getDoc(e).defaultView??window,getActiveElement:e=>t.getRootNode(e).activeElement,isActiveElement:(e,n)=>n===t.getActiveElement(e),getById:(e,n)=>t.getRootNode(e).getElementById(n),setValue:(e,t)=>{if(null==e||null==t)return;const n=t.toString();e.value!==n&&(e.value=t.toString())}};return{...t,...e}}({getRootId:e=>e.ids?.root??`carousel:${e.id}`,getViewportId:e=>e.ids?.viewport??`carousel:${e.id}:viewport`,getItemId:(e,t)=>e.ids?.item?.(t)??`carousel:${e.id}:item:${t}`,getItemGroupId:e=>e.ids?.itemGroup??`carousel:${e.id}:item-group`,getNextTriggerId:e=>e.ids?.nextTrigger??`carousel:${e.id}:next-trigger`,getPrevTriggerId:e=>e.ids?.prevTrigger??`carousel:${e.id}:prev-trigger`,getIndicatorGroupId:e=>e.ids?.indicatorGroup??`carousel:${e.id}:indicator-group`,getIndicatorId:(e,t)=>e.ids?.indicator?.(t)??`carousel:${e.id}:indicator:${t}`,getRootEl:e=>Wj.getById(e,Wj.getRootId(e)),getViewportEl:e=>Wj.getById(e,Wj.getViewportId(e)),getSlideGroupEl:e=>Wj.getById(e,Wj.getItemGroupId(e)),getSlideEls:e=>function(e,t){return Array.from(e?.querySelectorAll(t)??[])}(Wj.getSlideGroupEl(e),"[data-part=item]")});Hj()(["align","dir","getRootNode","id","ids","index","loop","onIndexChange","orientation","slidesPerView","spacing"]),Hj()(["index","readOnly"]),Vj.extendWith("control");function qj(e){return(e=>e.nodeType===Node.DOCUMENT_NODE)(e)?e:(e=>null!=e&&e===e.window)(e)?e.document:e?.ownerDocument??document}var Gj=Uj("checkbox").parts("root","label","control","indicator");Gj.build();var Kj,Yj=function(e){const t={getRootNode:e=>e.getRootNode?.()??document,getDoc:e=>qj(t.getRootNode(e)),getWin:e=>t.getDoc(e).defaultView??window,getActiveElement:e=>t.getRootNode(e).activeElement,isActiveElement:(e,n)=>n===t.getActiveElement(e),getById:(e,n)=>t.getRootNode(e).getElementById(n),setValue:(e,t)=>{if(null==e||null==t)return;const n=t.toString();e.value!==n&&(e.value=t.toString())}};return{...t,...e}}({getRootId:e=>e.ids?.root??`checkbox:${e.id}`,getLabelId:e=>e.ids?.label??`checkbox:${e.id}:label`,getControlId:e=>e.ids?.control??`checkbox:${e.id}:control`,getHiddenInputId:e=>e.ids?.hiddenInput??`checkbox:${e.id}:input`,getRootEl:e=>Yj.getById(e,Yj.getRootId(e)),getHiddenInputEl:e=>Yj.getById(e,Yj.getHiddenInputId(e))});Kj=["checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"],Array.from(new Set(Kj)),Gj.extendWith("group");function Zj(e){return(e=>e.nodeType===Node.DOCUMENT_NODE)(e)?e:(e=>null!=e&&e===e.window)(e)?e.document:e?.ownerDocument??document}function Xj(e,t){return Array.from(e?.querySelectorAll(t)??[])}function Qj(e){return Math.max(0,Math.min(1,e))}function Jj(e,t){const{left:n,top:r,width:o,height:i}=t.getBoundingClientRect(),a={x:e.x-n,y:e.y-r},s={x:Qj(a.x/o),y:Qj(a.y/i)};return{offset:a,percent:s,getPercentValue:function(e={}){const{dir:t="ltr",orientation:n="horizontal",inverted:r}=e,o="object"==typeof r?r.x:r,i="object"==typeof r?r.y:r;return"horizontal"===n?"rtl"===t||o?1-s.x:s.x:i?1-s.y:s.y}}}var e$=Uj("color-picker",["root","label","control","trigger","positioner","content","area","areaThumb","valueText","areaBackground","channelSlider","channelSliderLabel","channelSliderTrack","channelSliderThumb","channelSliderValueText","channelInput","transparencyGrid","swatchGroup","swatchTrigger","swatchIndicator","swatch","eyeDropperTrigger","formatTrigger","formatSelect"]);e$.build();var t$=function(e){const t={getRootNode:e=>e.getRootNode?.()??document,getDoc:e=>Zj(t.getRootNode(e)),getWin:e=>t.getDoc(e).defaultView??window,getActiveElement:e=>t.getRootNode(e).activeElement,isActiveElement:(e,n)=>n===t.getActiveElement(e),getById:(e,n)=>t.getRootNode(e).getElementById(n),setValue:(e,t)=>{if(null==e||null==t)return;const n=t.toString();e.value!==n&&(e.value=t.toString())}};return{...t,...e}}({getRootId:e=>e.ids?.root??`color-picker:${e.id}`,getLabelId:e=>e.ids?.label??`color-picker:${e.id}:label`,getHiddenInputId:e=>e.ids?.hiddenInput??`color-picker:${e.id}:hidden-input`,getControlId:e=>e.ids?.control??`color-picker:${e.id}:control`,getTriggerId:e=>e.ids?.trigger??`color-picker:${e.id}:trigger`,getContentId:e=>e.ids?.content??`color-picker:${e.id}:content`,getPositionerId:e=>e.ids?.positioner??`color-picker:${e.id}:positioner`,getFormatSelectId:e=>e.ids?.formatSelect??`color-picker:${e.id}:format-select`,getAreaId:e=>e.ids?.area??`color-picker:${e.id}:area`,getAreaGradientId:e=>e.ids?.areaGradient??`color-picker:${e.id}:area-gradient`,getAreaThumbId:e=>e.ids?.areaThumb??`color-picker:${e.id}:area-thumb`,getChannelSliderTrackId:(e,t)=>e.ids?.channelSliderTrack?.(t)??`color-picker:${e.id}:slider-track:${t}`,getChannelSliderThumbId:(e,t)=>e.ids?.channelSliderThumb?.(t)??`color-picker:${e.id}:slider-thumb:${t}`,getContentEl:e=>t$.getById(e,t$.getContentId(e)),getAreaThumbEl:e=>t$.getById(e,t$.getAreaThumbId(e)),getChannelSliderThumbEl:(e,t)=>t$.getById(e,t$.getChannelSliderThumbId(e,t)),getChannelInputEl:(e,t)=>{const n=`input[data-channel="${t}"]`;return[...Xj(t$.getContentEl(e),n),...Xj(t$.getControlEl(e),n)]},getFormatSelectEl:e=>t$.getById(e,t$.getFormatSelectId(e)),getHiddenInputEl:e=>t$.getById(e,t$.getHiddenInputId(e)),getAreaEl:e=>t$.getById(e,t$.getAreaId(e)),getAreaValueFromPoint(e,t){const n=t$.getAreaEl(e);if(!n)return;const{percent:r}=Jj(t,n);return r},getControlEl:e=>t$.getById(e,t$.getControlId(e)),getTriggerEl:e=>t$.getById(e,t$.getTriggerId(e)),getPositionerEl:e=>t$.getById(e,t$.getPositionerId(e)),getChannelSliderTrackEl:(e,t)=>t$.getById(e,t$.getChannelSliderTrackId(e,t)),getChannelSliderValueFromPoint(e,t,n){const r=t$.getChannelSliderTrackEl(e,n);if(!r)return;const{percent:o}=Jj(t,r);return o},getChannelInputEls:e=>[...Xj(t$.getContentEl(e),"input[data-channel]"),...Xj(t$.getControlEl(e),"input[data-channel]")]});e$.extendWith("view");function n$(e){return(e=>e.nodeType===Node.DOCUMENT_NODE)(e)?e:(e=>null!=e&&e===e.window)(e)?e.document:e?.ownerDocument??document}var r$=()=>e=>Array.from(new Set(e)),o$=Uj("date-picker").parts("root","label","clearTrigger","content","control","input","monthSelect","nextTrigger","positioner","prevTrigger","rangeText","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","viewTrigger","viewControl","yearSelect","presetTrigger");o$.build();var i$=function(e){const t={getRootNode:e=>e.getRootNode?.()??document,getDoc:e=>n$(t.getRootNode(e)),getWin:e=>t.getDoc(e).defaultView??window,getActiveElement:e=>t.getRootNode(e).activeElement,isActiveElement:(e,n)=>n===t.getActiveElement(e),getById:(e,n)=>t.getRootNode(e).getElementById(n),setValue:(e,t)=>{if(null==e||null==t)return;const n=t.toString();e.value!==n&&(e.value=t.toString())}};return{...t,...e}}({getLabelId:e=>e.ids?.label??`datepicker:${e.id}:label`,getRootId:e=>e.ids?.root??`datepicker:${e.id}`,getTableId:(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,getTableHeaderId:(e,t)=>e.ids?.tableHeader?.(t)??`datepicker:${e.id}:thead`,getTableBodyId:(e,t)=>e.ids?.tableBody?.(t)??`datepicker:${e.id}:tbody`,getTableRowId:(e,t)=>e.ids?.tableRow?.(t)??`datepicker:${e.id}:tr:${t}`,getContentId:e=>e.ids?.content??`datepicker:${e.id}:content`,getCellTriggerId:(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,getPrevTriggerId:(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,getNextTriggerId:(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,getViewTriggerId:(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,getClearTriggerId:e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,getControlId:e=>e.ids?.control??`datepicker:${e.id}:control`,getInputId:(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,getTriggerId:e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,getPositionerId:e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,getMonthSelectId:e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,getYearSelectId:e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,getFocusedCell:(e,t=e.view)=>function(e,t){return e?.querySelector(t)??null}(i$.getContentEl(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),getTriggerEl:e=>i$.getById(e,i$.getTriggerId(e)),getContentEl:e=>i$.getById(e,i$.getContentId(e)),getInputEls:e=>function(e,t){return Array.from(e?.querySelectorAll(t)??[])}(i$.getControlEl(e),"[data-part=input]"),getYearSelectEl:e=>i$.getById(e,i$.getYearSelectId(e)),getMonthSelectEl:e=>i$.getById(e,i$.getMonthSelectId(e)),getClearTriggerEl:e=>i$.getById(e,i$.getClearTriggerId(e)),getPositionerEl:e=>i$.getById(e,i$.getPositionerId(e)),getControlEl:e=>i$.getById(e,i$.getControlId(e))});
8
33
  /*!
9
34
  * focus-trap 7.5.4
10
35
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
11
36
  */
12
- function os(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function rs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?os(Object(n),!0).forEach((function(t){is(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):os(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function is(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var as=function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var o=e.indexOf(t);-1===o||e.splice(o,1),e.push(t)},ss=function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()},ls=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},cs=function(e){return ls(e)&&!e.shiftKey},ds=function(e){return ls(e)&&e.shiftKey},us=function(e){return setTimeout(e,0)},ps=function(e,t){var n=-1;return e.every((function(e,o){return!t(e)||(n=o,!1)})),n},gs=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return"function"==typeof e?e.apply(void 0,n):e},hs=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},fs=[],ms=function(e,t){var n,o=(null==t?void 0:t.document)||document,r=(null==t?void 0:t.trapStack)||fs,i=rs({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:cs,isKeyBackward:ds},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},l=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex((function(t){var o=t.container,r=t.tabbableNodes;return o.contains(e)||(null==n?void 0:n.includes(o))||r.find((function(t){return t===e}))}))},c=function(e){var t=i[e];if("function"==typeof t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];t=t.apply(void 0,r)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=t;if("string"==typeof t&&!(s=o.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},d=function(){var e=c("initialFocus");if(!1===e)return!1;if(void 0===e||!ns(e,i.tabbableOptions))if(l(o.activeElement)>=0)e=o.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||c("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},u=function(){if(a.containerGroups=a.containers.map((function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?za([e],t.includeContainer,{filter:Za.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ja}):ja(e,t.includeContainer,Za.bind(null,t)),Qa(n)}(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?za([e],t.includeContainer,{filter:Xa.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ja(e,t.includeContainer,Xa.bind(null,t))}(e,i.tabbableOptions),o=t.length>0?t[0]:void 0,r=t.length>0?t[t.length-1]:void 0,a=n.find((function(e){return es(e)})),s=n.slice().reverse().find((function(e){return es(e)})),l=!!t.find((function(e){return Va(e)>0}));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:l,firstTabbableNode:o,lastTabbableNode:r,firstDomTabbableNode:a,lastDomTabbableNode:s,nextTabbableNode:function(e){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t.indexOf(e);return r<0?o?n.slice(n.indexOf(e)+1).find((function(e){return es(e)})):n.slice(0,n.indexOf(e)).reverse().find((function(e){return es(e)})):t[r+(o?1:-1)]}}})),a.tabbableGroups=a.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),a.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find((function(e){return e.posTabIndexesFound}))&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function e(t){var n=t.activeElement;if(n)return n.shadowRoot&&null!==n.shadowRoot.activeElement?e(n.shadowRoot):n},g=function e(t){!1!==t&&t!==p(document)&&(t&&t.focus?(t.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(d()))},h=function(e){var t=c("setReturnFocus",e);return t||!1!==t&&e},f=function(e){var t=e.target,n=e.event,o=e.isBackward,r=void 0!==o&&o;t=t||hs(n),u();var s=null;if(a.tabbableGroups.length>0){var d=l(t,n),p=d>=0?a.containerGroups[d]:void 0;if(d<0)s=r?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(r){var g=ps(a.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(g<0&&(p.container===t||ns(t,i.tabbableOptions)&&!es(t,i.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(g=d),g>=0){var h=0===g?a.tabbableGroups.length-1:g-1,f=a.tabbableGroups[h];s=Va(t)>=0?f.lastTabbableNode:f.lastDomTabbableNode}else ls(n)||(s=p.nextTabbableNode(t,!1))}else{var m=ps(a.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(m<0&&(p.container===t||ns(t,i.tabbableOptions)&&!es(t,i.tabbableOptions)&&!p.nextTabbableNode(t))&&(m=d),m>=0){var b=m===a.tabbableGroups.length-1?0:m+1,y=a.tabbableGroups[b];s=Va(t)>=0?y.firstTabbableNode:y.firstDomTabbableNode}else ls(n)||(s=p.nextTabbableNode(t))}}else s=c("fallbackFocus");return s},m=function(e){var t=hs(e);l(t,e)>=0||(gs(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):gs(i.allowOutsideClick,e)||e.preventDefault())},b=function(e){var t=hs(e),n=l(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var o;e.stopImmediatePropagation();var r=!0;if(a.mostRecentlyFocusedNode)if(Va(a.mostRecentlyFocusedNode)>0){var s=l(a.mostRecentlyFocusedNode),c=a.containerGroups[s].tabbableNodes;if(c.length>0){var u=c.findIndex((function(e){return e===a.mostRecentlyFocusedNode}));u>=0&&(i.isKeyForward(a.recentNavEvent)?u+1<c.length&&(o=c[u+1],r=!1):u-1>=0&&(o=c[u-1],r=!1))}}else a.containerGroups.some((function(e){return e.tabbableNodes.some((function(e){return Va(e)>0}))}))||(r=!1);else r=!1;r&&(o=f({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),g(o||(a.mostRecentlyFocusedNode||d()))}a.recentNavEvent=void 0},y=function(e){if(!(t=e,"Escape"!==(null==t?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===gs(i.escapeDeactivates,e)))return e.preventDefault(),void n.deactivate();var t;(i.isKeyForward(e)||i.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=f({event:e,isBackward:t});n&&(ls(e)&&e.preventDefault(),g(n))}(e,i.isKeyBackward(e))},v=function(e){var t=hs(e);l(t,e)>=0||gs(i.clickOutsideDeactivates,e)||gs(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(a.active)return as(r,n),a.delayInitialFocusTimer=i.delayInitialFocus?us((function(){g(d())})):g(d()),o.addEventListener("focusin",b,!0),o.addEventListener("mousedown",m,{capture:!0,passive:!1}),o.addEventListener("touchstart",m,{capture:!0,passive:!1}),o.addEventListener("click",v,{capture:!0,passive:!1}),o.addEventListener("keydown",y,{capture:!0,passive:!1}),n},x=function(){if(a.active)return o.removeEventListener("focusin",b,!0),o.removeEventListener("mousedown",m,!0),o.removeEventListener("touchstart",m,!0),o.removeEventListener("click",v,!0),o.removeEventListener("keydown",y,!0),n},k="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(e){e.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===a.mostRecentlyFocusedNode}))}))&&g(d())})):void 0,_=function(){k&&(k.disconnect(),a.active&&!a.paused&&a.containers.map((function(e){k.observe(e,{subtree:!0,childList:!0})})))};return(n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),r=s(e,"checkCanFocusTrap");r||u(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=o.activeElement,null==t||t();var i=function(){r&&u(),w(),_(),null==n||n()};return r?(r(a.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!a.active)return this;var t=rs({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,x(),a.active=!1,a.paused=!1,_(),ss(r,n);var o=s(t,"onDeactivate"),l=s(t,"onPostDeactivate"),c=s(t,"checkCanReturnFocus"),d=s(t,"returnFocus","returnFocusOnDeactivate");null==o||o();var u=function(){us((function(){d&&g(h(a.nodeFocusedBeforeActivation)),null==l||l()}))};return d&&c?(c(h(a.nodeFocusedBeforeActivation)).then(u,u),this):(u(),this)},pause:function(e){if(a.paused||!a.active)return this;var t=s(e,"onPause"),n=s(e,"onPostPause");return a.paused=!0,null==t||t(),x(),_(),null==n||n(),this},unpause:function(e){if(!a.paused||!a.active)return this;var t=s(e,"onUnpause"),n=s(e,"onPostUnpause");return a.paused=!1,null==t||t(),u(),w(),_(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map((function(e){return"string"==typeof e?o.querySelector(e):e})),a.active&&u(),_(),this}}).updateContainerElements(e),n};function bs(e){const t=Oa(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ka(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,s=Zi(n)!==i||Zi(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function ys(e){return xa(e)?e:e.contextElement}function vs(e){const t=ys(e);if(!ka(t))return Qi(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=bs(t);let a=(i?Zi(n.width):n.width)/o,s=(i?Zi(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const ws=Qi(0);function xs(e){const t=ya(e);return Pa()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ws}function ks(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=ys(e);let a=Qi(1);t&&(o?xa(o)&&(a=vs(o)):a=vs(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ya(e))&&t}(i,n,o)?xs(i):Qi(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,d=r.width/a.x,u=r.height/a.y;if(i){const e=ya(i),t=o&&xa(o)?ya(o):o;let n=e,r=n.frameElement;for(;r&&o&&t!==n;){const e=vs(r),t=r.getBoundingClientRect(),o=Oa(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=i,c+=a,n=ya(r),r=n.frameElement}}return ga({width:d,height:u,x:l,y:c})}const _s=[":popover-open",":modal"];function Ts(e){return _s.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Ss(e){return ks(va(e)).left+Aa(e).scrollLeft}function Es(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=ya(e),o=va(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;const e=Pa();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=va(e),n=Aa(e),o=e.ownerDocument.body,r=Xi(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Xi(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Ss(e);const s=-n.scrollTop;return"rtl"===Oa(o).direction&&(a+=Xi(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:s}}(va(e));else if(xa(t))o=function(e,t){const n=ks(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=ka(e)?vs(e):Qi(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=xs(e);o={...t,x:t.x-n.x,y:t.y-n.y}}return ga(o)}function Cs(e,t){const n=$a(e);return!(n===t||!xa(n)||Ia(n))&&("fixed"===Oa(n).position||Cs(n,t))}function Ps(e,t,n){const o=ka(t),r=va(t),i="fixed"===n,a=ks(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Qi(0);if(o||!o&&!i)if(("body"!==ba(t)||Ta(r))&&(s=Aa(t)),o){const e=ks(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&(l.x=Ss(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Is(e){return"static"===Oa(e).position}function Os(e,t){return ka(e)&&"fixed"!==Oa(e).position?t?t(e):e.offsetParent:null}function As(e,t){const n=ya(e);if(Ts(e))return n;if(!ka(e)){let t=$a(e);for(;t&&!Ia(t);){if(xa(t)&&!Is(t))return t;t=$a(t)}return n}let o=Os(e,t);for(;o&&Sa(o)&&Is(o);)o=Os(o,t);return o&&Ia(o)&&Is(o)&&!Ca(o)?n:o||function(e){let t=$a(e);for(;ka(t)&&!Ia(t);){if(Ca(t))return t;if(Ea(t))return null;t=$a(t)}return null}(e)||n}const $s={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,a=va(o),s=!!t&&Ts(t.floating);if(o===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Qi(1);const d=Qi(0),u=ka(o);if((u||!u&&!i)&&(("body"!==ba(o)||Ta(a))&&(l=Aa(o)),ka(o))){const e=ks(o);c=vs(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x,y:n.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:va,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i="clippingAncestors"===n?Ts(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Na(e,[],!1).filter((e=>xa(e)&&"body"!==ba(e))),r=null;const i="fixed"===Oa(e).position;let a=i?$a(e):e;for(;xa(a)&&!Ia(a);){const t=Oa(a),n=Ca(a);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||Ta(a)&&!n&&Cs(e,a))?o=o.filter((e=>e!==a)):r=t,a=$a(a)}return t.set(e,o),o}(t,this._c):[].concat(n),a=[...i,o],s=a[0],l=a.reduce(((e,n)=>{const o=Es(t,n,r);return e.top=Xi(o.top,e.top),e.right=Yi(o.right,e.right),e.bottom=Yi(o.bottom,e.bottom),e.left=Xi(o.left,e.left),e}),Es(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:As,getElementRects:async function(e){const t=this.getOffsetParent||As,n=this.getDimensions,o=await n(e.floating);return{reference:Ps(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=bs(e);return{width:t,height:n}},getScale:vs,isElement:xa,isRTL:function(e){return"rtl"===Oa(e).direction}};function Rs(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=ys(e),d=r||i?[...c?Na(c):[],...Na(t)]:[];d.forEach((e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const u=c&&s?function(e,t){let n,o=null;const r=va(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:c,top:d,width:u,height:p}=e.getBoundingClientRect();if(s||t(),!u||!p)return;const g={rootMargin:-Ji(d)+"px "+-Ji(r.clientWidth-(c+u))+"px "+-Ji(r.clientHeight-(d+p))+"px "+-Ji(c)+"px",threshold:Xi(0,Yi(1,l))||1};let h=!0;function f(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}h=!1}try{o=new IntersectionObserver(f,{...g,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(f,g)}o.observe(e)}(!0),i}(c,n):null;let p,g=-1,h=null;a&&(h=new ResizeObserver((e=>{let[o]=e;o&&o.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let f=l?ks(e):null;return l&&function t(){const o=ks(e);!f||o.x===f.x&&o.y===f.y&&o.width===f.width&&o.height===f.height||n();f=o,p=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach((e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const Ns=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),a=ra(n),s=ia(n),l="y"===la(n),c=["left","top"].includes(a)?-1:1,d=i&&l?-1:1,u=oa(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof h&&(g="end"===s?-1*h:h),l?{x:g*d,y:p*c}:{x:p*c,y:g*d}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}},Ls=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=oa(e,t),c={x:n,y:o},d=await fa(t,l),u=la(ra(r)),p=aa(u);let g=c[p],h=c[u];if(i){const e="y"===p?"bottom":"right";g=na(g+d["y"===p?"top":"left"],g,g-d[e])}if(a){const e="y"===u?"bottom":"right";h=na(h+d["y"===u?"top":"left"],h,h-d[e])}const f=s.fn({...t,[p]:g,[u]:h});return{...f,data:{x:f.x-n,y:f.y-o,enabled:{[p]:i,[u]:a}}}}}},Ds=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=!0,...m}=oa(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const b=ra(r),y=la(s),v=ra(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=p||(v||!f?[ua(s)]:function(e){const t=ua(e);return[da(e),t,da(t)]}(s)),k="none"!==h;!p&&k&&x.push(...function(e,t,n,o){const r=ia(e);let i=function(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:a;default:return[]}}(ra(e),"start"===n,o);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(da)))),i}(s,f,h,w));const _=[s,...x],T=await fa(t,m),S=[];let E=(null==(o=i.flip)?void 0:o.overflows)||[];if(d&&S.push(T[b]),u){const e=function(e,t,n){void 0===n&&(n=!1);const o=ia(e),r=ca(e),i=sa(r);let a="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ua(a)),[a,ua(a)]}(r,a,w);S.push(T[e[0]],T[e[1]])}if(E=[...E,{placement:r,overflows:S}],!S.every((e=>e<=0))){var C,P;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=_[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let n=null==(P=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(g){case"bestFit":{var I;const e=null==(I=E.filter((e=>{if(k){const t=la(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:I[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},Ms=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=oa(e,t),d=await fa(t,c),u=ra(r),p=ia(r),g="y"===la(r),{width:h,height:f}=i.floating;let m,b;"top"===u||"bottom"===u?(m=u,b=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,m="end"===p?"top":"bottom");const y=f-d.top-d.bottom,v=h-d.left-d.right,w=Yi(f-d[m],y),x=Yi(h-d[b],v),k=!t.middlewareData.shift;let _=w,T=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(T=v),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(_=y),k&&!p){const e=Xi(d.left,0),t=Xi(d.right,0),n=Xi(d.top,0),o=Xi(d.bottom,0);g?T=h-2*(0!==e||0!==t?e+t:Xi(d.left,d.right)):_=f-2*(0!==n||0!==o?n+o:Xi(d.top,d.bottom))}await l({...t,availableWidth:T,availableHeight:_});const S=await a.getDimensions(s.floating);return h!==S.width||f!==S.height?{reset:{rects:!0}}:{}}}},Us=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=oa(e,t)||{};if(null==c)return{};const u=pa(d),p={x:n,y:o},g=ca(r),h=sa(g),f=await a.getDimensions(c),m="y"===g,b=m?"top":"left",y=m?"bottom":"right",v=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[g]-p[g]-i.floating[h],x=p[g]-i.reference[g],k=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let _=k?k[v]:0;_&&await(null==a.isElement?void 0:a.isElement(k))||(_=s.floating[v]||i.floating[h]);const T=w/2-x/2,S=_/2-f[h]/2-1,E=Yi(u[b],S),C=Yi(u[y],S),P=E,I=_-f[h]-C,O=_/2-f[h]/2+T,A=na(P,O,I),$=!l.arrow&&null!=ia(r)&&O!==A&&i.reference[h]/2-(O<P?E:C)-f[h]/2<0,R=$?O<P?O-P:O-I:0;return{[g]:p[g]+R,data:{[g]:A,centerOffset:O-A-R,...$&&{alignmentOffset:R}},reset:$}}}),Bs=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=oa(e,t),d={x:n,y:o},u=la(r),p=aa(u);let g=d[p],h=d[u];const f=oa(s,t),m="number"==typeof f?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+m.mainAxis,n=i.reference[p]+i.reference[e]-m.mainAxis;g<t?g=t:g>n&&(g=n)}if(c){var b,y;const e="y"===p?"width":"height",t=["top","left"].includes(ra(r)),n=i.reference[u]-i.floating[e]+(t&&(null==(b=a.offset)?void 0:b[u])||0)+(t?0:m.crossAxis),o=i.reference[u]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[u])||0)-(t?m.crossAxis:0);h<n?h=n:h>o&&(h=o)}return{[p]:g,[u]:h}}}},Fs=(e,t,n)=>{const o=new Map,r={platform:$s,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=ha(c,o,l),p=o,g={},h=0;for(let n=0;n<s.length;n++){const{name:i,fn:f}=s[n],{x:m,y:b,data:y,reset:v}=await f({x:d,y:u,initialPlacement:o,placement:p,strategy:r,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=m?m:d,u=null!=b?b:u,g={...g,[i]:{...g[i],...y}},v&&h<=50&&(h++,"object"==typeof v&&(v.placement&&(p=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):v.rects),({x:d,y:u}=ha(c,p,l))),n=-1)}return{x:d,y:u,placement:p,strategy:r,middlewareData:g}})(e,t,{...r,platform:i})};function js(e=0,t=0,n=0,o=0){if("function"==typeof DOMRect)return new DOMRect(e,t,n,o);const r={x:e,y:t,width:n,height:o,top:t,right:e+n,bottom:t+o,left:e};return{...r,toJSON:()=>r}}function zs(e,t){return{contextElement:Yr(e)?e:void 0,getBoundingClientRect:()=>{const n=e,o=t?.(n);return o||!n?function(e){if(!e)return js();const{x:t,y:n,width:o,height:r}=e;return js(t,n,o,r)}(o):n.getBoundingClientRect()}}}var Hs=e=>({variable:e,reference:`var(${e})`}),Vs={arrowSize:Hs("--arrow-size"),arrowSizeHalf:Hs("--arrow-size-half"),arrowBg:Hs("--arrow-background"),transformOrigin:Hs("--transform-origin"),arrowOffset:Hs("--arrow-offset")},Gs={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){const{arrow:o}=n,r=(e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}))(o)[e],{floating:i}=t;return i.style.setProperty(Vs.transformOrigin.variable,r),{data:{transformOrigin:r}}}},Ws={name:"rects",fn:({rects:e})=>({data:e})},qs=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:o,y:r}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:null!=o?`${o}px`:"",top:null!=r?`${r}px`:"",[i]:`calc(100% + ${Vs.arrowOffset.reference})`}),{}}}};var Ks={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function Ys(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Xs(e){return Ai(e.boundary)}function Zs(e,t){if(e)return Us({element:e,padding:t.arrowPadding})}function Js(e,t){if(null!=(t.offset??t.gutter))return Ns((({placement:n})=>{const o=(e?.clientHeight||0)/2,r=t.offset?.mainAxis??t.gutter,i="number"==typeof r?r+o:r??o,{hasAlign:a}=function(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:null!=n}}(n),s=a?void 0:t.shift;return Mi({crossAxis:t.offset?.crossAxis??s,mainAxis:i,alignmentAxis:t.shift})}))}function Qs(e){if(e.flip)return Ds({boundary:Xs(e),padding:e.overflowPadding,fallbackPlacements:!0===e.flip?void 0:e.flip})}function el(e){if(e.slide||e.overlap)return Ls({boundary:Xs(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Bs()})}function tl(e){return Ms({padding:e.overflowPadding,apply({elements:e,rects:t,availableHeight:n,availableWidth:o}){const r=e.floating,i=Math.round(t.reference.width);o=Math.floor(o),n=Math.floor(n),r.style.setProperty("--reference-width",`${i}px`),r.style.setProperty("--available-width",`${o}px`),r.style.setProperty("--available-height",`${n}px`)}})}function nl(e,t,n={}){const{defer:o,...r}=n,i=o?wi:e=>e(),a=[];return a.push(i((()=>{const n="function"==typeof e?e():e,o="function"==typeof t?t():t;a.push(function(e,t,n={}){const o=zs(e,n.getAnchorRect);if(!t||!o)return;const r=Object.assign({},Ks,n),i=t.querySelector("[data-part=arrow]"),a=[Js(i,r),Qs(r),el(r),Zs(i,r),qs(i),Gs,tl(r),Ws],{placement:s,strategy:l,onComplete:c,onPositioned:d}=r,u=async()=>{if(!o||!t)return;const e=await Fs(o,t,{placement:s,middleware:a,strategy:l});c?.(e),d?.({placed:!0});const n=Qr(t),r=Ys(n,e.x),i=Ys(n,e.y);t.style.setProperty("--x",`${r}px`),t.style.setProperty("--y",`${i}px`);const u=t.firstElementChild;if(u){const e=n.getComputedStyle(u).zIndex;t.style.setProperty("--z-index",e)}},p=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:u}),d?.({placed:!0})):await u()},g=function(e){return e?!0===e?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}(r.listeners),h=r.listeners?Rs(o,t,p,g):$i;return p(),()=>{h?.(),d?.({placed:!1})}}(n,o,r))}))),()=>{a.forEach((e=>e?.()))}}var ol={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};var rl="pointerdown.outside",il="focus.outside";function al(e){for(const t of e)if(Yr(t)&&gi(t))return!0;return!1}var sl=e=>"clientY"in e;function ll(e,t){const{exclude:n,onFocusOutside:o,onPointerDownOutside:r,onInteractOutside:i,defer:a}=t;if(!e)return;const s=Jr(e),l=function(e){const t={each(t){for(let n=0;n<e.frames?.length;n+=1){const o=e.frames[n];o&&t(o)}},addEventListener:(e,n,o)=>(t.each((t=>{try{t.document.addEventListener(e,n,o)}catch{}})),()=>{try{t.removeEventListener(e,n,o)}catch{}}),removeEventListener(e,n,o){t.each((t=>{try{t.document.removeEventListener(e,n,o)}catch{}}))}};return t}(Qr(e));function c(t){const o=oi(t);return!!Yr(o)&&(!Zr(e,o)&&(!function(e,t){if(!sl(t)||!e)return!1;const n=e.getBoundingClientRect();return 0!==n.width&&0!==n.height&&n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}(e,t)&&(!function(e){const t=oi(e);if(!t||!sl(e))return!1;const n=t.scrollHeight>t.clientHeight&&e.clientX>t.clientWidth,o=t.scrollWidth>t.clientWidth&&e.clientY>t.clientHeight;return n||o}(t)&&!n?.(o))))}let d;function u(t){function n(){const n=a?wi:e=>e(),o=t.composedPath?.()??[t.target];n((()=>{if(e&&c(t)){if(r||i){const t=Ri(r,i);e.addEventListener(rl,t,{once:!0})}Vi(e,rl,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:zi(t),focusable:al(o)}})}}))}"touch"===t.pointerType?(l.removeEventListener("click",n),s.removeEventListener("click",n),d=n,s.addEventListener("click",n,{once:!0}),l.addEventListener("click",n,{once:!0})):n()}const p=new Set,g=setTimeout((()=>{p.add(l.addEventListener("pointerdown",u,!0)),p.add(Fi(s,"pointerdown",u,!0))}),0);function h(t){(a?wi:e=>e())((()=>{if(e&&c(t)){if(o||i){const t=Ri(o,i);e.addEventListener(il,t,{once:!0})}Vi(e,il,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:!1,focusable:gi(oi(t))}})}}))}return p.add(Fi(s,"focusin",h,!0)),p.add(l.addEventListener("focusin",h,!0)),()=>{clearTimeout(g),d&&(l.removeEventListener("click",d),s.removeEventListener("click",d)),p.forEach((e=>e()))}}function cl(e,t){const{defer:n}=t,o=n?wi:e=>e(),r=[];return r.push(o((()=>{const n="function"==typeof e?e():e;r.push(ll(n,t))}))),()=>{r.forEach((e=>e?.()))}}function dl(e,t){return Fi(Jr(e),"keydown",(e=>{"Escape"===e.key&&(e.isComposing||t?.(e))}),{capture:!0})}var ul,pl={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter((e=>e.pointerBlocking))},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){return this.indexOf(e)<(this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1)},isTopMost(e){const t=this.layers[this.count()-1];return t?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some((e=>Zr(e.node,t)))},isInBranch(e){return Array.from(this.branches).some((t=>Zr(t,e)))},add(e){const t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(!(t<0)){if(t<this.count()-1){this.getNestedLayers(e).forEach((e=>e.dismiss()))}this.layers.splice(t,1),e.style.removeProperty("--layer-index")}},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex((t=>t.node===e))},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}};function gl(){pl.layers.forEach((({node:e})=>{e.style.pointerEvents=pl.isBelowPointerBlockingLayer(e)?"none":"auto"}))}function hl(e,t){const n=Jr(e),o=[];if(pl.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(ul=document.body.style.pointerEvents,queueMicrotask((()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")}))),t){const e=Pi(t,(e=>{o.push(Ei(e,{pointerEvents:"auto"}))}));o.push(e)}return()=>{pl.hasPointerBlockingLayer()||(queueMicrotask((()=>{n.body.style.pointerEvents=ul,n.body.removeAttribute("data-inert"),0===n.body.style.length&&n.body.removeAttribute("style")})),o.forEach((e=>e())))}}function fl(e,t){const{defer:n}=t,o=n?wi:e=>e(),r=[];return r.push(o((()=>{const n=Di(e)?e():e;r.push(function(e,t){if(!e)return void Bi("[@zag-js/dismissable] node is `null` or `undefined`");const{onDismiss:n,pointerBlocking:o,exclude:r,debug:i}=t,a={dismiss:n,node:e,pointerBlocking:o};pl.add(a),gl();const s=[o?hl(e,t.persistentElements):void 0,dl(e,(function(o){pl.isTopMost(e)&&(t.onEscapeKeyDown?.(o),!o.defaultPrevented&&n&&(o.preventDefault(),n()))})),cl(e,{exclude:function(n){if(!e)return!1;const o="function"==typeof r?r():r,i=Array.isArray(o)?o:[o],a=t.persistentElements?.map((e=>e())).filter(Yr);return a&&i.push(...a),i.some((e=>Zr(e,n)))||pl.isInNestedLayer(e,n)},onFocusOutside:function(e){const o=oi(e.detail.originalEvent);pl.isInBranch(o)||(t.onFocusOutside?.(e),t.onInteractOutside?.(e),e.defaultPrevented||(i&&console.log("onFocusOutside:",e.detail.originalEvent),n?.()))},onPointerDownOutside:function(o){const r=oi(o.detail.originalEvent);pl.isBelowPointerBlockingLayer(e)||pl.isInBranch(r)||(t.onPointerDownOutside?.(o),t.onInteractOutside?.(o),o.defaultPrevented||(i&&console.log("onPointerDownOutside:",o.detail.originalEvent),n?.()))},defer:t.defer})];return()=>{pl.remove(e),gl(),function(e){e.style.pointerEvents=""}(e),s.forEach((e=>e?.()))}}(n,t))}))),()=>{r.forEach((e=>e?.()))}}function ml(e){return e?.animationName||"none"}gr()(["onExitComplete","present","immediate"]);var bl=new WeakMap,yl=[];function vl(e,t={}){const{defer:n}=t,o=n?wi:e=>e(),r=[];return r.push(o((()=>{const n="function"==typeof e?e():e;r.push(function(e,t={}){const{rootEl:n}=t,o=e.filter(Boolean);if(0===o.length)return;const r=o[0].ownerDocument||document,i=r.defaultView??window,a=new Set(o),s=new Set,l=n??r.body;let c=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-zag-top-layer]"))a.add(t);let t=e=>{if(a.has(e)||s.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of a)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=r.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),o=t(e);if(o===NodeFilter.FILTER_ACCEPT&&d(e),o!==NodeFilter.FILTER_REJECT){let e=n.nextNode();for(;null!=e;)d(e),e=n.nextNode()}},d=e=>{let t=bl.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),s.add(e),bl.set(e,t+1))};yl.length&&yl[yl.length-1].disconnect(),c(l);const u=new i.MutationObserver((e=>{for(let t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...a,...s].some((e=>e.contains(t.target)))){for(let e of t.removedNodes)e instanceof i.Element&&(a.delete(e),s.delete(e));for(let e of t.addedNodes)!(e instanceof i.HTMLElement||e instanceof i.SVGElement)||"true"!==e.dataset.liveAnnouncer&&"true"!==e.dataset.zagTopLayer?e instanceof i.Element&&c(e):a.add(e)}}));u.observe(l,{childList:!0,subtree:!0});let p={observe(){u.observe(l,{childList:!0,subtree:!0})},disconnect(){u.disconnect()}};return yl.push(p),()=>{u.disconnect();for(let e of s){let t=bl.get(e);1===t?(e.removeAttribute("aria-hidden"),bl.delete(e)):bl.set(e,t-1)}p===yl[yl.length-1]?(yl.pop(),yl.length&&yl[yl.length-1].observe()):yl.splice(yl.indexOf(p),1)}}(n,t))}))),()=>{r.forEach((e=>e?.()))}}var wl="data-zag-scroll-lock";function xl(e,t){if(!e)return;const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function kl(e){const t=e??document,n=t.defaultView??window,{documentElement:o,body:r}=t;if(r.hasAttribute(wl))return;r.setAttribute(wl,"");const i=n.innerWidth-o.clientWidth,a=function(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}(o),s=[function(e,t,n){if(!e)return;const o=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{o?e.style.setProperty(t,o):e.style.removeProperty(t)}}(o,"--scrollbar-width",`${i}px`),ti(/iP(hone|ad|od)|iOS/)?(()=>{const{scrollX:e,scrollY:t,visualViewport:o}=n,s=o?.offsetLeft??0,l=o?.offsetTop??0,c=xl(r,{position:"fixed",overflow:"hidden",top:-(t-Math.floor(l))+"px",left:-(e-Math.floor(s))+"px",right:"0",[a]:`${i}px`});return()=>{c?.(),n.scrollTo({left:e,top:t,behavior:"instant"})}})():xl(r,{overflow:"hidden",[a]:`${i}px`})];return()=>{s.forEach((e=>e?.())),r.removeAttribute(wl)}}var _l=Gr("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger").build(),Tl=_i({getPositionerId:e=>e.ids?.positioner??`dialog:${e.id}:positioner`,getBackdropId:e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,getContentId:e=>e.ids?.content??`dialog:${e.id}:content`,getTriggerId:e=>e.ids?.trigger??`dialog:${e.id}:trigger`,getTitleId:e=>e.ids?.title??`dialog:${e.id}:title`,getDescriptionId:e=>e.ids?.description??`dialog:${e.id}:description`,getCloseTriggerId:e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,getContentEl:e=>Tl.getById(e,Tl.getContentId(e)),getPositionerEl:e=>Tl.getById(e,Tl.getPositionerId(e)),getBackdropEl:e=>Tl.getById(e,Tl.getBackdropId(e)),getTriggerEl:e=>Tl.getById(e,Tl.getTriggerId(e)),getTitleEl:e=>Tl.getById(e,Tl.getTitleId(e)),getDescriptionEl:e=>Tl.getById(e,Tl.getDescriptionId(e)),getCloseTriggerEl:e=>Tl.getById(e,Tl.getCloseTriggerId(e))});function Sl(e){const t=Mi(e);return sr({id:"dialog",initial:t.open?"open":"closed",context:{role:"dialog",renderedElements:{title:!0,description:!0},modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!0,closeOnEscape:!0,restoreFocus:!0,...t},created:["checkInitialFocusEl"],watch:{open:["toggleVisibility"]},states:{open:{entry:["checkRenderedElements","syncZIndex"],activities:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}}},{guards:{isOpenControlled:e=>!!e["open.controlled"]},activities:{trackDismissableElement:(e,t,{send:n})=>fl((()=>Tl.getContentEl(e)),{defer:!0,pointerBlocking:e.modal,exclude:[Tl.getTriggerEl(e)],onInteractOutside(t){e.onInteractOutside?.(t),e.closeOnInteractOutside&&"alertdialog"!==e.role||t.preventDefault()},persistentElements:e.persistentElements,onFocusOutside:e.onFocusOutside,onPointerDownOutside:e.onPointerDownOutside,onEscapeKeyDown(t){e.onEscapeKeyDown?.(t),e.closeOnEscape?n({type:"CLOSE",src:"escape-key"}):t.preventDefault()},onDismiss(){n({type:"CLOSE",src:"interact-outside"})}}),preventScroll(e){if(e.preventScroll)return kl(Tl.getDoc(e))},trapFocus(e){if(!e.trapFocus||!e.modal)return;let t;const n=function(e){const t=new Set;function n(e){const n=globalThis.requestAnimationFrame(e);t.add((()=>globalThis.cancelAnimationFrame(n)))}return n((()=>n(e))),function(){t.forEach((e=>e()))}}((()=>{const n=Tl.getContentEl(e);if(n){t=ms(n,{document:Tl.getDoc(e),escapeDeactivates:!1,preventScroll:!0,returnFocusOnDeactivate:!1,fallbackFocus:n,allowOutsideClick:!0,initialFocus:mi({root:n,getInitialEl:e.initialFocusEl})});try{t.activate()}catch{}}}));return()=>{t?.deactivate(),n()}},hideContentBelow(e){if(!e.modal)return;return vl((()=>[Tl.getContentEl(e)]),{defer:!0})}},actions:{checkInitialFocusEl(e){e.initialFocusEl||"alertdialog"!==e.role||(e.initialFocusEl=()=>Tl.getCloseTriggerEl(e))},checkRenderedElements(e){wi((()=>{e.renderedElements.title=!!Tl.getTitleEl(e),e.renderedElements.description=!!Tl.getDescriptionEl(e)}))},syncZIndex(e){wi((()=>{const t=Tl.getContentEl(e);if(!t)return;const n=Tl.getWin(e).getComputedStyle(t);[Tl.getPositionerEl(e),Tl.getBackdropEl(e)].forEach((e=>{e?.style.setProperty("--z-index",n.zIndex)}))}))},invokeOnClose(e){e.onOpenChange?.({open:!1})},invokeOnOpen(e){e.onOpenChange?.({open:!0})},toggleVisibility(e,t,{send:n}){n({type:e.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})},setFinalFocus(e){e.restoreFocus&&queueMicrotask((()=>{const t=e.finalFocusEl?.()??Tl.getTriggerEl(e);t?.focus({preventScroll:!0})}))}}})}gr()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);var El=(e,t)=>({x:e,y:t});function Cl(e,t){const n=function(e){const{x:t,y:n,width:o,height:r}=e,i=t+o/2,a=n+r/2;return{x:t,y:n,width:o,height:r,minX:t,minY:n,maxX:t+o,maxY:n+r,midX:i,midY:a,center:El(i,a)}}(e),{top:o,right:r,left:i,bottom:a}={top:El((s=n).minX,s.minY),right:El(s.maxX,s.minY),bottom:El(s.maxX,s.maxY),left:El(s.minX,s.maxY)};var s;const[l]=t.split("-");return{top:[i,o,r,a],right:[o,r,a,i],bottom:[o,i,a,r],left:[r,o,i,a]}[l]}var Pl=Gr("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem").build(),Il=_i({getTriggerId:e=>e.ids?.trigger??`menu:${e.id}:trigger`,getContextTriggerId:e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,getContentId:e=>e.ids?.content??`menu:${e.id}:content`,getArrowId:e=>e.ids?.arrow??`menu:${e.id}:arrow`,getPositionerId:e=>e.ids?.positioner??`menu:${e.id}:popper`,getGroupId:(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,getGroupLabelId:(e,t)=>e.ids?.label?.(t)??`menu:${e.id}:label:${t}`,getContentEl:e=>Il.getById(e,Il.getContentId(e)),getPositionerEl:e=>Il.getById(e,Il.getPositionerId(e)),getTriggerEl:e=>Il.getById(e,Il.getTriggerId(e)),getHighlightedItemEl:e=>e.highlightedValue?Il.getById(e,e.highlightedValue):null,getArrowEl:e=>Il.getById(e,Il.getArrowId(e)),getElements:e=>{const t=`[role^="menuitem"][data-ownedby=${CSS.escape(Il.getContentId(e))}]:not([data-disabled])`;return ki(Il.getContentEl(e),t)},getFirstEl:e=>Il.getElements(e)[0],getLastEl:e=>{return(t=Il.getElements(e))[t.length-1];var t},getNextEl:(e,t)=>function(e,t,n=!0){let o=si(e,t);return o=n?(o+1)%e.length:Math.min(o+1,e.length-1),e[o]}(Il.getElements(e),e.highlightedValue,t??e.loopFocus),getPrevEl:(e,t)=>function(e,t,n=!0){let o=si(e,t);return-1===o?n?e[e.length-1]:null:(o=n?(o-1+e.length)%e.length:Math.max(0,o-1),e[o])}(Il.getElements(e),e.highlightedValue,t??e.loopFocus),getElemByKey:(e,t)=>di(Il.getElements(e),{state:e.typeaheadState,key:t,activeId:e.highlightedValue}),isTargetDisabled:e=>Yr(e)&&(""===e.dataset.disabled||e.hasAttribute("disabled")),isTriggerItem:e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),getOptionFromItemEl:e=>({id:e.id,name:e.dataset.name,value:e.dataset.value,valueText:e.dataset.valueText,type:e.dataset.type})});function Ol(e,t,n){const o=e.context.isSubmenu,r=e.context.isTypingAhead,i=e.context.composite,a=e.hasTag("open"),s=function(e={}){const{placement:t,sameWidth:n,fitViewport:o,strategy:r="absolute"}=e;return{arrow:{position:"absolute",width:Vs.arrowSize.reference,height:Vs.arrowSize.reference,[Vs.arrowSizeHalf.variable]:`calc(${Vs.arrowSize.reference} / 2)`,[Vs.arrowOffset.variable]:`calc(${Vs.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?ol[t.split("-")[0]]:void 0,background:Vs.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:r,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:o?"var(--available-width)":void 0,maxHeight:o?"var(--available-height)":void 0,top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}({...e.context.positioning,placement:e.context.anchorPoint?"bottom":e.context.currentPlacement});function l(t){return{disabled:!!t.disabled,highlighted:e.context.highlightedValue===t.value}}function c(e){const t=e.valueText??e.value;return{...e,id:e.value,valueText:t}}function d(e){return{...l(c(e)),checked:!!e.checked}}function u(o){const{value:r,closeOnSelect:i,valueText:a}=o,s=l(o);return n.element({...Pl.item.attrs,id:r,role:"menuitem","aria-disabled":s.disabled,"data-disabled":Kr(s.disabled),"data-ownedby":Il.getContentId(e.context),"data-highlighted":Kr(s.highlighted),"data-valuetext":a,onDragStart(e){e.currentTarget.matches("a[href]")&&e.preventDefault()},onPointerMove(e){if(s.disabled)return;if("mouse"!==e.pointerType)return;const n=e.currentTarget;s.highlighted||t({type:"ITEM_POINTERMOVE",id:r,target:n,closeOnSelect:i})},onPointerLeave(n){if(s.disabled)return;if("mouse"!==n.pointerType)return;if(!e.previousEvent.type.includes("POINTER"))return;const o=n.currentTarget;t({type:"ITEM_POINTERLEAVE",id:r,target:o,closeOnSelect:i})},onPointerDown(e){if(s.disabled)return;const n=e.currentTarget;t({type:"ITEM_POINTERDOWN",target:n,id:r,closeOnSelect:i})},onPointerUp(e){if(ii(e))return;if(ri(e))return;if(s.disabled)return;if(!ji(e))return;const n=e.currentTarget;t({type:"ITEM_CLICK",src:"pointerup",target:n,id:r,closeOnSelect:i}),"touch"===e.pointerType&&Hi(n)},onTouchEnd(e){e.preventDefault(),e.stopPropagation()}})}return{highlightedValue:e.context.highlightedValue,open:a,setOpen(e){e!==a&&t(e?"OPEN":"CLOSE")},setHighlightedValue(e){t({type:"HIGHLIGHTED.SET",id:e})},setParent(e){t({type:"PARENT.SET",value:e,id:e.state.context.id})},setChild(e){t({type:"CHILD.SET",value:e,id:e.state.context.id})},reposition(e={}){t({type:"POSITIONING.SET",options:e})},getContextTriggerProps:()=>n.element({...Pl.contextTrigger.attrs,dir:e.context.dir,id:Il.getContextTriggerId(e.context),onPointerDown(e){if("mouse"===e.pointerType)return;const n=Ki(e);t({type:"CONTEXT_MENU_START",point:n})},onPointerCancel(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onPointerMove(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onPointerUp(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onContextMenu(e){const n=Ki(e);t({type:"CONTEXT_MENU",point:n}),e.preventDefault()},style:{WebkitTouchCallout:"none",userSelect:"none"}}),getTriggerItemProps:e=>pr(u({value:e.getTriggerProps().id}),e.getTriggerProps()),getTriggerProps:()=>n.button({...o?Pl.triggerItem.attrs:Pl.trigger.attrs,"data-placement":e.context.currentPlacement,type:"button",dir:e.context.dir,id:Il.getTriggerId(e.context),"data-uid":e.context.id,"aria-haspopup":i?"menu":"dialog","aria-controls":Il.getContentId(e.context),"aria-expanded":a||void 0,"data-state":a?"open":"closed",onPointerMove(e){if("mouse"!==e.pointerType)return;!Il.isTargetDisabled(e.currentTarget)&&o&&t({type:"TRIGGER_POINTERMOVE",target:e.currentTarget})},onPointerLeave(e){if("mouse"!==e.pointerType)return;if(Il.isTargetDisabled(e.currentTarget)||!o)return;const n=Ki(e);t({type:"TRIGGER_POINTERLEAVE",target:e.currentTarget,point:n})},onClick(e){Il.isTriggerItem(e.currentTarget)&&t({type:"TRIGGER_CLICK",target:e.currentTarget})},onPointerDown(e){const n=Il.isTargetDisabled(e.currentTarget);!ji(e)||n||zi(e)||(e.preventDefault(),Il.isTriggerItem(e.currentTarget)||t({type:"TRIGGER_CLICK",target:e.currentTarget}))},onBlur(){t("TRIGGER_BLUR")},onFocus(){t("TRIGGER_FOCUS")},onKeyDown(n){if(n.defaultPrevented)return;const o={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},Enter(){t({type:"ARROW_DOWN",src:"enter"})},Space(){t({type:"ARROW_DOWN",src:"space"})}}[qi(n,e.context)];o&&(n.preventDefault(),o(n))}}),getIndicatorProps:()=>n.element({...Pl.indicator.attrs,dir:e.context.dir,"data-state":a?"open":"closed"}),getPositionerProps:()=>n.element({...Pl.positioner.attrs,dir:e.context.dir,id:Il.getPositionerId(e.context),style:s.floating}),getArrowProps:()=>n.element({id:Il.getArrowId(e.context),...Pl.arrow.attrs,dir:e.context.dir,style:s.arrow}),getArrowTipProps:()=>n.element({...Pl.arrowTip.attrs,dir:e.context.dir,style:s.arrowTip}),getContentProps:()=>n.element({...Pl.content.attrs,id:Il.getContentId(e.context),"aria-label":e.context["aria-label"],hidden:!a,"data-state":a?"open":"closed",role:i?"menu":"dialog",tabIndex:0,dir:e.context.dir,"aria-activedescendant":e.context.highlightedValue??void 0,"aria-labelledby":Il.getTriggerId(e.context),"data-placement":e.context.currentPlacement,onPointerEnter(e){"mouse"===e.pointerType&&t("MENU_POINTERENTER")},onKeyDown(n){if(n.defaultPrevented)return;if(!(e=>Zr(e.currentTarget,oi(e)))(n))return;const o=oi(n);if(!(o?.closest("[role=menu]")===n.currentTarget||o===n.currentTarget))return;if("Tab"===n.key){if(!bi(n))return void n.preventDefault()}const i=Il.getHighlightedItemEl(e.context),a={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},ArrowLeft(){t("ARROW_LEFT")},ArrowRight(){t("ARROW_RIGHT")},Enter(){t("ENTER"),Hi(i)},Space(e){r?t({type:"TYPEAHEAD",key:e.key}):a.Enter?.(e)},Home(){t("HOME")},End(){t("END")}},s=qi(n,{dir:e.context.dir}),l=a[s];if(l)return l(n),n.stopPropagation(),void n.preventDefault();var c;e.context.typeahead&&(1!==(c=n).key.length||c.ctrlKey||c.metaKey||(e=>e.ctrlKey||e.altKey||e.metaKey)(n)||yi(o)||(t({type:"TYPEAHEAD",key:n.key}),n.preventDefault()))}}),getSeparatorProps:()=>n.element({...Pl.separator.attrs,role:"separator",dir:e.context.dir,"aria-orientation":"horizontal"}),getItemState:l,getItemProps:u,getOptionItemState:d,getOptionItemProps(o){const{type:r,disabled:i,onCheckedChange:a,closeOnSelect:s}=o,l=c(o),p=d(o);return{...u(l),...n.element({"data-type":r,...Pl.item.attrs,dir:e.context.dir,"data-value":l.value,role:`menuitem${r}`,"aria-checked":!!p.checked,"data-state":p.checked?"checked":"unchecked",onPointerUp(e){if(!ji(e)||i)return;if(ii(e))return;if(ri(e))return;const n=e.currentTarget;t({type:"ITEM_CLICK",src:"pointerup",target:n,option:l,closeOnSelect:s}),a?.(!p.checked)}})}},getItemIndicatorProps(t){const o=d(t);return n.element({...Pl.itemIndicator.attrs,dir:e.context.dir,"data-disabled":Kr(o.disabled),"data-highlighted":Kr(o.highlighted),"data-state":o.checked?"checked":"unchecked",hidden:!o.checked})},getItemTextProps(t){const o=d(t);return n.element({...Pl.itemText.attrs,dir:e.context.dir,"data-disabled":Kr(o.disabled),"data-highlighted":Kr(o.highlighted),"data-state":o.checked?"checked":"unchecked"})},getItemGroupLabelProps:t=>n.element({id:Il.getGroupLabelId(e.context,t.htmlFor),dir:e.context.dir,...Pl.itemGroupLabel.attrs}),getItemGroupProps:t=>n.element({id:Il.getGroupId(e.context,t.id),...Pl.itemGroup.attrs,dir:e.context.dir,"aria-labelledby":Il.getGroupLabelId(e.context,t.id),role:"group"})}}var{not:Al,and:$l,or:Rl}=tr;function Nl(e){let t=e.parent;for(;t&&t.state.context.isSubmenu;)t=t.state.context.parent;t?.send("CLOSE")}var Ll={highlighted(e,t){Oi(e.highlightedValue,t)||(e.highlightedValue=t,e.onHighlightChange?.({highlightedValue:t}))}};gr()(["anchorPoint","aria-label","closeOnSelect","dir","getRootNode","highlightedValue","id","ids","loopFocus","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onEscapeKeyDown","onSelect","onHighlightChange","open","open.controlled","positioning","typeahead","composite"]),gr()(["closeOnSelect","disabled","value","valueText"]),gr()(["htmlFor"]),gr()(["id"]),gr()(["disabled","valueText","closeOnSelect","type","value","checked","onCheckedChange"]);var Dl=Gr("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange").build(),Ml=_i({getRootId:e=>e.ids?.root??`progress-${e.id}`,getTrackId:e=>e.ids?.track??`progress-${e.id}-track`,getLabelId:e=>e.ids?.label??`progress-${e.id}-label`,getCircleId:e=>e.ids?.circle??`progress-${e.id}-circle`});function Ul(e,t){return e+(t-e)/2}function Bl(e){const t=Mi(e);return sr({id:"progress",initial:"idle",context:{max:t.max??100,min:t.min??0,value:Ul(t.min??0,t.max??100),orientation:"horizontal",translations:{value:({percent:e})=>-1===e?"loading...":`${e} percent`,...t.translations},...t},created:["validateContext"],computed:{isIndeterminate:e=>null===e.value,percent:e=>Li(e.value)?Math.round((e.value-e.min)/(e.max-e.min)*100):-1,isAtMax:e=>e.value===e.max,isHorizontal:e=>"horizontal"===e.orientation,isRtl:e=>"rtl"===e.dir},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}}},{actions:{setValue:(e,t)=>{e.value=null===t.value?null:Math.max(0,Math.min(t.value,e.max))},validateContext:e=>{if(null!=e.value){if(!Fl(e.max))throw new Error(`[progress] The max value passed \`${e.max}\` is not a valid number`);if(!function(e,t){return Fl(e)&&e<=t}(e.value,e.max))throw new Error(`[progress] The value passed \`${e.value}\` exceeds the max value \`${e.max}\``);if(!function(e,t){return Fl(e)&&e>=t}(e.value,e.min))throw new Error(`[progress] The value passed \`${e.value}\` exceeds the min value \`${e.min}\``)}}}})}function Fl(e){return Li(e)&&!isNaN(e)}gr()(["dir","getRootNode","id","ids","max","min","orientation","translations","value"]);var jl=Gr("toast").parts("group","root","title","description","actionTrigger","closeTrigger").build(),zl=_i({getRegionId:e=>`toast-group:${e}`,getRegionEl:(e,t)=>zl.getById(e,`toast-group:${t}`),getRootId:e=>`toast:${e.id}`,getRootEl:e=>zl.getById(e,zl.getRootId(e)),getTitleId:e=>`toast:${e.id}:title`,getDescriptionId:e=>`toast:${e.id}:description`,getCloseTriggerId:e=>`toast${e.id}:close`});function Hl(e,t){return e.filter((e=>e.state.context.placement===t))}var Vl={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function Gl(e,t){return e??Vl[t]??Vl.DEFAULT}function Wl(e,t){const n=e.offsets,o="string"==typeof n?{left:n,right:n,bottom:n,top:n}:n,r="rtl"===e.dir,i=t.replace("-start",r?"-right":"-left").replace("-end",r?"-left":"-right"),a=i.includes("right"),s=i.includes("left"),l={position:"fixed",pointerEvents:e.count>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${e.gap}px`,"--first-height":`${e.heights[0]?.height||0}px`,zIndex:2147483647};let c="center";if(a&&(c="flex-end"),s&&(c="flex-start"),l.alignItems=c,i.includes("top")){const e=o.top;l.top=`max(env(safe-area-inset-top, 0px), ${e})`}if(i.includes("bottom")){const e=o.bottom;l.bottom=`max(env(safe-area-inset-bottom, 0px), ${e})`}if(!i.includes("left")){const e=o.right;l.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${e})`}if(!i.includes("right")){const e=o.left;l.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${e})`}return l}function ql(e,t){const[n]=e.placement.split("-"),o=!e.frontmost,r=!e.stacked,i={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${e.removeDelay}ms`,"--duration":`${"loading"===e.type?Number.MAX_SAFE_INTEGER:e.duration}ms`,"--initial-height":`${e.height}px`,"--offset":`${e.offset}px`,"--index":e.index,"--z-index":e.zIndex,"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},a=e=>Object.assign(i,e);return"top"===n?a({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):"bottom"===n&&a({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),e.mounted&&(a({"--y":"0","--opacity":"1"}),e.stacked&&a({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||a({"--opacity":"0",pointerEvents:"none"}),o&&r&&(a({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||a({"--y":"calc(var(--sign) * 40%)"})),o&&e.stacked&&!t&&a({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),e.frontmost&&!t&&a({"--y":"calc(var(--lift) * -100%)"}),i}function Kl(e,t){const n={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"};var o;return e.frontmost&&!t&&(o={height:"calc(var(--initial-height) + 80%)"},Object.assign(n,o)),n}var{not:Yl,and:Xl,or:Zl}=tr;function Jl(e,t){Hl(e.toasts,e.placement).forEach(t)}var Ql={connect:function(e,t,n){function o(){var t;return(t=e)instanceof ar||"machine"===t?.type?e.getState():e}function r(e){return Hl(o().context.toasts,e)}function i(e){const t=o().context.toasts;return!!t.length&&!!t.find((t=>t.id==e))}function a(e){const n=`toast:${Ni()}`,o=e.id?e.id:n;return i(o)||t({type:"ADD_TOAST",toast:{...e,id:o}}),o}function s(e,n){return i(e)?(t({type:"UPDATE_TOAST",id:e,toast:n}),e):e}function l(e){const{id:t}=e;return!!t&&i(t)&&null!=t?s(t,e):a(e)}function c(e){null==e?t("DISMISS_ALL"):i(e)&&t({type:"DISMISS_TOAST",id:e})}return{getCount:()=>o().context.count,getPlacements(){const e=o().context.toasts.map((e=>e.state.context.placement));return Array.from(new Set(e))},getToastsByPlacement:r,isVisible:i,create:a,update:s,upsert:l,dismiss:c,remove(e){null==e?t("REMOVE_ALL"):i(e)&&t({type:"REMOVE_TOAST",id:e})},dismissByPlacement(e){r(e).forEach((e=>c(e.id)))},loading:e=>l({...e,type:"loading"}),success:e=>l({...e,type:"success"}),error:e=>l({...e,type:"error"}),promise(e,t,n={}){const o=l({...n,...t.loading,type:"loading"});return Ai(e).then((e=>{const r=Ai(t.success,e);l({...n,...r,id:o,type:"success"})})).catch((e=>{const r=Ai(t.error,e);l({...n,...r,id:o,type:"error"})})).finally((()=>{t.finally?.()})),o},pause(e){null==e?t("PAUSE_ALL"):i(e)&&t({type:"PAUSE_TOAST",id:e})},resume(e){null==e?t("RESUME_ALL"):i(e)&&t({type:"RESUME_TOAST",id:e})},getGroupProps(e){const{placement:r,label:i="Notifications"}=e,a=o(),s=a.context.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),[l,c="center"]=r.split("-");return n.element({...jl.group.attrs,dir:a.context.dir,tabIndex:-1,"aria-label":`${r} ${i} ${s}`,id:zl.getRegionId(r),"data-placement":r,"data-side":l,"data-align":c,"aria-live":"polite",role:"region",style:Wl(a.context,r),onMouseMove(){t({type:"REGION.POINTER_ENTER",placement:r})},onMouseLeave(){t({type:"REGION.POINTER_LEAVE",placement:r})},onFocus(e){t({type:"REGION.FOCUS",target:e.relatedTarget})},onBlur(e){a.context.isFocusWithin&&!Zr(e.currentTarget,e.relatedTarget)&&t({type:"REGION.BLUR"})}})},subscribe(e){const t=o();return Po(t.context.toasts,(()=>{const n=r(t.context.placement).map((e=>e.getState().context));e(n)}))}}},machine:function(e){const t=Mi(e);return sr({id:"toaster",initial:t.overlap?"overlap":"stack",context:{dir:"ltr",max:Number.MAX_SAFE_INTEGER,gap:16,pauseOnPageIdle:!1,hotkey:["altKey","KeyT"],offsets:"1rem",placement:"bottom",removeDelay:200,...t,toasts:[],lastFocusedEl:null,isFocusWithin:!1,heights:[]},computed:{count:e=>e.toasts.length},activities:["trackDocumentVisibility","trackHotKeyPress"],watch:{toasts:["collapsedIfEmpty","setDismissableBranch"]},exit:["removeToasts","clearDismissableBranch","clearLastFocusedEl"],on:{PAUSE_TOAST:{actions:["pauseToast"]},PAUSE_ALL:{actions:["pauseToasts"]},RESUME_TOAST:{actions:["resumeToast"]},RESUME_ALL:{actions:["resumeToasts"]},ADD_TOAST:{guard:"isWithinRange",actions:["createToast","syncToastIndex"]},UPDATE_TOAST:{actions:["updateToast"]},DISMISS_TOAST:{actions:["dismissToast"]},DISMISS_ALL:{actions:["dismissToasts"]},REMOVE_TOAST:{actions:["removeToast","syncToastIndex","syncToastOffset"]},REMOVE_ALL:{actions:["removeToasts"]},UPDATE_HEIGHT:{actions:["syncHeights","syncToastOffset"]},"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","restoreLastFocusedEl"]},{actions:["resumeToasts","restoreLastFocusedEl"]}]},states:{stack:{entry:["expandToasts"],on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap"},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{entry:["collapseToasts"],on:{"REGION.STACK":{target:"stack"},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts"]}}}}},{guards:{isWithinRange:e=>e.toasts.length<e.max,isOverlapping:e=>!!e.overlap},activities:{trackHotKeyPress:(e,t,{send:n})=>Fi(document,"keydown",(t=>{e.hotkey.every((e=>t[e]||t.code===e))&&n({type:"DOC.HOTKEY"})}),{capture:!0}),trackDocumentVisibility(e,t,{send:n}){if(!e.pauseOnPageIdle)return;const o=zl.getDoc(e);return Fi(o,"visibilitychange",(()=>{n("hidden"===o.visibilityState?"PAUSE_ALL":"RESUME_ALL")}))}},actions:{setDismissableBranch(e){const t=Hl(e.toasts,e.placement).length>0;if(!t)return void e._cleanup?.();if(t&&e._cleanup)return;e._cleanup=function(e,t={}){const{defer:n}=t,o=n?wi:e=>e(),r=[];return r.push(o((()=>{const t=Di(e)?e():e;t?(pl.addBranch(t),r.push((()=>{pl.removeBranch(t)}))):Bi("[@zag-js/dismissable] branch node is `null` or `undefined`")}))),()=>{r.forEach((e=>e?.()))}}((()=>zl.getRegionEl(e,e.placement)),{defer:!0})},clearDismissableBranch(e){e._cleanup?.()},focusRegionEl(e){queueMicrotask((()=>{zl.getRegionEl(e,e.placement)?.focus()}))},expandToasts(e){Jl(e,(e=>{e.state.context.stacked=!0}))},collapseToasts(e){Jl(e,(e=>{e.state.context.stacked=!1}))},collapsedIfEmpty(e,t,{send:n}){!e.overlap||e.toasts.length>1||n("REGION.OVERLAP")},pauseToast(e,t,{self:n}){n.sendChild("PAUSE",t.id)},pauseToasts(e){e.toasts.forEach((e=>e.send("PAUSE")))},resumeToast(e,t,{self:n}){n.sendChild("RESUME",t.id)},resumeToasts(e){e.toasts.forEach((e=>e.send("RESUME")))},measureToasts(e){e.toasts.forEach((e=>e.send("MEASURE")))},createToast(e,t,{self:n,getState:o}){const r=function(e){const{type:t="info",duration:n,id:o="1",placement:r="bottom",removeDelay:i=200,...a}=e,s=Mi(a),l=Gl(n,t);return sr({id:o,context:{id:o,type:t,remaining:l,duration:l,removeDelay:i,createdAt:Date.now(),placement:r,...s,height:0,offset:0,frontmost:!1,mounted:!1,index:-1,zIndex:0},initial:"loading"===t?"visible:persist":"visible",on:{UPDATE:[{guard:Xl("hasTypeChanged","isChangingToLoading"),target:"visible:persist",actions:["setContext"]},{guard:Zl("hasDurationChanged","hasTypeChanged"),target:"visible:updating",actions:["setContext"]},{actions:["setContext"]}],MEASURE:{actions:["measureHeight"]}},entry:["invokeOnVisible"],activities:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],after:{0:"visible"}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:Yl("isLoadingType"),target:"visible",actions:["setCreatedAt"]},DISMISS:"dismissing"}},visible:{tags:["visible"],after:{VISIBLE_DURATION:"dismissing"},on:{DISMISS:"dismissing",PAUSE:{target:"visible:persist",actions:"setRemainingDuration"}}},dismissing:{entry:"invokeOnDismiss",after:{REMOVE_DELAY:{target:"unmounted",actions:"notifyParentToRemove"}}},unmounted:{entry:"invokeOnUnmount",type:"final"}}},{activities:{trackHeight(e,t,{self:n}){let o;return wi((()=>{const t=zl.getRootEl(e);if(!t)return;e.mounted=!0,Bi(2!==ki(t,"[data-ghost]").length,"[toast] No ghost element found in toast. Render the `ghostBefore` and `ghostAfter` elements");const r=()=>{const o=t.style.height;t.style.height="auto";const r=t.getBoundingClientRect().height;t.style.height=o,e.height=r,n.sendParent({type:"UPDATE_HEIGHT",id:n.id,height:r,placement:e.placement})};r();const i=new(zl.getWin(e).MutationObserver)(r);i.observe(t,{childList:!0,subtree:!0,characterData:!0}),o=()=>i.disconnect()})),()=>o?.()}},guards:{isChangingToLoading:(e,t)=>"loading"===t.toast?.type,isLoadingType:e=>"loading"===e.type,hasTypeChanged:(e,t)=>null!=t.toast?.type&&t.toast.type!==e.type,hasDurationChanged:(e,t)=>null!=t.toast?.duration&&t.toast.duration!==e.duration},delays:{VISIBLE_DURATION:e=>e.remaining,REMOVE_DELAY:e=>e.removeDelay},actions:{measureHeight(e,t,{self:n}){wi((()=>{const t=zl.getRootEl(e);if(!t)return;e.mounted=!0;const o=t.style.height;t.style.height="auto";const r=t.getBoundingClientRect().height;t.style.height=o,e.height=r,n.sendParent({type:"UPDATE_HEIGHT",id:n.id,height:r,placement:e.placement})}))},setRemainingDuration(e){e.remaining-=Date.now()-e.createdAt},setCreatedAt(e){e.createdAt=Date.now()},notifyParentToRemove(e,t,{self:n}){n.sendParent({type:"REMOVE_TOAST",id:n.id})},invokeOnDismiss(e){e.onStatusChange?.({status:"dismissing"})},invokeOnUnmount(e){e.onStatusChange?.({status:"unmounted"})},invokeOnVisible(e){e.onStatusChange?.({status:"visible"})},setContext(e,t){const n=t.toast?.duration,o=Gl(n,t.toast?.type??e.type);Object.assign(e,{...t.toast,duration:o,remaining:o})}}})}({placement:e.placement,duration:e.duration,removeDelay:e.removeDelay,...t.toast,dir:e.dir,getRootNode:e.getRootNode,stacked:o().matches("stack")}),i=n.spawn(r);e.toasts=[i,...e.toasts]},updateToast(e,t,{self:n}){n.sendChild({type:"UPDATE",toast:t.toast},t.id)},dismissToast(e,t,{self:n}){n.sendChild("DISMISS",t.id)},dismissToasts(e){e.toasts.forEach((e=>e.send("DISMISS")))},removeToast(e,t,{self:n}){n.stopChild(t.id),e.toasts=e.toasts.filter((e=>e.id!==t.id)),e.heights=e.heights.filter((e=>e.id!==t.id))},removeToasts(e,t,{self:n}){e.toasts.forEach((e=>n.stopChild(e.id))),e.toasts=[],e.heights=[]},syncHeights(e,t){const n=e.heights.find((e=>e.id===t.id));if(n)n.height=t.height,n.placement=t.placement;else{const n={id:t.id,height:t.height,placement:t.placement};e.heights=[n,...e.heights]}},syncToastIndex(e){Jl(e,((e,t,n)=>{e.state.context.index=t,e.state.context.frontmost=0===t,e.state.context.zIndex=n.length-t}))},syncToastOffset(e,t){const n=t.placement??e.placement;Jl({...e,placement:n},(t=>{const n=Math.max(e.heights.findIndex((e=>e.id===t.id)),0),o=e.heights.reduce(((e,t,o)=>o>=n?e:e+t.height),0);t.state.context.offset=n*e.gap+o}))},setLastFocusedEl(e,t){!e.isFocusWithin&&t.target&&(e.isFocusWithin=!0,e.lastFocusedEl=Oo(t.target))},restoreLastFocusedEl(e){e.isFocusWithin=!1,e.lastFocusedEl&&(e.lastFocusedEl.focus({preventScroll:!0}),e.lastFocusedEl=null)},clearLastFocusedEl(e){e.lastFocusedEl&&(e.lastFocusedEl.focus({preventScroll:!0}),e.lastFocusedEl=null,e.isFocusWithin=!1)}}})}};function ec(e={}){const{strict:t=!0,hookName:n="useContext",providerName:o="Provider",errorMessage:r,defaultValue:i}=e,a=function(e){const t=Symbol("context");return{id:t,Provider:K(t),defaultValue:e}}(i);return[a.Provider,function e(){const i=$(a);if(!i&&t){const t=new Error(r??`${n} returned \`undefined\`. Seems you forgot to wrap component within ${o}`);throw t.name="ContextError",Error.captureStackTrace?.(t,e),t}return i},a]}const tc=()=>(e,t)=>oe(e,t),[nc,oc]=ec({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),rc=e=>tc()(e,["lazyMount","unmountOnExit"]),ic=e=>t=>{const[n,o]=oe(t,["asChild"]);if(n.asChild){const e=e=>{const[,t]=oe(o,["ref"]);return Ar(t,e)};return n.asChild(e)}return Z(Le,ne({component:e},o))};const ac=function(){const e=new Map;return new Proxy(ic,{apply:(e,t,n)=>ic(n[0]),get(t,n){const o=n;return e.has(o)||e.set(o,ic(o)),e.get(o)}})}(),[sc,lc]=ec({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})});var cc=ve("<span hidden>");const dc=e=>{const[t,n]=_(),o=()=>((e,...t)=>"function"==typeof e?e(...t):e)(e.value)??t()?.ownerDocument??document,r=E((()=>({getRootNode:o,getDocument:()=>Jr(o()),getWindow:()=>Qr(o())})));return Z(sc,{value:r,get children(){return[E((()=>e.children)),Z(le,{get when(){return!e.value},get children(){var e=cc();return Te(n,e),e}})]}})},[uc,pc]=ec({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})}),gc=e=>tc()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]),hc=e=>{const[t,n]=rc(e),[o,r]=_(!1),[i,a]=Vr(sr({initial:(s=n).present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:!1,initial:!1,...s},exit:["clearInitial"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},"ANIMATION.END":{target:"unmounted",actions:["invokeOnExitComplete"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{actions:{setInitial(e){e.initial=!0},clearInitial(e){e.initial=!1},invokeOnExitComplete(e){e.onExitComplete?.()},setNode(e,t){e.node=Oo(t.node)},setStyles(e,t){const n=t.node.ownerDocument.defaultView||window;e.styles=Oo(n.getComputedStyle(t.node))},syncPresence(e,t,{send:n}){if(e.present)return void n({type:"MOUNT",src:"presence.changed"});const o=ml(e.styles);(e.immediate?queueMicrotask:requestAnimationFrame)((()=>{e.unmountAnimationName=o,"none"===o||o===e.prevAnimationName||"none"===e.styles?.display?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})}))},setPrevAnimationName(e){(e.immediate?queueMicrotask:requestAnimationFrame)((()=>{e.prevAnimationName=ml(e.styles)}))},clearPrevAnimationName(e){e.prevAnimationName=null}},activities:{trackAnimationEvents(e,t,{send:n}){const o=e.node;if(!o)return;const r=t=>{t.target===o&&(e.prevAnimationName=ml(e.styles))},i=t=>{const r=ml(e.styles);t.target===o&&r===e.unmountAnimationName&&n({type:"UNMOUNT",src:"animationend"})};return o.addEventListener("animationstart",r),o.addEventListener("animationcancel",i),o.addEventListener("animationend",i),()=>{o.removeEventListener("animationstart",r),o.removeEventListener("animationcancel",i),o.removeEventListener("animationend",i)}}}}),{context:n});var s;const l=E((()=>function(e,t){const n=e.matches("mounted","unmountSuspended");return{skip:!e.context.initial&&n,present:n,setNode(e){e&&t({type:"NODE.SET",node:e})},unmount(){t({type:"UNMOUNT"})}}}(i,a)));return S((()=>{l().present&&r(!0)})),E((()=>({unmounted:!l().present&&!o()&&t.lazyMount||t.unmountOnExit&&!l().present&&o(),present:l().present,presenceProps:{ref:l().setNode,hidden:!l().present,"data-state":n.present?"open":"closed"}})))},[fc,mc]=ec({hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),[bc,yc]=ec({hookName:"useDialogContext",providerName:"<DialogProvider />"}),vc=e=>{const t=pc(),n=lc(),o=ie(),r=E((()=>({id:o,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":void 0!==e.open,...e}))),[i,a]=Vr(Sl(r()),{context:r});return E((()=>function(e,t,n){const o=e.context["aria-label"],r=e.matches("open"),i=e.context.renderedElements;return{open:r,setOpen(e){e!==r&&t(e?"OPEN":"CLOSE")},getTriggerProps:()=>n.button({..._l.trigger.attrs,dir:e.context.dir,id:Tl.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":r,"data-state":r?"open":"closed","aria-controls":Tl.getContentId(e.context),onClick(e){e.defaultPrevented||t("TOGGLE")}}),getBackdropProps:()=>n.element({..._l.backdrop.attrs,dir:e.context.dir,hidden:!r,id:Tl.getBackdropId(e.context),"data-state":r?"open":"closed"}),getPositionerProps:()=>n.element({..._l.positioner.attrs,dir:e.context.dir,id:Tl.getPositionerId(e.context),style:{pointerEvents:r?void 0:"none"}}),getContentProps:()=>n.element({..._l.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!r,id:Tl.getContentId(e.context),tabIndex:-1,"data-state":r?"open":"closed","aria-modal":!0,"aria-label":o||void 0,"aria-labelledby":o||!i.title?void 0:Tl.getTitleId(e.context),"aria-describedby":i.description?Tl.getDescriptionId(e.context):void 0}),getTitleProps:()=>n.element({..._l.title.attrs,dir:e.context.dir,id:Tl.getTitleId(e.context)}),getDescriptionProps:()=>n.element({..._l.description.attrs,dir:e.context.dir,id:Tl.getDescriptionId(e.context)}),getCloseTriggerProps:()=>n.button({..._l.closeTrigger.attrs,dir:e.context.dir,id:Tl.getCloseTriggerId(e.context),type:"button",onClick(e){e.defaultPrevented||(e.stopPropagation(),t("CLOSE"))}})}}(i,a,Mr)))};var wc=Object.freeze({__proto__:null,Backdrop:e=>{const t=yc(),n=oc(),o=hc(Ar(n,(()=>({present:t().open})))),r=Ar((()=>t().getBackdropProps()),(()=>o().presenceProps),e);return Z(le,{get when(){return!o().unmounted},get children(){return Z(ac.div,r)}})},CloseTrigger:e=>{const t=yc(),n=Ar((()=>t().getCloseTriggerProps()),e);return Z(ac.button,n)},Content:e=>{const t=yc(),n=mc(),o=Ar((()=>t().getContentProps()),(()=>n().presenceProps),e);return Z(le,{get when(){return!n().unmounted},get children(){return Z(ac.div,o)}})},Context:e=>e.children(yc()),Description:e=>{const t=yc(),n=Ar((()=>t().getDescriptionProps()),e);return Z(ac.div,n)},Positioner:e=>{const t=yc(),n=mc(),o=Ar((()=>t().getPositionerProps()),e);return Z(le,{get when(){return!n().unmounted},get children(){return Z(ac.div,o)}})},Root:e=>{const[t,n]=gc(e),[o]=rc(t),[r,i]=tc()(n,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),a=vc(r),s=hc(Ar(t,(()=>({present:a().open}))));return Z(bc,{value:a,get children(){return Z(nc,{value:o,get children(){return Z(fc,{value:s,get children(){return i.children}})}})}})},RootProvider:e=>{const[t,n]=gc(e),[o]=rc(t),r=hc(Ar(t,(()=>({present:n.value().open}))));return Z(bc,{get value(){return n.value},get children(){return Z(nc,{value:o,get children(){return Z(fc,{value:r,get children(){return n.children}})}})}})},Title:e=>{const t=yc(),n=Ar((()=>t().getTitleProps()),e);return Z(ac.h2,n)},Trigger:e=>{const t=yc(),n=mc(),o=Ar((()=>t().getTriggerProps()),(()=>({"aria-controls":n().unmounted&&null})),e);return Z(ac.button,o)}});const[xc,kc]=ec({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:!1}),[_c,Tc]=ec({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[Sc,Ec]=ec({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),[Cc,Pc]=ec({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),Ic=e=>{const t=pc(),n=lc(),o=ie(),r=E((()=>({id:o,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":void 0!==e.open,...e}))),[i,a,s]=Vr(function(e){const t=Mi(e);return sr({id:"menu",initial:t.open?"open":"idle",context:{highlightedValue:null,loopFocus:!1,anchorPoint:null,closeOnSelect:!0,typeahead:!0,composite:!0,...t,positioning:{placement:"bottom-start",gutter:8,...t.positioning},intentPolygon:null,parent:null,lastHighlightedValue:null,children:Oo({}),suspendPointer:!1,restoreFocus:!0,typeaheadState:di.defaultOptions},computed:{isSubmenu:e=>null!==e.parent,isRtl:e=>"rtl"===e.dir,isTypingAhead:e=>""!==e.typeaheadState.keysSoFar},watch:{isSubmenu:"setSubmenuPlacement",anchorPoint:"reposition",open:"toggleVisibility"},on:{"PARENT.SET":{actions:"setParentMenu"},"CHILD.SET":{actions:"setChildMenu"},OPEN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{internal:!0,target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],"HIGHLIGHTED.RESTORE":{actions:"restoreHighlightedItem"},"HIGHLIGHTED.SET":{actions:"setHighlightedItem"}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_FOCUS:{guard:Al("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],after:{LONG_PRESS_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},opening:{tags:["closed"],after:{SUBMENU_OPEN_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",BLUR:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},closing:{tags:["open"],activities:["trackPointerMove","trackInteractOutside"],after:{SUBMENU_CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem","invokeOnClose"]}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]},MENU_POINTERENTER:{target:"open",actions:"clearIntentPolygon"},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","clearAnchorPoint","resumePointer"],on:{"CONTROLLED.OPEN":[{guard:Rl("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:"highlightFirstItem"},{guard:"isArrowUpEvent",target:"open",actions:"highlightLastItem"},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:"idle",ARROW_DOWN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],activities:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:$l(Al("isTriggerItem"),"isOpenControlled"),actions:"invokeOnClose"},{guard:Al("isTriggerItem"),target:"closed",actions:"invokeOnClose"}],ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:$l("isSubmenu","isOpenControlled"),actions:"invokeOnClose"},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},ENTER:[{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},{guard:$l("closeOnSelect","isOpenControlled"),actions:["clickHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"closed",actions:"clickHighlightedItem"},{actions:"clickHighlightedItem"}],ITEM_POINTERMOVE:[{guard:Al("suspendPointer"),actions:["setHighlightedItem","focusMenu"]},{actions:"setLastHighlightedItem"}],ITEM_POINTERLEAVE:{guard:$l(Al("suspendPointer"),Al("isTriggerItem")),actions:"clearHighlightedItem"},ITEM_CLICK:[{guard:$l(Al("isTriggerItemHighlighted"),Al("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:$l(Al("isTriggerItemHighlighted"),Al("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:$l(Al("isTriggerItemHighlighted"),Al("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:"setHighlightedItem"}],TRIGGER_POINTERLEAVE:{target:"closing",actions:"setIntentPolygon"},ITEM_POINTERDOWN:{actions:"setHighlightedItem"},TYPEAHEAD:{actions:"highlightMatchedItem"},FOCUS_MENU:{actions:"focusMenu"},"POSITIONING.SET":{actions:"reposition"}}}}},{delays:{LONG_PRESS_DELAY:700,SUBMENU_OPEN_DELAY:100,SUBMENU_CLOSE_DELAY:100},guards:{closeOnSelect:(e,t)=>!!(t?.closeOnSelect??e.closeOnSelect),isTriggerItem:(e,t)=>Il.isTriggerItem(t.target),isTriggerItemHighlighted:(e,t)=>{const n=t.target??Il.getHighlightedItemEl(e);return!!n?.hasAttribute("aria-controls")},isSubmenu:e=>e.isSubmenu,suspendPointer:e=>e.suspendPointer,isHighlightedItemEditable:e=>yi(Il.getHighlightedItemEl(e)),isWithinPolygon:(e,t)=>!!e.intentPolygon&&function(e,t){const{x:n,y:o}=t;let r=!1;for(let t=0,i=e.length-1;t<e.length;i=t++){const a=e[t].x,s=e[t].y,l=e[i].x,c=e[i].y;s>o!=c>o&&n<(l-a)*(o-s)/(c-s)+a&&(r=!r)}return r}(e.intentPolygon,t.point),isOpenControlled:e=>!!e["open.controlled"],isArrowLeftEvent:(e,t)=>"ARROW_LEFT"===t.previousEvent?.type,isArrowUpEvent:(e,t)=>"ARROW_UP"===t.previousEvent?.type,isArrowDownEvent:(e,t)=>"ARROW_DOWN"===t.previousEvent?.type,isOpenAutoFocusEvent:(e,t)=>"OPEN_AUTOFOCUS"===t.previousEvent?.type},activities:{trackPositioning(e){if(!e.anchorPoint)return e.currentPlacement=e.positioning.placement,nl(Il.getTriggerEl(e),(()=>Il.getPositionerEl(e)),{...e.positioning,defer:!0,onComplete(t){e.currentPlacement=t.placement}})},trackInteractOutside:(e,t,{send:n})=>fl((()=>Il.getContentEl(e)),{defer:!0,exclude:[Il.getTriggerEl(e)],onInteractOutside:e.onInteractOutside,onFocusOutside:e.onFocusOutside,onEscapeKeyDown(t){e.onEscapeKeyDown?.(t),e.isSubmenu&&t.preventDefault(),Nl(e)},onPointerDownOutside(t){e.restoreFocus=!t.detail.focusable,e.onPointerDownOutside?.(t)},onDismiss(){n({type:"CLOSE",src:"interact-outside"})}}),trackPointerMove(e,t,{guards:n,send:o}){const{isWithinPolygon:r}=n;e.parent.state.context.suspendPointer=!0;const i=Il.getDoc(e);return Fi(i,"pointermove",(t=>{const n={x:t.clientX,y:t.clientY};r(e,{point:n})||(o("POINTER_MOVED_AWAY_FROM_SUBMENU"),e.parent.state.context.suspendPointer=!1)}))},scrollToHighlightedItem(e,t,{getState:n}){const o=()=>{n().event.type.startsWith("ITEM_POINTER")||Ti(Il.getHighlightedItemEl(e),{rootEl:Il.getContentEl(e),block:"nearest"})};return wi((()=>o())),xi((()=>Il.getContentEl(e)),{defer:!0,attributes:["aria-activedescendant"],callback:o})}},actions:{setAnchorPoint(e,t){e.anchorPoint=t.point},clearAnchorPoint(e){e.anchorPoint=null},setSubmenuPlacement(e){e.isSubmenu&&(e.positioning.placement=e.isRtl?"left-start":"right-start",e.positioning.gutter=0)},reposition(e,t){const n=e.anchorPoint?()=>({width:0,height:0,...e.anchorPoint}):void 0;nl(Il.getTriggerEl(e),(()=>Il.getPositionerEl(e)),{...e.positioning,getAnchorRect:n,...t.options??{},listeners:!1,onComplete(t){e.currentPlacement=t.placement}})},setOptionState(e,t){if(!t.option)return;const{checked:n,onCheckedChange:o,type:r}=t.option;"radio"===r?o?.(!0):"checkbox"===r&&o?.(!n)},clickHighlightedItem(e,t,{send:n}){const o=Il.getHighlightedItemEl(e);if(!o||o.dataset.disabled)return;const r=Il.getOptionFromItemEl(o);n({type:"ITEM_CLICK",src:"enter",target:o,id:r.id,option:r,closeOnSelect:e.closeOnSelect})},setIntentPolygon(e,t){const n=Il.getContentEl(e),o=e.currentPlacement;if(!n||!o)return;const r=Cl(n.getBoundingClientRect(),o);if(!r)return;const i="right"===function(e){return e.split("-")[0]}(o),a=i?-5:5;e.intentPolygon=[{...t.point,x:t.point.x+a},...r]},clearIntentPolygon(e){e.intentPolygon=null},resumePointer(e){e.parent&&(e.parent.state.context.suspendPointer=!1)},setHighlightedItem(e,t){Ll.highlighted(e,t.id)},clearHighlightedItem(e){Ll.highlighted(e,null)},focusMenu(e){wi((()=>{const t=Il.getContentEl(e),n=mi({root:t,enabled:!Zr(t,Il.getActiveElement(e)),filter:e=>!e.role?.startsWith("menuitem")});n?.focus({preventScroll:!0})}))},highlightFirstItem(e){const t=Il.getFirstEl(e);t&&Ll.highlighted(e,t.id)},highlightLastItem(e){const t=Il.getLastEl(e);t&&Ll.highlighted(e,t.id)},highlightNextItem(e,t){const n=Il.getNextEl(e,t.loop);Ll.highlighted(e,n?.id??null)},highlightPrevItem(e,t){const n=Il.getPrevEl(e,t.loop);Ll.highlighted(e,n?.id??null)},invokeOnSelect(e){e.highlightedValue&&e.onSelect?.({value:e.highlightedValue})},focusTrigger(e){e.isSubmenu||e.anchorPoint||!e.restoreFocus||wi((()=>Il.getTriggerEl(e)?.focus({preventScroll:!0})))},highlightMatchedItem(e,t){const n=Il.getElemByKey(e,t.key);n&&Ll.highlighted(e,n.id)},setParentMenu(e,t){e.parent=Oo(t.value)},setChildMenu(e,t){e.children[t.id]=Oo(t.value)},closeRootMenu(e){Nl(e)},openSubmenu(e){const t=Il.getHighlightedItemEl(e),n=t?.getAttribute("data-uid"),o=n?e.children[n]:null;o?.send("OPEN_AUTOFOCUS")},focusParentMenu(e){e.parent?.send("FOCUS_MENU")},setLastHighlightedItem(e,t){e.lastHighlightedValue=t.id},restoreHighlightedItem(e){e.lastHighlightedValue&&(Ll.highlighted(e,e.lastHighlightedValue),e.lastHighlightedValue=null)},restoreParentHiglightedItem(e){e.parent?.send("HIGHLIGHTED.RESTORE")},invokeOnOpen(e){e.onOpenChange?.({open:!0})},invokeOnClose(e){e.onOpenChange?.({open:!1})},toggleVisibility(e,t,{send:n}){n({type:e.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}})}(r()),{context:r});return{api:E((()=>Ol(i,a,Mr))),machine:s}},[Oc,Ac]=ec({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),[$c,Rc]=ec({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1});var Nc=Object.freeze({__proto__:null,Arrow:e=>{const t=kc(),n=Ar((()=>t().getArrowProps()),e);return Z(ac.div,n)},ArrowTip:e=>{const t=kc(),n=Ar((()=>t().getArrowTipProps()),e);return Z(ac.div,n)},CheckboxItem:e=>{const[t,n]=tc()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),o=Ar(t,{type:"checkbox"}),r=kc(),i=Ar((()=>r().getOptionItemProps(o)),n),a=E((()=>r().getItemState(o)));return Z(Sc,{value:o,get children(){return Z(_c,{value:a,get children(){return Z(ac.div,i)}})}})},Content:e=>{const t=kc(),n=mc(),o=Ar((()=>t().getContentProps()),(()=>n().presenceProps),e);return Z(le,{get when(){return!n().unmounted},get children(){return Z(ac.div,o)}})},Context:e=>e.children(kc()),ContextTrigger:e=>{const t=kc(),n=Ar((()=>t().getContextTriggerProps()),e);return Z(ac.button,n)},Indicator:e=>{const t=kc(),n=Ar((()=>t().getIndicatorProps()),e);return Z(ac.div,n)},Item:e=>{const[t,n]=tc()(e,["closeOnSelect","disabled","value","valueText"]),o=kc(),r=Ar((()=>o().getItemProps(t)),n),i=E((()=>o().getItemState(t)));return Z(_c,{value:i,get children(){return Z(ac.div,r)}})},ItemContext:e=>e.children(Tc()),ItemGroup:e=>{const[t,n]=tc()(e,["id"]),o=Ar({id:ie()},t),r=kc(),i=Ar((()=>r().getItemGroupProps(o)),n);return Z(Cc,{value:o,get children(){return Z(ac.div,i)}})},ItemGroupLabel:e=>{const t=kc(),n=Pc(),o=Ar(t().getItemGroupLabelProps({htmlFor:n.id}),e);return Z(ac.div,o)},ItemIndicator:e=>{const t=kc(),n=Ec(),o=Ar((()=>t().getItemIndicatorProps(n)),e);return Z(ac.div,o)},ItemText:e=>{const t=kc(),n=Ec(),o=Ar((()=>t().getItemTextProps(n)),e);return Z(ac.div,o)},Positioner:e=>{const t=kc(),n=mc(),o=Ar((()=>t().getPositionerProps()),e);return Z(le,{get when(){return!n().unmounted},get children(){return Z(ac.div,o)}})},RadioItem:e=>{const[t,n]=tc()(e,["closeOnSelect","disabled","value","valueText"]),o=kc(),r=Pc(),i=Ar(t,(()=>({type:"radio",checked:r.value===t.value,onCheckedChange:()=>r.onValueChange?.({value:t.value})}))),a=Ar((()=>o().getOptionItemProps(i)),n),s=E((()=>o().getItemState(i)));return Z(Sc,{value:i,get children(){return Z(_c,{value:s,get children(){return Z(ac.div,a)}})}})},RadioItemGroup:e=>{const[t,n]=tc()(e,["id","onValueChange","value"]),o=kc(),r=Ar({id:ie()},t),i=Ar((()=>o().getItemGroupProps(r)),n);return Z(Cc,{value:r,get children(){return Z(ac.div,i)}})},Root:e=>{const[t,n]=gc(e),[o,r]=tc()(n,["anchorPoint","aria-label","closeOnSelect","composite","defaultOpen","highlightedValue","id","ids","loopFocus","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=kc(),a=Ac(),s=Ic(o),l=hc(Ar(t,(()=>({present:s.api().open}))));S((()=>{a&&(i?.().setChild(s.machine),s.api().setParent(a))}));return Z($c,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return Z(Oc,{get value(){return s.machine},get children(){return Z(xc,{get value(){return s.api},get children(){return Z(fc,{value:l,get children(){return r.children}})}})}})}})},RootProvider:e=>{const t=kc(),n=Ac(),[o,r]=gc(e),i=hc(Ar(o,(()=>({present:r.value.api().open}))));S((()=>{n&&(t?.().setChild(r.value.machine),r.value.api().setParent(n))}));return Z($c,{value:()=>t?.().getTriggerItemProps(r.value.api()),get children(){return Z(Oc,{get value(){return r.value.machine},get children(){return Z(xc,{get value(){return r.value.api},get children(){return Z(fc,{value:i,get children(){return r.children}})}})}})}})},Separator:e=>{const t=kc(),n=Ar((()=>t().getSeparatorProps()),e);return Z(ac.hr,n)},Trigger:e=>{const t=kc(),n=mc(),o=Ar((()=>t().getTriggerProps()),(()=>({"aria-controls":n().unmounted&&null})),e);return Z(ac.button,o)},TriggerItem:e=>{const t=Rc(),n=Ar((()=>t?.()),e);return Z(ac.div,n)}});const[Lc,Dc]=ec({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),Mc=e=>{const t=pc(),n=lc(),o=ie(),r=E((()=>({id:o,dir:t().dir,getRootNode:n().getRootNode,...e}))),[i,a]=Vr(Bl(r()),{context:r});return E((()=>function(e,t,n){const o=e.context.percent,r=e.context.max,i=e.context.min,a=e.context.orientation,s=e.context.translations,l=e.context.isIndeterminate,c=e.context.value,d=s.value({value:c,max:r,percent:o,min:i}),u=function(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}(c,r),p={role:"progressbar","aria-label":d,"data-max":r,"aria-valuemin":i,"aria-valuemax":r,"aria-valuenow":c??void 0,"data-orientation":a,"data-state":u},g=function(e){const t={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}};return{root:{viewBox:"0 0 var(--size) var(--size)",style:{width:"var(--size)",height:"var(--size)"}},track:t,range:{opacity:0===e.value?0:void 0,style:{...t.style,"--percent":e.percent,"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100}))",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:e.isIndeterminate?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}(e.context);return{value:c,valueAsString:d,setValue(e){t({type:"VALUE.SET",value:e})},setToMax(){t({type:"VALUE.SET",value:r})},getRootProps:()=>n.element({dir:e.context.dir,...Dl.root.attrs,id:Ml.getRootId(e.context),"data-max":r,"data-value":c??void 0,"data-state":u,"data-orientation":a,style:{"--percent":l?void 0:o}}),getLabelProps:()=>n.element({dir:e.context.dir,id:Ml.getLabelId(e.context),...Dl.label.attrs,"data-orientation":a}),getValueTextProps:()=>n.element({dir:e.context.dir,"aria-live":"polite",...Dl.valueText.attrs}),getTrackProps:()=>n.element({dir:e.context.dir,id:Ml.getTrackId(e.context),...Dl.track.attrs,...p}),getRangeProps:()=>n.element({dir:e.context.dir,...Dl.range.attrs,"data-orientation":a,"data-state":u,style:{[e.context.isHorizontal?"width":"height"]:l?void 0:`${o}%`}}),getCircleProps:()=>n.element({dir:e.context.dir,id:Ml.getCircleId(e.context),...Dl.circle.attrs,...p,...g.root}),getCircleTrackProps:()=>n.element({dir:e.context.dir,"data-orientation":a,...Dl.circleTrack.attrs,...g.track}),getCircleRangeProps:()=>n.element({dir:e.context.dir,...Dl.circleRange.attrs,...g.range,"data-state":u}),getViewProps:t=>n.element({dir:e.context.dir,...Dl.view.attrs,"data-state":t.state,hidden:t.state!==u})}}(i,a,Mr)))};var Uc=Object.freeze({__proto__:null,Circle:e=>{const t=Dc(),n=Ar((()=>t().getCircleProps()),e);return Z(ac.svg,n)},CircleRange:e=>{const t=Dc(),n=Ar((()=>t().getCircleRangeProps()),e);return Z(ac.circle,n)},CircleTrack:e=>{const t=Dc(),n=Ar((()=>t().getCircleTrackProps()),e);return Z(ac.circle,n)},Context:e=>e.children(Dc()),Label:e=>{const t=Dc(),n=Ar((()=>t().getLabelProps()),e);return Z(ac.label,n)},Range:e=>{const t=Dc(),n=Ar((()=>t().getRangeProps()),e);return Z(ac.div,n)},Root:e=>{const[t,n]=tc()(e,["id","ids","max","min","orientation","translations","value"]),o=Mc(t),r=Ar((()=>o().getRootProps()),n);return Z(Lc,{value:o,get children(){return Z(ac.div,r)}})},RootProvider:e=>{const[{value:t},n]=tc()(e,["value"]),o=Ar((()=>t().getRootProps()),n);return Z(Lc,{value:t,get children(){return Z(ac.div,o)}})},Track:e=>{const t=Dc(),n=Ar((()=>t().getTrackProps()),e);return Z(ac.div,n)},ValueText:e=>{const t=Dc(),n=Ar((()=>t().getValueTextProps()),e);return Z(ac.span,ne(n,{get children(){return e.children||t().valueAsString}}))},View:e=>{const[t,n]=tc()(e,["state"]),o=Dc(),r=Ar((()=>o().getViewProps(t)),n);return Z(ac.span,r)}}),Bc=(e,t=[])=>({parts:(...n)=>{if(jc(t))return Bc(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Bc(e,[...t,...n]),rename:e=>Bc(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce(((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${Fc(e)}"][data-part="${Fc(n)}"]`,`& [data-scope="${Fc(e)}"][data-part="${Fc(n)}"]`].join(", "),attrs:{"data-scope":Fc(e),"data-part":Fc(n)}}})),{})}),Fc=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),jc=e=>0===e.length;function zc(e,t){const n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;return n?(n[e]||(n[e]=t()),n[e]):t()}zc("__zag__proxyStateMap",(()=>new WeakMap)),zc("__zag__refSet",(()=>new WeakSet)),Bc("signature-pad").parts("root","control","segment","segmentPath","guide","clearTrigger","label").build();var Hc=_i({getRootId:e=>e.ids?.root??`signature-${e.id}`,getControlId:e=>e.ids?.control??`signature-control-${e.id}`,getHiddenInputId:e=>e.ids?.hiddenInput??`signature-input-${e.id}`,getControlEl:e=>Hc.getById(e,Hc.getControlId(e)),getSegmentEl:e=>{return t=Hc.getControlEl(e),n="[data-part=segment]",t?.querySelector(n)??null;var t,n},getHiddenInputEl:e=>Hc.getById(e,Hc.getHiddenInputId(e)),getDataUrl:(e,t)=>e.isEmpty?Promise.resolve(""):function(e,t){const{type:n,quality:o=.92}=t;if(!e)throw new Error("[get-data-url]: could not find the svg element");const r=Qr(e),i=r.document,a='<?xml version="1.0" standalone="no"?>\r\n'+(new r.XMLSerializer).serializeToString(e),s="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(a);if("image/svg+xml"===n)return Promise.resolve(s);const l=e.getBoundingClientRect(),c=r.devicePixelRatio||1,d=i.createElement("canvas"),u=new r.Image;u.src=s,d.width=l.width*c,d.height=l.height*c;const p=d.getContext("2d");return p.scale(c,c),new Promise((e=>{u.onload=()=>{p.drawImage(u,0,0),e(d.toDataURL(n,o))}}))}(Hc.getSegmentEl(e),t)});gr()(["dir","disabled","getRootNode","id","ids","onDraw","onDrawEnd","readOnly","drawing","name"]);const[Vc,Gc]=ec({hookName:"useToastContext",providerName:"<ToastProvider />"});var Wc=ve("<div><div></div><div>");const qc=e=>{const[t,n]=oe(e,["toaster","children"]),[o,r]=Vr(t.toaster.machine),i=o.context.placement,a=E((()=>Ql.connect(o,r,Mr))),s=E((()=>a().getToastsByPlacement(i))),l=Ar(a().getGroupProps({placement:i}),n);return Z(ac.div,ne(l,{get children(){return Z(se,{get each(){return s()},children:e=>Z(Kc,{value:e,children:e=>t.children(e)})})}}))},Kc=e=>{const[t,n]=[Hr(o=e.value),o.send];var o;const r=E((()=>function(e,t,n){const o=e.hasTag("visible"),r=e.hasTag("paused"),i=e.context.placement,a=e.context.type,[s,l="center"]=i.split("-");return{type:a,title:e.context.title,description:e.context.description,placement:i,visible:o,paused:r,pause(){t("PAUSE")},resume(){t("RESUME")},dismiss(){t("DISMISS")},getRootProps:()=>n.element({...jl.root.attrs,dir:e.context.dir,id:zl.getRootId(e.context),"data-state":o?"open":"closed","data-type":a,"data-placement":i,"data-align":l,"data-side":s,"data-mounted":Kr(e.context.mounted),"data-paused":Kr(r),"data-first":Kr(e.context.frontmost),"data-sibling":Kr(!e.context.frontmost),"data-stack":Kr(e.context.stacked),"data-overlap":Kr(!e.context.stacked),role:"status","aria-atomic":"true",tabIndex:0,style:ql(e.context,o),onKeyDown(e){e.defaultPrevented||"Escape"==e.key&&(t("DISMISS"),e.preventDefault())}}),getGhostBeforeProps:()=>n.element({"data-ghost":"before",style:Kl(e.context,o)}),getGhostAfterProps:()=>n.element({"data-ghost":"after",style:(e.context,{position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"})}),getTitleProps:()=>n.element({...jl.title.attrs,id:zl.getTitleId(e.context)}),getDescriptionProps:()=>n.element({...jl.description.attrs,id:zl.getDescriptionId(e.context)}),getActionTriggerProps:()=>n.button({...jl.actionTrigger.attrs,type:"button",onClick(e){e.defaultPrevented||t("DISMISS")}}),getCloseTriggerProps:()=>n.button({id:zl.getCloseTriggerId(e.context),...jl.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(e){e.defaultPrevented||t("DISMISS")}})}}(t,n,Mr))),i=E((()=>t.context));return Z(Vc,{value:r,get children(){return e.children(i)}})};var Yc=Object.freeze({__proto__:null,ActionTrigger:e=>{const t=Gc(),n=Ar((()=>t().getActionTriggerProps()),e);return Z(ac.button,n)},CloseTrigger:e=>{const t=Gc(),n=Ar((()=>t().getCloseTriggerProps()),e);return Z(ac.button,n)},Context:e=>e.children(Gc()),Description:e=>{const t=Gc(),n=Ar((()=>t().getDescriptionProps()),e);return Z(ac.div,n)},Root:e=>{const t=Gc(),n=Ar((()=>t().getRootProps()),e);return o=Wc(),r=o.firstChild,i=r.nextSibling,_e(o,n,!1,!0),_e(r,ne((()=>t().getGhostBeforeProps())),!1,!1),Se(o,(()=>e.children),i),_e(i,ne((()=>t().getGhostAfterProps())),!1,!1),o;var o,r,i},Title:e=>{const t=Gc(),n=Ar((()=>t().getTitleProps()),e);return Z(ac.div,n)}});const Xc=ve('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18">'),Zc=e=>(()=>{const t=Xc();return _e(t,e,!0,!0),t})(),Jc=e=>Z(wc.Root,{get open(){return e.isOpen},lazyMount:!0,unmountOnExit:!0,onOpenChange:t=>t.open?void 0:e.onClose?.(),get children(){return[Z(wc.Backdrop,{class:"fixed inset-0 bg-[rgba(0,0,0,0.5)] h-screen z-50"}),Z(wc.Positioner,{class:"fixed inset-0 z-50 flex items-center justify-center px-2",get children(){return[Z(wc.Content,{get children(){return e.children}}),Z(wc.CloseTrigger,{class:"fixed top-2 right-2 z-50 rounded-md bg-white p-2 text-black",get children(){return Z(Zc,{class:"w-6 h-6"})}})]}})]}}),Qc=ve('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4">'),ed=e=>(()=>{const t=Qc();return _e(t,e,!0,!0),t})(),td=ve('<div class="flex items-center gap-4 border bg-white border-gray-200 rounded-md p-2 text-gray-900 min-w-[250px]"><div></div><div class="flex flex-col"><span class="text-md font-semibold text-sm"></span><span class="text-gray-500 text-xs">'),nd=e=>{const t=rd(e.file);return(()=>{const n=td(),o=n.firstChild,r=o.nextSibling.firstChild,i=r.nextSibling;return Se(o,Z(ed,{class:"w-6 h-6"})),Se(r,(()=>e.file.name)),Se(i,(()=>od(e.file))),T((()=>ke(o,Ze("rounded-md text-white p-2 flex items-center","pink"===t&&"bg-pink-400","blue"===t&&"bg-blue-400","green"===t&&"bg-green-400","gray"===t&&"bg-gray-400","orange"===t&&"bg-orange-400")))),n})()},od=e=>{switch(e.name.split(".").pop()){case"pdf":return"PDF";case"doc":case"docx":return"Word";case"xls":case"xlsx":case"csv":return"Sheet";case"json":return"JSON";case"md":return"Markdown";default:return"DOCUMENT"}},rd=e=>{const t=e.name.split(".").pop();if(!t)return"gray";switch(t){case"pdf":return"pink";case"doc":case"docx":return"blue";case"xls":case"xlsx":case"csv":return"green";case"json":return"orange";default:return"gray"}},id=ve('<div class="flex justify-end items-end animate-fade-in gap-2 guest-container">'),ad=ve("<div>"),sd=ve('<span class="px-[15px] py-[7px]">'),ld=ve('<img alt="Attachment">'),cd=ve('<div class="flex flex-col gap-1 items-end"><div class="p-[1px] whitespace-pre-wrap max-w-full typebot-guest-bubble flex flex-col" data-testid="guest-bubble">'),dd=ve("<img>"),ud=ve('<div class="flex flex-col gap-1 items-end"><div class="p-2 w-full whitespace-pre-wrap typebot-guest-bubble flex flex-col" data-testid="guest-bubble"><audio controls>'),pd=e=>(()=>{const t=id();return Se(t,Z(ce,{get children(){return[Z(de,{get when(){return"text"===e.answer?.type},get children(){return Z(gd,{get answer(){return e.answer}})}}),Z(de,{get when(){return"recording"===e.answer?.type},get children(){return Z(hd,{get answer(){return e.answer}})}})]}}),null),Se(t,Z(le,{get when(){return e.showAvatar},get children(){return Z(mo,{get initialAvatarSrc(){return e.avatarSrc}})}}),null),T((()=>null!=(e.hasHostAvatar?Kt()?"28px":"50px":void 0)?t.style.setProperty("margin-left",e.hasHostAvatar?Kt()?"28px":"50px":void 0):t.style.removeProperty("margin-left"))),t})(),gd=e=>{const[t,n]=_();return(()=>{const o=cd(),r=o.firstChild;return Se(o,Z(le,{get when(){return(e.answer.attachments??[]).length>0},get children(){return[(()=>{const t=ad();return Se(t,Z(se,{get each(){return e.answer.attachments?.filter((e=>e.type.startsWith("image")))},children:(t,o)=>(()=>{const r=dd();return r.$$click=()=>n(t.url),T((n=>{const i=t.url,a=`Attached image ${o()+1}`,s=Ze("typebot-guest-bubble-image-attachment cursor-pointer",e.answer.attachments.filter((e=>e.type.startsWith("image"))).length>1&&"max-w-[90%]");return i!==n._v$&&xe(r,"src",n._v$=i),a!==n._v$2&&xe(r,"alt",n._v$2=a),s!==n._v$3&&ke(r,n._v$3=s),n}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r})()})),T((()=>ke(t,Ze("flex gap-1 overflow-auto max-w-[350px]",Kt()?"flex-wrap justify-end":"items-center")))),t})(),(()=>{const t=ad();return Se(t,Z(se,{get each(){return e.answer.attachments?.filter((e=>!e.type.startsWith("image")))},children:e=>Z(nd,{get file(){return{name:e.url.split("/").at(-1)}}})})),T((()=>ke(t,Ze("flex gap-1 overflow-auto max-w-[350px]",Kt()?"flex-wrap justify-end":"items-center")))),t})()]}}),r),Se(r,Z(le,{get when(){return We(e.answer.label??e.answer.value)},get children(){const t=sd();return Se(t,(()=>e.answer.label??e.answer.value)),t}})),Se(o,Z(Jc,{get isOpen(){return void 0!==t()},onClose:()=>n(void 0),get children(){const e=ld();return e.style.setProperty("border-radius","6px"),T((()=>xe(e,"src",t()))),e}}),null),o})()},hd=e=>(()=>{const t=ud(),n=t.firstChild.firstChild;return T((()=>xe(n,"src",e.answer.url))),t})();we(["click"]);const fd="Send";let md=function(e){return e.TEXT="text input",e.NUMBER="number input",e.EMAIL="email input",e.URL="url input",e.DATE="date input",e.PHONE="phone number input",e.CHOICE="choice input",e.PICTURE_CHOICE="picture choice input",e.PAYMENT="payment input",e.RATING="rating input",e.FILE="file input",e}({});const bd={button:fd,placeholder:"Type your answer..."},yd={isEnabled:!1,visibility:"Auto"},vd=ve('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><circle cx="10" cy="12" r="2"></circle><path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22">'),wd=e=>(()=>{const t=vd();return _e(t,e,!0,!0),t})(),xd=ve('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'),kd=e=>(()=>{const t=xd();return _e(t,e,!0,!0),t})(),_d=ve('<input type="file" id="document-upload" multiple class="hidden">'),Td=ve('<input type="file" id="photos-upload" accept="image/*, video/*" multiple class="hidden">'),Sd=ve('<label aria-label="Add attachments" for="document-upload">'),Ed=ve("<label> Document"),Cd=ve("<label> Photos & videos"),Pd=e=>[(()=>{const t=_d();return t.addEventListener("change",(t=>{t.currentTarget.files&&e.onNewFiles(t.currentTarget.files)})),t})(),(()=>{const t=Td();return t.addEventListener("change",(t=>{t.currentTarget.files&&e.onNewFiles(t.currentTarget.files)})),t})(),Z(ce,{get children(){return[Z(de,{get when(){return Kt()},get children(){const t=Sd();return Se(t,Z(kd,{class:"w-5"})),T((()=>ke(t,Ze("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class)))),t}}),Z(de,{when:!0,get children(){return Z(Nc.Root,{get children(){return[Z(Nc.Trigger,{get class(){return Ze("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class)},"aria-label":"Add attachments",get children(){return Z(kd,{class:"w-5"})}}),Z(Nc.Positioner,{get children(){return Z(Nc.Content,{class:"p-3 gap-2 focus:outline-none",get children(){return[Z(Nc.Item,{value:"document",asChild:e=>(()=>{const t=Ed(),n=t.firstChild;return _e(t,ne(e,{for:"document-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),Se(t,Z(ed,{class:"w-4"}),n),t})()}),Z(Nc.Item,{value:"photos",asChild:e=>(()=>{const t=Cd(),n=t.firstChild;return _e(t,ne(e,{for:"photos-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),Se(t,Z(wd,{class:"w-4"}),n),t})()})]}})}})]}})}})]}})],Id=ve('<img class="rounded-md object-cover w-[58px] h-[58px]">'),Od=ve('<div class="relative group flex-shrink-0"><button class="absolute -right-2 p-0.5 -top-2 rounded-full bg-gray-200 text-black border border-gray-400 opacity-1 sm:opacity-0 group-hover:opacity-100 transition-opacity" aria-label="Remove attachment">'),Ad=ve('<div class="absolute w-full h-full inset-0 bg-black/20 rounded-md">'),$d=e=>(()=>{const t=Od(),n=t.firstChild;return Se(t,Z(ce,{get children(){return[Z(de,{get when(){return e.file.type.startsWith("image")},get children(){const t=Id();return T((n=>{const o=URL.createObjectURL(e.file),r=e.file.name;return o!==n._v$&&xe(t,"src",n._v$=o),r!==n._v$2&&xe(t,"alt",n._v$2=r),n}),{_v$:void 0,_v$2:void 0}),t}}),Z(de,{when:!0,get children(){return Z(nd,{get file(){return e.file}})}})]}}),n),n.addEventListener("click",e.onRemoveClick),Se(n,Z(Zc,{class:"w-4"})),Se(t,Z(le,{get when(){return He(e.uploadProgressPercent)&&100!==e.uploadProgressPercent},get children(){return Z(Rd,{get progressPercent(){return e.uploadProgressPercent}})}}),null),t})(),Rd=e=>{const[t,n]=_(e.progressPercent??0);let o;return S((()=>{if(20===e.progressPercent){o=setInterval((()=>{t()<100&&n((e=>e+(Math.floor(10*Math.random())+1)))}),1e3)}})),I((()=>{clearInterval(o)})),(()=>{const e=Ad();return Se(e,Z(Uc.Root,{get value(){return t()},class:"flex items-center justify-center",get children(){return Z(Uc.Circle,{get children(){return[Z(Uc.CircleTrack,{}),Z(Uc.CircleRange,{})]}})}})),e})()},Nd=({newFile:e,existingFiles:t,params:n,onError:o})=>{const r=n.sizeLimit??wt("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE");if(r&&e.size>1024*r*1024)return void o({title:"File too large",description:`${e.name} is larger than ${r}MB`});if(0===t.length)return e;let i=e.name,a=1;for(;t.some((e=>e.name===i));){const t=e.name.lastIndexOf("."),n=-1!==t?e.name.slice(t):"";i=`${e.name.slice(0,t)}(${a})${n}`,a++}return new File([e],i,{type:e.type})},Ld=(e=>{const t=Ql.machine({id:"1",...e});return{...Ql.connect(t,t.send,Mr),machine:t}})({placement:"bottom-end",gap:24}),Dd=async({apiHost:e,files:t,onUploadProgress:n})=>{const o=[];let r=0;for(const{input:i,file:a}of t){n&&n({progress:r/t.length*100,fileIndex:r}),r+=1;const{data:s}=await ze({method:"POST",url:`${e}/api/v2/generate-upload-url`,body:{fileName:i.fileName,sessionId:i.sessionId,fileType:a.type}});if(s?.presignedUrl){const e=new FormData;Object.entries(s.formData).forEach((([t,n])=>{e.append(t,n)})),e.append("file",a);if(!(await fetch(s.presignedUrl,{method:"POST",body:e})).ok)continue;o.push({url:s.fileUrl,type:a.type})}}return o};let Md=function(e){return e.COLOR="Color",e.IMAGE="Image",e.NONE="None",e}({});const Ud="#303235",Bd="#FFFFFF",Fd="Open Sans",jd=Md.COLOR,zd="#ffffff",Hd="absolute",Vd="medium",Gd="transparent",Wd=Ud,qd=Bd,Kd="#0042DA",Yd=Bd,Xd=Ud,Zd=!0,Jd=!1,Qd=ve('<div><button class="p-0.5 rounded-full" aria-label="Stop recording"></button><div class="relative flex w-full"><canvas class="w-full h-[56px]"></canvas><div class="absolute left-gradient w-2 left-0 h-[56px]"></div><div class="absolute right-gradient w-3 right-0 h-[56px]"></div></div><span class="time-container flex-none w-[35px] font-bold text-sm">'),eu=e=>{const[t,n]=_(0);let o,r,i,a,s,l,c,d,u,p=[],g=0;const h=Ke(e.buttonsTheme?.backgroundColor??Kd).join(", "),f=()=>{if(!i||!o||!u)return;const e=performance.now(),t=e-u;u=e,i.clearRect(0,0,o.width,o.height),i.fillStyle=`rgba(${h}, 0.2)`;for(let e=0;e<(o.width+3)/6;e++){const t=6*e-g,n=.1*o.height,r=(o.height-n)/2;i.beginPath(),i.roundRect(t,r,3,n,5),i.fill()}i.fillStyle=`rgba(${h}, 1)`;for(let e=0;e<p.length;e++){const t=o.width+6*(e+1)-g,n=o.height*(p[e]/100),r=(o.height-n)/2;i.beginPath(),i.roundRect(t,r,3,n,5),i.fill()}g+=t/1e3*60,r=requestAnimationFrame(f)},m=()=>{i&&o&&i.clearRect(0,0,o.width,o.height),g=0,s?.disconnect(),s=void 0,l?.disconnect(),l=void 0,a?.close(),a=void 0,c?.getTracks().forEach((e=>e.stop())),c=void 0,p=[],clearTimeout(d),n(0),cancelAnimationFrame(r),e.onAbortRecording()};return S((()=>{"asking"===e.recordingStatus?(async()=>{o&&(c=await navigator.mediaDevices.getUserMedia({audio:!0}),e.onRecordingConfirmed(c),i||(i=o.getContext("2d")??void 0),d=setInterval((()=>{n((e=>e+1))}),1e3),a=new AudioContext,s=await tu(a),l=a.createMediaStreamSource(c),l.connect(s),s.connect(a.destination),s.port.onmessage=e=>{6*((o.width+3)/6+p.length)<o.width+g&&p.push(Math.min(Math.max(e.data,5),90))},u=performance.now(),r=requestAnimationFrame(f))})():"stopped"===e.recordingStatus&&m()})),I((()=>{m()})),(()=>{const n=Qd(),r=n.firstChild,i=r.nextSibling,a=i.firstChild,s=i.nextSibling;r.addEventListener("click",m),Se(r,Z(Zc,{class:"w-4"}));return"function"==typeof o?Te(o,a):o=a,Se(s,(()=>nu(t()))),T((()=>ke(n,Ze("w-full gap-2 items-center transition-opacity px-2 typebot-recorder","started"===e.recordingStatus?"opacity-1 flex":"opacity-0 hidden")))),n})()},tu=async e=>{const t=new Blob(['\nconst gainFactor = 3;\n\nclass VolumeProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n }\n\n process(inputs) {\n const input = inputs[0];\n if (input.length > 0) {\n const channelData = input[0];\n let sum = 0;\n for (let i = 0; i < channelData.length; i++) {\n sum += channelData[i] * channelData[i];\n }\n const rms = Math.sqrt(sum / channelData.length);\n this.port.postMessage(rms * 100 * gainFactor)\n }\n return true;\n }\n}\n\nregisterProcessor("volume-processor", VolumeProcessor);\n\n'],{type:"application/javascript"}),n=URL.createObjectURL(t);return await e.audioWorklet.addModule(n),new AudioWorkletNode(e,"volume-processor")},nu=e=>`${Math.floor(e/60)}:${(e%60).toString().padStart(2,"0")}`,ou=ve('<svg viewBox="0 0 384 512" stroke="currentColor" fill="currentColor"><path d="M192 0C139 0 96 43 96 96l0 160c0 53 43 96 96 96s96-43 96-96l0-160c0-53-43-96-96-96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 89.1 66.2 162.7 152 174.4l0 33.6-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l72 0 72 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-33.6c85.8-11.7 152-85.3 152-174.4l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 70.7-57.3 128-128 128s-128-57.3-128-128l0-40z">'),ru=e=>(()=>{const t=ou();return _e(t,e,!0,!0),t})();function iu(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})})),n}var au={},su=function(e,t){return su=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},su(e,t)};function lu(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}su(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var cu=function(){return cu=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},cu.apply(this,arguments)};function du(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function uu(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function pu(e,t){return function(n,o){t(n,o,e)}}function gu(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function hu(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))}function fu(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var mu=Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]};function bu(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||mu(t,e,n)}function yu(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function vu(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function wu(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(vu(arguments[t]));return e}function xu(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o}function ku(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function _u(e){return this instanceof _u?(this.v=e,this):new _u(e)}function Tu(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(e,t||[]),i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(e){r[e]&&(o[e]=function(t){return new Promise((function(n,o){i.push([e,t,n,o])>1||s(e,t)}))})}function s(e,t){try{!function(e){e.value instanceof _u?Promise.resolve(e.value.v).then(l,c):d(i[0][2],e)}(r[e](t))}catch(e){d(i[0][3],e)}}function l(e){s("next",e)}function c(e){s("throw",e)}function d(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function Su(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:_u(e[o](t)),done:!1}:r?r(t):t}:r}}function Eu(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=yu(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){(function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)})(o,r,(t=e[n](t)).done,t.value)}))}}}function Cu(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Pu=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function Iu(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&mu(t,e,n);return Pu(t,e),t}function Ou(e){return e&&e.__esModule?e:{default:e}}function Au(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)}function $u(e,t,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,n):r?r.value=n:t.set(e,n),n}function Ru(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function Nu(e,t,n){if(null!=t){if("object"!=typeof t)throw new TypeError("Object expected.");var o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");o=t[Symbol.asyncDispose]}if(void 0===o){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");o=t[Symbol.dispose]}if("function"!=typeof o)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:o,async:n})}else n&&e.stack.push({async:!0});return t}var Lu="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var o=new Error(n);return o.name="SuppressedError",o.error=e,o.suppressed=t,o};function Du(e){function t(t){e.error=e.hasError?new Lu(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var o=e.stack.pop();try{var r=o.dispose&&o.dispose.call(o.value);if(o.async)return Promise.resolve(r).then(n,(function(e){return t(e),n()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}var Mu,Uu={__extends:lu,__assign:cu,__rest:du,__decorate:uu,__param:pu,__metadata:gu,__awaiter:hu,__generator:fu,__createBinding:mu,__exportStar:bu,__values:yu,__read:vu,__spread:wu,__spreadArrays:xu,__spreadArray:ku,__await:_u,__asyncGenerator:Tu,__asyncDelegator:Su,__asyncValues:Eu,__makeTemplateObject:Cu,__importStar:Iu,__importDefault:Ou,__classPrivateFieldGet:Au,__classPrivateFieldSet:$u,__classPrivateFieldIn:Ru,__addDisposableResource:Nu,__disposeResources:Du},Bu=iu(Object.freeze({__proto__:null,__addDisposableResource:Nu,get __assign(){return cu},__asyncDelegator:Su,__asyncGenerator:Tu,__asyncValues:Eu,__await:_u,__awaiter:hu,__classPrivateFieldGet:Au,__classPrivateFieldIn:Ru,__classPrivateFieldSet:$u,__createBinding:mu,__decorate:uu,__disposeResources:Du,__esDecorate:function(e,t,n,o,r,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=o.kind,c="getter"===l?"get":"setter"===l?"set":"value",d=!t&&e?o.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,o.name):{}),p=!1,g=n.length-1;g>=0;g--){var h={};for(var f in o)h[f]="access"===f?{}:o[f];for(var f in o.access)h.access[f]=o.access[f];h.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var m=(0,n[g])("accessor"===l?{get:u.get,set:u.set}:u[c],h);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=a(m.get))&&(u.get=s),(s=a(m.set))&&(u.set=s),(s=a(m.init))&&r.unshift(s)}else(s=a(m))&&("field"===l?r.unshift(s):u[c]=s)}d&&Object.defineProperty(d,o.name,u),p=!0},__exportStar:bu,__extends:lu,__generator:fu,__importDefault:Ou,__importStar:Iu,__makeTemplateObject:Cu,__metadata:gu,__param:pu,__propKey:function(e){return"symbol"==typeof e?e:"".concat(e)},__read:vu,__rest:du,__runInitializers:function(e,t,n){for(var o=arguments.length>2,r=0;r<t.length;r++)n=o?t[r].call(e,n):t[r].call(e);return o?n:void 0},__setFunctionName:function(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},__spread:wu,__spreadArray:ku,__spreadArrays:xu,__values:yu,default:Uu})),Fu={},ju={},zu={};function Hu(){if(Mu)return zu;Mu=1,Object.defineProperty(zu,"__esModule",{value:!0}),zu.WebmBase=void 0;return zu.WebmBase=class{constructor(e="Unknown",t=0){this.name=e,this.start=t}getType(){return"Unknown"}updateBySource(){}setSource(e){this.source=e,this.updateBySource()}updateByData(){}setData(e){this.data=e,this.updateByData()}getValue(){return this.data}setValue(e){this.setData(e)}},zu}var Vu,Gu,Wu={},qu={},Ku={};function Yu(){return Vu||(Vu=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.SectionType=void 0,function(e){e.Container="Container",e.Uint="Uint",e.Int="Int",e.Float="Float",e.String="String",e.Date="Date",e.Binary="Binary"}(e||(Ku.SectionType=e={}))),Ku;var e}function Xu(){if(Gu)return qu;Gu=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.sections=void 0;const e=Yu();return qu.sections={172351395:{name:"EBML",type:e.SectionType.Container},646:{name:"EBMLVersion",type:e.SectionType.Uint},759:{name:"EBMLReadVersion",type:e.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:e.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:e.SectionType.Uint},642:{name:"DocType",type:e.SectionType.String},647:{name:"DocTypeVersion",type:e.SectionType.Uint},645:{name:"DocTypeReadVersion",type:e.SectionType.Uint},108:{name:"Void",type:e.SectionType.Binary},63:{name:"CRC-32",type:e.SectionType.Binary},190023271:{name:"SignatureSlot",type:e.SectionType.Container},16010:{name:"SignatureAlgo",type:e.SectionType.Uint},16026:{name:"SignatureHash",type:e.SectionType.Uint},16037:{name:"SignaturePublicKey",type:e.SectionType.Binary},16053:{name:"Signature",type:e.SectionType.Binary},15963:{name:"SignatureElements",type:e.SectionType.Container},15995:{name:"SignatureElementList",type:e.SectionType.Container},9522:{name:"SignedElement",type:e.SectionType.Binary},139690087:{name:"Segment",type:e.SectionType.Container},21863284:{name:"SeekHead",type:e.SectionType.Container},3515:{name:"Seek",type:e.SectionType.Container},5035:{name:"SeekID",type:e.SectionType.Binary},5036:{name:"SeekPosition",type:e.SectionType.Uint},88713574:{name:"Info",type:e.SectionType.Container},13220:{name:"SegmentUID",type:e.SectionType.Binary},13188:{name:"SegmentFilename",type:e.SectionType.String},1882403:{name:"PrevUID",type:e.SectionType.Binary},1868715:{name:"PrevFilename",type:e.SectionType.String},2013475:{name:"NextUID",type:e.SectionType.Binary},1999803:{name:"NextFilename",type:e.SectionType.String},1092:{name:"SegmentFamily",type:e.SectionType.Binary},10532:{name:"ChapterTranslate",type:e.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:e.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:e.SectionType.Uint},10661:{name:"ChapterTranslateID",type:e.SectionType.Binary},710577:{name:"TimecodeScale",type:e.SectionType.Uint},1161:{name:"Duration",type:e.SectionType.Float},1121:{name:"DateUTC",type:e.SectionType.Date},15273:{name:"Title",type:e.SectionType.String},3456:{name:"MuxingApp",type:e.SectionType.String},5953:{name:"WritingApp",type:e.SectionType.String},103:{name:"Timecode",type:e.SectionType.Uint},6228:{name:"SilentTracks",type:e.SectionType.Container},6359:{name:"SilentTrackNumber",type:e.SectionType.Uint},39:{name:"Position",type:e.SectionType.Uint},43:{name:"PrevSize",type:e.SectionType.Uint},35:{name:"SimpleBlock",type:e.SectionType.Binary},32:{name:"BlockGroup",type:e.SectionType.Container},33:{name:"Block",type:e.SectionType.Binary},34:{name:"BlockVirtual",type:e.SectionType.Binary},13729:{name:"BlockAdditions",type:e.SectionType.Container},38:{name:"BlockMore",type:e.SectionType.Container},110:{name:"BlockAddID",type:e.SectionType.Uint},37:{name:"BlockAdditional",type:e.SectionType.Binary},27:{name:"BlockDuration",type:e.SectionType.Uint},122:{name:"ReferencePriority",type:e.SectionType.Uint},123:{name:"ReferenceBlock",type:e.SectionType.Int},125:{name:"ReferenceVirtual",type:e.SectionType.Int},36:{name:"CodecState",type:e.SectionType.Binary},13730:{name:"DiscardPadding",type:e.SectionType.Int},14:{name:"Slices",type:e.SectionType.Container},104:{name:"TimeSlice",type:e.SectionType.Container},76:{name:"LaceNumber",type:e.SectionType.Uint},77:{name:"FrameNumber",type:e.SectionType.Uint},75:{name:"BlockAdditionID",type:e.SectionType.Uint},78:{name:"Delay",type:e.SectionType.Uint},79:{name:"SliceDuration",type:e.SectionType.Uint},72:{name:"ReferenceFrame",type:e.SectionType.Container},73:{name:"ReferenceOffset",type:e.SectionType.Uint},74:{name:"ReferenceTimeCode",type:e.SectionType.Uint},47:{name:"EncryptedBlock",type:e.SectionType.Binary},106212971:{name:"Tracks",type:e.SectionType.Container},46:{name:"TrackEntry",type:e.SectionType.Container},87:{name:"TrackNumber",type:e.SectionType.Uint},13253:{name:"TrackUID",type:e.SectionType.Uint},3:{name:"TrackType",type:e.SectionType.Uint},57:{name:"FlagEnabled",type:e.SectionType.Uint},8:{name:"FlagDefault",type:e.SectionType.Uint},5546:{name:"FlagForced",type:e.SectionType.Uint},28:{name:"FlagLacing",type:e.SectionType.Uint},11751:{name:"MinCache",type:e.SectionType.Uint},11768:{name:"MaxCache",type:e.SectionType.Uint},254851:{name:"DefaultDuration",type:e.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:e.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:e.SectionType.Float},4991:{name:"TrackOffset",type:e.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:e.SectionType.Uint},4974:{name:"Name",type:e.SectionType.String},177564:{name:"Language",type:e.SectionType.String},6:{name:"CodecID",type:e.SectionType.String},9122:{name:"CodecPrivate",type:e.SectionType.Binary},362120:{name:"CodecName",type:e.SectionType.String},13382:{name:"AttachmentLink",type:e.SectionType.Uint},1742487:{name:"CodecSettings",type:e.SectionType.String},1785920:{name:"CodecInfoURL",type:e.SectionType.String},438848:{name:"CodecDownloadURL",type:e.SectionType.String},42:{name:"CodecDecodeAll",type:e.SectionType.Uint},12203:{name:"TrackOverlay",type:e.SectionType.Uint},5802:{name:"CodecDelay",type:e.SectionType.Uint},5819:{name:"SeekPreRoll",type:e.SectionType.Uint},9764:{name:"TrackTranslate",type:e.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:e.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:e.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:e.SectionType.Binary},96:{name:"Video",type:e.SectionType.Container},26:{name:"FlagInterlaced",type:e.SectionType.Uint},5048:{name:"StereoMode",type:e.SectionType.Uint},5056:{name:"AlphaMode",type:e.SectionType.Uint},5049:{name:"OldStereoMode",type:e.SectionType.Uint},48:{name:"PixelWidth",type:e.SectionType.Uint},58:{name:"PixelHeight",type:e.SectionType.Uint},5290:{name:"PixelCropBottom",type:e.SectionType.Uint},5307:{name:"PixelCropTop",type:e.SectionType.Uint},5324:{name:"PixelCropLeft",type:e.SectionType.Uint},5341:{name:"PixelCropRight",type:e.SectionType.Uint},5296:{name:"DisplayWidth",type:e.SectionType.Uint},5306:{name:"DisplayHeight",type:e.SectionType.Uint},5298:{name:"DisplayUnit",type:e.SectionType.Uint},5299:{name:"AspectRatioType",type:e.SectionType.Uint},963876:{name:"ColourSpace",type:e.SectionType.Binary},1029411:{name:"GammaValue",type:e.SectionType.Float},230371:{name:"FrameRate",type:e.SectionType.Float},97:{name:"Audio",type:e.SectionType.Container},53:{name:"SamplingFrequency",type:e.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:e.SectionType.Float},31:{name:"Channels",type:e.SectionType.Uint},15739:{name:"ChannelPositions",type:e.SectionType.Binary},8804:{name:"BitDepth",type:e.SectionType.Uint},98:{name:"TrackOperation",type:e.SectionType.Container},99:{name:"TrackCombinePlanes",type:e.SectionType.Container},100:{name:"TrackPlane",type:e.SectionType.Container},101:{name:"TrackPlaneUID",type:e.SectionType.Uint},102:{name:"TrackPlaneType",type:e.SectionType.Uint},105:{name:"TrackJoinBlocks",type:e.SectionType.Container},109:{name:"TrackJoinUID",type:e.SectionType.Uint},64:{name:"TrickTrackUID",type:e.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:e.SectionType.Binary},70:{name:"TrickTrackFlag",type:e.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:e.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:e.SectionType.Binary},11648:{name:"ContentEncodings",type:e.SectionType.Container},8768:{name:"ContentEncoding",type:e.SectionType.Container},4145:{name:"ContentEncodingOrder",type:e.SectionType.Uint},4146:{name:"ContentEncodingScope",type:e.SectionType.Uint},4147:{name:"ContentEncodingType",type:e.SectionType.Uint},4148:{name:"ContentCompression",type:e.SectionType.Container},596:{name:"ContentCompAlgo",type:e.SectionType.Uint},597:{name:"ContentCompSettings",type:e.SectionType.Binary},4149:{name:"ContentEncryption",type:e.SectionType.Container},2017:{name:"ContentEncAlgo",type:e.SectionType.Uint},2018:{name:"ContentEncKeyID",type:e.SectionType.Binary},2019:{name:"ContentSignature",type:e.SectionType.Binary},2020:{name:"ContentSigKeyID",type:e.SectionType.Binary},2021:{name:"ContentSigAlgo",type:e.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:e.SectionType.Uint},206814059:{name:"Cues",type:e.SectionType.Container},59:{name:"CuePoint",type:e.SectionType.Container},51:{name:"CueTime",type:e.SectionType.Uint},55:{name:"CueTrackPositions",type:e.SectionType.Container},119:{name:"CueTrack",type:e.SectionType.Uint},113:{name:"CueClusterPosition",type:e.SectionType.Uint},112:{name:"CueRelativePosition",type:e.SectionType.Uint},50:{name:"CueDuration",type:e.SectionType.Uint},4984:{name:"CueBlockNumber",type:e.SectionType.Uint},106:{name:"CueCodecState",type:e.SectionType.Uint},91:{name:"CueReference",type:e.SectionType.Container},22:{name:"CueRefTime",type:e.SectionType.Uint},23:{name:"CueRefCluster",type:e.SectionType.Uint},4959:{name:"CueRefNumber",type:e.SectionType.Uint},107:{name:"CueRefCodecState",type:e.SectionType.Uint},155296873:{name:"Attachments",type:e.SectionType.Container},8615:{name:"AttachedFile",type:e.SectionType.Container},1662:{name:"FileDescription",type:e.SectionType.String},1646:{name:"FileName",type:e.SectionType.String},1632:{name:"FileMimeType",type:e.SectionType.String},1628:{name:"FileData",type:e.SectionType.Binary},1710:{name:"FileUID",type:e.SectionType.Uint},1653:{name:"FileReferral",type:e.SectionType.Binary},1633:{name:"FileUsedStartTime",type:e.SectionType.Uint},1634:{name:"FileUsedEndTime",type:e.SectionType.Uint},4433776:{name:"Chapters",type:e.SectionType.Container},1465:{name:"EditionEntry",type:e.SectionType.Container},1468:{name:"EditionUID",type:e.SectionType.Uint},1469:{name:"EditionFlagHidden",type:e.SectionType.Uint},1499:{name:"EditionFlagDefault",type:e.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:e.SectionType.Uint},54:{name:"ChapterAtom",type:e.SectionType.Container},13252:{name:"ChapterUID",type:e.SectionType.Uint},5716:{name:"ChapterStringUID",type:e.SectionType.String},17:{name:"ChapterTimeStart",type:e.SectionType.Uint},18:{name:"ChapterTimeEnd",type:e.SectionType.Uint},24:{name:"ChapterFlagHidden",type:e.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:e.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:e.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:e.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:e.SectionType.Uint},15:{name:"ChapterTrack",type:e.SectionType.Container},9:{name:"ChapterTrackNumber",type:e.SectionType.Uint},0:{name:"ChapterDisplay",type:e.SectionType.Container},5:{name:"ChapString",type:e.SectionType.String},892:{name:"ChapLanguage",type:e.SectionType.String},894:{name:"ChapCountry",type:e.SectionType.String},10564:{name:"ChapProcess",type:e.SectionType.Container},10581:{name:"ChapProcessCodecID",type:e.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:e.SectionType.Binary},10513:{name:"ChapProcessCommand",type:e.SectionType.Container},10530:{name:"ChapProcessTime",type:e.SectionType.Uint},10547:{name:"ChapProcessData",type:e.SectionType.Binary},39109479:{name:"Tags",type:e.SectionType.Container},13171:{name:"Tag",type:e.SectionType.Container},9152:{name:"Targets",type:e.SectionType.Container},10442:{name:"TargetTypeValue",type:e.SectionType.Uint},9162:{name:"TargetType",type:e.SectionType.String},9157:{name:"TagTrackUID",type:e.SectionType.Uint},9161:{name:"TagEditionUID",type:e.SectionType.Uint},9156:{name:"TagChapterUID",type:e.SectionType.Uint},9158:{name:"TagAttachmentUID",type:e.SectionType.Uint},10184:{name:"SimpleTag",type:e.SectionType.Container},1443:{name:"TagName",type:e.SectionType.String},1146:{name:"TagLanguage",type:e.SectionType.String},1156:{name:"TagDefault",type:e.SectionType.Uint},1159:{name:"TagString",type:e.SectionType.String},1157:{name:"TagBinary",type:e.SectionType.Binary},5552:{name:"Colour",type:e.SectionType.Container},5553:{name:"MatrixCoefficients",type:e.SectionType.Uint},5554:{name:"BitsPerChannel",type:e.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:e.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:e.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:e.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:e.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:e.SectionType.Uint},5560:{name:"ChromaSitingVert",type:e.SectionType.Uint},5561:{name:"Range",type:e.SectionType.Uint},5562:{name:"TransferCharacteristics",type:e.SectionType.Uint},5563:{name:"Primaries",type:e.SectionType.Uint},5564:{name:"MaxCLL",type:e.SectionType.Uint},5565:{name:"MaxFALL",type:e.SectionType.Uint}},qu}var Zu,Ju={};function Qu(){if(Zu)return Ju;Zu=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.WebmUint=void 0;const e=Hu();function t(e){return e.length%2==1?"0"+e:e}let n=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"Uint"}updateBySource(){this.data="";for(let e=0;e<this.source.length;e++){const n=this.source[e].toString(16);this.data+=t(n)}}updateByData(){const e=this.data.length/2;this.source=new Uint8Array(e);for(let t=0;t<e;t++){const e=this.data.substring(2*t,2*t+2);this.source[t]=parseInt(e,16)}}getValue(){return parseInt(this.data,16)}setValue(e){this.setData(t(e.toString(16)))}};return Ju.WebmUint=n,Ju}var ep,tp={};function np(){if(ep)return tp;ep=1,Object.defineProperty(tp,"__esModule",{value:!0}),tp.WebmFloat=void 0;const e=Hu();let t=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"Float"}getFloatArrayType(){return this.source&&4===this.source.length?Float32Array:Float64Array}updateBySource(){const e=this.source.reverse(),t=new(this.getFloatArrayType())(e.buffer);this.data=t[0]}updateByData(){const e=new(this.getFloatArrayType())([this.data]),t=new Uint8Array(e.buffer);this.source=t.reverse()}};return tp.WebmFloat=t,tp}var op,rp,ip={};function ap(){if(op)return ip;op=1,Object.defineProperty(ip,"__esModule",{value:!0}),ip.WebmString=void 0;const e=Hu();let t=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"String"}updateBySource(){this.data=this.source}updateByData(){this.source=this.data}getValue(){let e="";return this.source.forEach((t=>{e+=String.fromCharCode(t)})),e}};return ip.WebmString=t,ip}function sp(){if(rp)return Wu;rp=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.WebmContainer=void 0;const e=Hu(),t=Xu(),n=Yu(),o=Qu(),r=np(),i=ap();let a=class a extends e.WebmBase{constructor(e,t=!1,n=0){super(e,n),this.isInfinite=t,this.offset=0}getType(){return"Container"}readByte(){return this.source[this.offset++]}readUint(){const e=this.readByte(),t=8-e.toString(2).length;let n=e-(1<<7-t);for(let e=0;e<t;e++)n<<=8,n|=this.readByte();return n}updateBySource(){var s;let l;for(this.data=[],this.offset=0;this.offset<this.source.length;this.offset=l){const c=this.offset,d=this.readUint(),{name:u,type:p}=null!==(s=t.sections[d])&&void 0!==s?s:{},g=this.readUint();l=this.source.length,g>=0&&(l=Math.min(this.offset+g,l));const h=this.source.slice(this.offset,l);let f;switch(p){case n.SectionType.Container:f=new a(u,g<0,c);break;case n.SectionType.Uint:f=new o.WebmUint(u,c);break;case n.SectionType.Float:f=new r.WebmFloat(u,c);break;case n.SectionType.String:f=new i.WebmString(u,c);break;default:f=new e.WebmBase(u,c)}f.setSource(h),this.data.push({id:d,idHex:d.toString(16),data:f})}}writeUint(e,t=!1){let n;for(n=1;(e<0||e>=1<<7*n)&&n<8;n++);if(!t){for(let t=0;t<n;t++)this.source[this.offset+t]=e>>8*(n-1-t)&255;this.source[this.offset]&=(1<<8-n)-1,this.source[this.offset]|=1<<8-n}this.offset+=n}writeSections(e=!1){this.offset=0;for(let t=0;t<this.data.length;t++){const n=this.data[t],o=n.data.source,r=o.length;this.writeUint(n.id,e),this.writeUint(n.data instanceof a&&n.data.isInfinite?-1:r,e),e||this.source.set(o,this.offset),this.offset+=r}return this.offset}updateByData(){const e=this.writeSections(!0);this.source=new Uint8Array(e),this.writeSections()}getSectionById(e){for(let t=0;t<this.data.length;t++){const n=this.data[t];if(n.id===e)return n.data}return null}};return Wu.WebmContainer=a,Wu}var lp,cp={};var dp,up,pp={};function gp(){return up||(up=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Bu;t.__exportStar(Hu(),e),t.__exportStar(sp(),e),t.__exportStar(function(){if(lp)return cp;lp=1,Object.defineProperty(cp,"__esModule",{value:!0}),cp.WebmFile=void 0;const e=Bu,t=sp();let n=class n extends t.WebmContainer{constructor(e){super("File"),this.setSource(e)}getType(){return"File"}toBlob(e="video/webm"){return new Blob([this.source.buffer],{type:e})}static blobToArray(e){return new Promise(((t,n)=>{try{const o=new FileReader;o.onloadend=()=>{try{t(new Uint8Array(o.result))}catch(e){n(e)}},o.readAsArrayBuffer(e)}catch(e){n(e)}}))}static fromBlob(t){return e.__awaiter(this,void 0,void 0,(function*(){const e=yield n.blobToArray(t);return new n(e)}))}};return cp.WebmFile=n,cp}(),e),t.__exportStar(np(),e),t.__exportStar(ap(),e),t.__exportStar(Qu(),e),t.__exportStar(Yu(),e),t.__exportStar((dp||(dp=1,Object.defineProperty(pp,"__esModule",{value:!0})),pp),e),t.__exportStar(Xu(),e)}(ju)),ju}var hp,fp,mp={};function bp(){if(hp)return mp;hp=1,Object.defineProperty(mp,"__esModule",{value:!0}),mp.fixParsedWebmDuration=void 0;const e=gp();return mp.fixParsedWebmDuration=(t,n,o={})=>{let r=o.logger;void 0===r?r=e=>console.debug(e):r||(r=()=>{});const i=t.getSectionById(139690087);if(!i)return r("[fix-webm-duration] Segment section is missing"),!1;const a=i.getSectionById(88713574);if(!a)return r("[fix-webm-duration] Info section is missing"),!1;const s=a.getSectionById(710577);if(!s)return r("[fix-webm-duration] TimecodeScale section is missing"),!1;let l=a.getSectionById(1161);if(l){if(!(l.getValue()<=0))return r(`[fix-webm-duration] Duration section is present, and the value is ${l.getValue()}`),!1;r(`[fix-webm-duration] Duration section is present, but the value is ${l.getValue()}`),l.setValue(n)}else r("[fix-webm-duration] Duration section is missing"),l=new e.WebmFloat("Duration"),l.setValue(n),a.data.push({id:1161,data:l});return s.setValue(1e6),a.updateByData(),i.updateByData(),t.updateByData(),!0},mp}!function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Bu;t.__exportStar(function(){if(fp)return Fu;fp=1,Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.fixWebmDuration=void 0;const e=Bu,t=gp(),n=bp();return Fu.fixWebmDuration=(o,r,i)=>e.__awaiter(void 0,void 0,void 0,(function*(){try{const e=yield t.WebmFile.fromBlob(o);if((0,n.fixParsedWebmDuration)(e,r,i))return e.toBlob(o.type)}catch(e){}return o})),Fu}(),e),t.__exportStar(bp(),e)}(au);const yp=ve('<div class="p-2 flex gap-2 border-gray-100 overflow-auto">'),vp=ve("<div>"),wp=ve("<div><div>"),xp=e=>{const[t,n]=_(e.defaultValue??""),[o,r]=_([]),[i,a]=_(void 0),[s,l]=_(!1),[c,d]=_("stopped");let u,p,g=[];const h=e=>n(e),f=async()=>{if("started"===c()&&p)p.stop();else if(""!==u?.value&&u?.reportValidity()){let n;if(o().length>0){a(void 0);const t=await Dd({apiHost:e.context.apiHost??xt({ignoreChatApiUrl:!0}),files:o().map((t=>({file:t,input:{sessionId:e.context.sessionId,fileName:t.name}}))),onUploadProgress:a});n=t?.filter(He)}e.onSubmit({type:"text",value:u?.value??t(),attachments:n})}else u?.focus()},m=t=>{e.block.options?.isLong||"Enter"===t.key&&f()},b=t=>{e.block.options?.isLong&&"Enter"===t.key&&(t.metaKey||t.ctrlKey)&&f()};P((()=>{!Kt()&&u&&u.focus({preventScroll:!0}),window.addEventListener("message",y)})),I((()=>{window.removeEventListener("message",y)}));const y=e=>{const{data:t}=e;t.isFromTypebot&&"setInputValue"===t.command&&n(t.value)},v=e=>{e.preventDefault(),l(!0)},w=()=>l(!1),x=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer?.files&&k(e.dataTransfer.files)},k=e=>{const t=Array.from(e).map((e=>Nd({existingFiles:o(),newFile:e,params:{sizeLimit:wt("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE")},onError:({description:e,title:t})=>{Ld.create({description:e,title:t})}}))).filter(He);0!==t.length&&r((e=>[...t,...e]))},S=()=>{d("asking")},C=t=>{let n;const o=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";p=new MediaRecorder(t,{mimeType:o}),p.ondataavailable=e=>{0!==e.data.size&&g.push(e.data)},p.onstart=()=>{n=Date.now()},p.onstop=async()=>{if("started"!==c()||0===g.length)return;const t=Date.now()-n,r=await au.fixWebmDuration(new Blob(g,{type:o}),t),i=new File([r],`rec-${e.block.id}-${Date.now()}.${"audio/webm"===o?"webm":"mp4"}`,{type:o});a(void 0);const s=(await Dd({apiHost:e.context.apiHost??xt({ignoreChatApiUrl:!0}),files:[{file:i,input:{sessionId:e.context.sessionId,fileName:i.name}}],onUploadProgress:a})).filter(He).map((e=>e.url));e.onSubmit({type:"recording",url:s[0]})},p.start(),d("started")},O=()=>{p?.stop(),d("stopped"),p=void 0,g=[]};return(()=>{const n=wp(),a=n.firstChild;return n.addEventListener("dragleave",w),n.addEventListener("dragover",v),n.addEventListener("drop",x),n.$$keydown=m,Se(a,Z(eu,{get recordingStatus(){return c()},get buttonsTheme(){return e.context.typebot.theme.chat?.buttons},onRecordingConfirmed:C,onAbortRecording:O}),null),Se(a,Z(le,{get when(){return"started"!==c()},get children(){return[Z(le,{get when(){return o().length},get children(){const e=yp();return e.style.setProperty("border-bottom-width","1px"),Se(e,Z(se,{get each(){return o()},children:(e,t)=>Z($d,{file:e,get uploadProgressPercent(){return E((()=>!!i()))()?E((()=>i()?.fileIndex===t()))()?20:t()<(i()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>(e=>{r((t=>t.filter(((t,n)=>n!==e))))})(t())})})),e}}),(()=>{const n=vp();return Se(n,(()=>{const n=E((()=>!!e.block.options?.isLong));return()=>n()?Z(cn,{ref(e){"function"==typeof u?u(e):u=e},onInput:h,onKeyDown:b,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??bd.placeholder}}):Z(sn,{ref(e){"function"==typeof u?u(e):u=e},onInput:h,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??bd.placeholder}})})(),null),Se(n,Z(le,{get when(){return(e.block.options?.attachments?.isEnabled??yd.isEnabled)&&e.block.options?.attachments?.saveVariableId},get children(){return Z(Pd,{onNewFiles:k,get class(){return Ze(e.block.options?.isLong?"ml-2":void 0)}})}}),null),T((()=>ke(n,Ze("flex justify-between px-2",e.block.options?.isLong?"items-end":"items-center")))),n})()]}}),null),Se(n,Z(ce,{get children(){return[Z(de,{get when(){return!t()&&"started"!==c()&&e.block.options?.audioClip?.isEnabled},get children(){return Z(tn,{class:"h-[56px] flex items-center","on:click":S,"aria-label":"Record voice",get children(){return Z(ru,{class:"flex w-6 h-6"})}})}}),Z(de,{when:!0,get children(){return Z(nn,{type:"button","on:click":f,get isDisabled(){return Boolean(i())},class:"h-[56px]",get children(){return e.block.options?.labels?.button}})}})]}}),null),T((t=>{const o=Ze("typebot-input-form flex w-full gap-2 items-end",e.block.options?.isLong&&"started"!==c()?"max-w-full":"max-w-[350px]"),r=Ze("relative typebot-input flex-col w-full",s()&&"filter brightness-95");return o!==t._v$&&ke(n,t._v$=o),r!==t._v$2&&ke(a,t._v$2=r),t}),{_v$:void 0,_v$2:void 0}),n})()};we(["keydown"]);const kp={button:fd,placeholder:"Type a number..."},_p=ve('<div class="typebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex typebot-input w-full"><input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input" type="number">'),Tp=e=>{const[t,n]=_(e.defaultValue??""),[o,r,i]=[C(a=()=>t()),function(e){S((function(){const t=a();if(null==t)return void(e.value=t);const n=e.value;(0===t&&""===n||t!=n)&&(e.value=t+"")}))},function(e){return e.validity.badInput?a():""!=e.value?e.valueAsNumber:void 0}];var a;let s;const l=()=>{""!==s?.value&&s?.reportValidity()?e.onSubmit({type:"text",value:s?.value??t().toString()}):s?.focus()},c=e=>{"Enter"===e.key&&l()};P((()=>{!Kt()&&s&&s.focus({preventScroll:!0}),window.addEventListener("message",d)})),I((()=>{window.removeEventListener("message",d)}));const d=e=>{const{data:t}=e;t.isFromTypebot&&"setInputValue"===t.command&&n(t.value)};return(()=>{const t=_p(),a=t.firstChild.firstChild;t.$$keydown=c,a.$$input=e=>{n(i(e.currentTarget))},Te(r,a,(()=>!0));return"function"==typeof s?Te(s,a):s=a,a.style.setProperty("font-size","16px"),a.style.setProperty("appearance","auto"),a.value=o,Se(t,Z(nn,{type:"button",class:"h-[56px]","on:click":l,get children(){return e.block.options?.labels?.button}}),null),T((t=>{const n=e.block.options?.labels?.placeholder??kp.placeholder,o=e.block.options?.min,r=e.block.options?.max,i=e.block.options?.step??"any";return n!==t._v$&&xe(a,"placeholder",t._v$=n),o!==t._v$2&&xe(a,"min",t._v$2=o),r!==t._v$3&&xe(a,"max",t._v$3=r),i!==t._v$4&&xe(a,"step",t._v$4=i),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t})()};we(["keydown","input"]);const Sp={button:fd,placeholder:"Type your email..."},Ep=ve('<div class="typebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex typebot-input w-full">'),Cp=e=>{const[t,n]=_(e.defaultValue??"");let o;const r=e=>n(e),i=()=>{""!==o?.value&&o?.reportValidity()?e.onSubmit({type:"text",value:o?.value??t()}):o?.focus()},a=e=>{"Enter"===e.key&&i()};P((()=>{!Kt()&&o&&o.focus({preventScroll:!0}),window.addEventListener("message",s)})),I((()=>{window.removeEventListener("message",s)}));const s=e=>{const{data:t}=e;t.isFromTypebot&&"setInputValue"===t.command&&n(t.value)};return(()=>{const n=Ep(),s=n.firstChild;return n.$$keydown=a,Se(s,Z(sn,{ref(e){"function"==typeof o?o(e):o=e},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Sp.placeholder},onInput:r,type:"email",autocomplete:"email"})),Se(n,Z(nn,{type:"button",class:"h-[56px]","on:click":i,get children(){return e.block.options?.labels?.button}}),null),n})()};we(["keydown"]);const Pp={button:fd,placeholder:"Type a URL..."},Ip=ve('<div class="typebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex typebot-input w-full">'),Op=e=>{const[t,n]=_(e.defaultValue??"");let o;const r=e=>{n(e)},i=()=>{o&&!o?.value.startsWith("http")&&(o.value=`https://${o.value}`),""!==o?.value&&o?.reportValidity()?e.onSubmit({type:"text",value:o?.value??t()}):o?.focus()},a=e=>{"Enter"===e.key&&i()};P((()=>{!Kt()&&o&&o.focus({preventScroll:!0}),window.addEventListener("message",s)})),I((()=>{window.removeEventListener("message",s)}));const s=e=>{const{data:t}=e;t.isFromTypebot&&"setInputValue"===t.command&&n(t.value)};return(()=>{const n=Ip(),s=n.firstChild;return n.$$keydown=a,Se(s,Z(sn,{ref(e){"function"==typeof o?o(e):o=e},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??Pp.placeholder},onInput:r,type:"url",autocomplete:"url"})),Se(n,Z(nn,{type:"button",class:"h-[56px]","on:click":i,get children(){return e.block.options?.labels?.button}}),null),n})()};we(["keydown"]);const Ap=ve('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9">'),$p=e=>(()=>{const t=Ap();return _e(t,e,!0,!0),t})(),Rp=[{name:"International",flag:"🌐",code:"INT",dial_code:null},{name:"Afghanistan",flag:"🇦🇫",code:"AF",dial_code:"+93"},{name:"Åland Islands",flag:"🇦🇽",code:"AX",dial_code:"+358"},{name:"Albania",flag:"🇦🇱",code:"AL",dial_code:"+355"},{name:"Algeria",flag:"🇩🇿",code:"DZ",dial_code:"+213"},{name:"American Samoa",flag:"🇦🇸",code:"AS",dial_code:"+1684"},{name:"Andorra",flag:"🇦🇩",code:"AD",dial_code:"+376"},{name:"Angola",flag:"🇦🇴",code:"AO",dial_code:"+244"},{name:"Anguilla",flag:"🇦🇮",code:"AI",dial_code:"+1264"},{name:"Antarctica",flag:"🇦🇶",code:"AQ",dial_code:"+672"},{name:"Antigua and Barbuda",flag:"🇦🇬",code:"AG",dial_code:"+1268"},{name:"Argentina",flag:"🇦🇷",code:"AR",dial_code:"+54"},{name:"Armenia",flag:"🇦🇲",code:"AM",dial_code:"+374"},{name:"Aruba",flag:"🇦🇼",code:"AW",dial_code:"+297"},{name:"Australia",flag:"🇦🇺",code:"AU",dial_code:"+61"},{name:"Austria",flag:"🇦🇹",code:"AT",dial_code:"+43"},{name:"Azerbaijan",flag:"🇦🇿",code:"AZ",dial_code:"+994"},{name:"Bahamas",flag:"🇧🇸",code:"BS",dial_code:"+1242"},{name:"Bahrain",flag:"🇧🇭",code:"BH",dial_code:"+973"},{name:"Bangladesh",flag:"🇧🇩",code:"BD",dial_code:"+880"},{name:"Barbados",flag:"🇧🇧",code:"BB",dial_code:"+1246"},{name:"Belarus",flag:"🇧🇾",code:"BY",dial_code:"+375"},{name:"Belgium",flag:"🇧🇪",code:"BE",dial_code:"+32"},{name:"Belize",flag:"🇧🇿",code:"BZ",dial_code:"+501"},{name:"Benin",flag:"🇧🇯",code:"BJ",dial_code:"+229"},{name:"Bermuda",flag:"🇧🇲",code:"BM",dial_code:"+1441"},{name:"Bhutan",flag:"🇧🇹",code:"BT",dial_code:"+975"},{name:"Bolivia, Plurinational State of bolivia",flag:"🇧🇴",code:"BO",dial_code:"+591"},{name:"Bosnia and Herzegovina",flag:"🇧🇦",code:"BA",dial_code:"+387"},{name:"Botswana",flag:"🇧🇼",code:"BW",dial_code:"+267"},{name:"Bouvet Island",flag:"🇧🇻",code:"BV",dial_code:"+47"},{name:"Brazil",flag:"🇧🇷",code:"BR",dial_code:"+55"},{name:"British Indian Ocean Territory",flag:"🇮🇴",code:"IO",dial_code:"+246"},{name:"Brunei Darussalam",flag:"🇧🇳",code:"BN",dial_code:"+673"},{name:"Bulgaria",flag:"🇧🇬",code:"BG",dial_code:"+359"},{name:"Burkina Faso",flag:"🇧🇫",code:"BF",dial_code:"+226"},{name:"Burundi",flag:"🇧🇮",code:"BI",dial_code:"+257"},{name:"Cambodia",flag:"🇰🇭",code:"KH",dial_code:"+855"},{name:"Cameroon",flag:"🇨🇲",code:"CM",dial_code:"+237"},{name:"Canada",flag:"🇨🇦",code:"CA",dial_code:"+1"},{name:"Cape Verde",flag:"🇨🇻",code:"CV",dial_code:"+238"},{name:"Cayman Islands",flag:"🇰🇾",code:"KY",dial_code:"+345"},{name:"Central African Republic",flag:"🇨🇫",code:"CF",dial_code:"+236"},{name:"Chad",flag:"🇹🇩",code:"TD",dial_code:"+235"},{name:"Chile",flag:"🇨🇱",code:"CL",dial_code:"+56"},{name:"China",flag:"🇨🇳",code:"CN",dial_code:"+86"},{name:"Christmas Island",flag:"🇨🇽",code:"CX",dial_code:"+61"},{name:"Cocos (Keeling) Islands",flag:"🇨🇨",code:"CC",dial_code:"+61"},{name:"Colombia",flag:"🇨🇴",code:"CO",dial_code:"+57"},{name:"Comoros",flag:"🇰🇲",code:"KM",dial_code:"+269"},{name:"Congo",flag:"🇨🇬",code:"CG",dial_code:"+242"},{name:"Congo, The Democratic Republic of the Congo",flag:"🇨🇩",code:"CD",dial_code:"+243"},{name:"Cook Islands",flag:"🇨🇰",code:"CK",dial_code:"+682"},{name:"Costa Rica",flag:"🇨🇷",code:"CR",dial_code:"+506"},{name:"Cote d'Ivoire",flag:"🇨🇮",code:"CI",dial_code:"+225"},{name:"Croatia",flag:"🇭🇷",code:"HR",dial_code:"+385"},{name:"Cuba",flag:"🇨🇺",code:"CU",dial_code:"+53"},{name:"Cyprus",flag:"🇨🇾",code:"CY",dial_code:"+357"},{name:"Czech Republic",flag:"🇨🇿",code:"CZ",dial_code:"+420"},{name:"Denmark",flag:"🇩🇰",code:"DK",dial_code:"+45"},{name:"Djibouti",flag:"🇩🇯",code:"DJ",dial_code:"+253"},{name:"Dominica",flag:"🇩🇲",code:"DM",dial_code:"+1767"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1849"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1829"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1809"},{name:"Ecuador",flag:"🇪🇨",code:"EC",dial_code:"+593"},{name:"Egypt",flag:"🇪🇬",code:"EG",dial_code:"+20"},{name:"El Salvador",flag:"🇸🇻",code:"SV",dial_code:"+503"},{name:"Equatorial Guinea",flag:"🇬🇶",code:"GQ",dial_code:"+240"},{name:"Eritrea",flag:"🇪🇷",code:"ER",dial_code:"+291"},{name:"Estonia",flag:"🇪🇪",code:"EE",dial_code:"+372"},{name:"Ethiopia",flag:"🇪🇹",code:"ET",dial_code:"+251"},{name:"Falkland Islands (Malvinas)",flag:"🇫🇰",code:"FK",dial_code:"+500"},{name:"Faroe Islands",flag:"🇫🇴",code:"FO",dial_code:"+298"},{name:"Fiji",flag:"🇫🇯",code:"FJ",dial_code:"+679"},{name:"Finland",flag:"🇫🇮",code:"FI",dial_code:"+358"},{name:"France",flag:"🇫🇷",code:"FR",dial_code:"+33"},{name:"French Guiana",flag:"🇬🇫",code:"GF",dial_code:"+594"},{name:"French Polynesia",flag:"🇵🇫",code:"PF",dial_code:"+689"},{name:"French Southern Territories",flag:"🇹🇫",code:"TF",dial_code:"+262"},{name:"Gabon",flag:"🇬🇦",code:"GA",dial_code:"+241"},{name:"Gambia",flag:"🇬🇲",code:"GM",dial_code:"+220"},{name:"Georgia",flag:"🇬🇪",code:"GE",dial_code:"+995"},{name:"Germany",flag:"🇩🇪",code:"DE",dial_code:"+49"},{name:"Ghana",flag:"🇬🇭",code:"GH",dial_code:"+233"},{name:"Gibraltar",flag:"🇬🇮",code:"GI",dial_code:"+350"},{name:"Greece",flag:"🇬🇷",code:"GR",dial_code:"+30"},{name:"Greenland",flag:"🇬🇱",code:"GL",dial_code:"+299"},{name:"Grenada",flag:"🇬🇩",code:"GD",dial_code:"+1473"},{name:"Guadeloupe",flag:"🇬🇵",code:"GP",dial_code:"+590"},{name:"Guam",flag:"🇬🇺",code:"GU",dial_code:"+1671"},{name:"Guatemala",flag:"🇬🇹",code:"GT",dial_code:"+502"},{name:"Guernsey",flag:"🇬🇬",code:"GG",dial_code:"+44"},{name:"Guinea",flag:"🇬🇳",code:"GN",dial_code:"+224"},{name:"Guinea-Bissau",flag:"🇬🇼",code:"GW",dial_code:"+245"},{name:"Guyana",flag:"🇬🇾",code:"GY",dial_code:"+592"},{name:"Haiti",flag:"🇭🇹",code:"HT",dial_code:"+509"},{name:"Heard Island and Mcdonald Islands",flag:"🇭🇲",code:"HM",dial_code:"+672"},{name:"Holy See (Vatican City State)",flag:"🇻🇦",code:"VA",dial_code:"+379"},{name:"Honduras",flag:"🇭🇳",code:"HN",dial_code:"+504"},{name:"Hong Kong",flag:"🇭🇰",code:"HK",dial_code:"+852"},{name:"Hungary",flag:"🇭🇺",code:"HU",dial_code:"+36"},{name:"Iceland",flag:"🇮🇸",code:"IS",dial_code:"+354"},{name:"India",flag:"🇮🇳",code:"IN",dial_code:"+91"},{name:"Indonesia",flag:"🇮🇩",code:"ID",dial_code:"+62"},{name:"Iran, Islamic Republic of Persian Gulf",flag:"🇮🇷",code:"IR",dial_code:"+98"},{name:"Iraq",flag:"🇮🇶",code:"IQ",dial_code:"+964"},{name:"Ireland",flag:"🇮🇪",code:"IE",dial_code:"+353"},{name:"Isle of Man",flag:"🇮🇲",code:"IM",dial_code:"+44"},{name:"Israel",flag:"🇮🇱",code:"IL",dial_code:"+972"},{name:"Italy",flag:"🇮🇹",code:"IT",dial_code:"+39"},{name:"Jamaica",flag:"🇯🇲",code:"JM",dial_code:"+1876"},{name:"Japan",flag:"🇯🇵",code:"JP",dial_code:"+81"},{name:"Jersey",flag:"🇯🇪",code:"JE",dial_code:"+44"},{name:"Jordan",flag:"🇯🇴",code:"JO",dial_code:"+962"},{name:"Kazakhstan",flag:"🇰🇿",code:"KZ",dial_code:"+7"},{name:"Kenya",flag:"🇰🇪",code:"KE",dial_code:"+254"},{name:"Kiribati",flag:"🇰🇮",code:"KI",dial_code:"+686"},{name:"Korea, Democratic People's Republic of Korea",flag:"🇰🇵",code:"KP",dial_code:"+850"},{name:"Korea, Republic of South Korea",flag:"🇰🇷",code:"KR",dial_code:"+82"},{name:"Kosovo",flag:"🇽🇰",code:"XK",dial_code:"+383"},{name:"Kuwait",flag:"🇰🇼",code:"KW",dial_code:"+965"},{name:"Kyrgyzstan",flag:"🇰🇬",code:"KG",dial_code:"+996"},{name:"Laos",flag:"🇱🇦",code:"LA",dial_code:"+856"},{name:"Latvia",flag:"🇱🇻",code:"LV",dial_code:"+371"},{name:"Lebanon",flag:"🇱🇧",code:"LB",dial_code:"+961"},{name:"Lesotho",flag:"🇱🇸",code:"LS",dial_code:"+266"},{name:"Liberia",flag:"🇱🇷",code:"LR",dial_code:"+231"},{name:"Libyan Arab Jamahiriya",flag:"🇱🇾",code:"LY",dial_code:"+218"},{name:"Liechtenstein",flag:"🇱🇮",code:"LI",dial_code:"+423"},{name:"Lithuania",flag:"🇱🇹",code:"LT",dial_code:"+370"},{name:"Luxembourg",flag:"🇱🇺",code:"LU",dial_code:"+352"},{name:"Macao",flag:"🇲🇴",code:"MO",dial_code:"+853"},{name:"Macedonia",flag:"🇲🇰",code:"MK",dial_code:"+389"},{name:"Madagascar",flag:"🇲🇬",code:"MG",dial_code:"+261"},{name:"Malawi",flag:"🇲🇼",code:"MW",dial_code:"+265"},{name:"Malaysia",flag:"🇲🇾",code:"MY",dial_code:"+60"},{name:"Maldives",flag:"🇲🇻",code:"MV",dial_code:"+960"},{name:"Mali",flag:"🇲🇱",code:"ML",dial_code:"+223"},{name:"Malta",flag:"🇲🇹",code:"MT",dial_code:"+356"},{name:"Marshall Islands",flag:"🇲🇭",code:"MH",dial_code:"+692"},{name:"Martinique",flag:"🇲🇶",code:"MQ",dial_code:"+596"},{name:"Mauritania",flag:"🇲🇷",code:"MR",dial_code:"+222"},{name:"Mauritius",flag:"🇲🇺",code:"MU",dial_code:"+230"},{name:"Mayotte",flag:"🇾🇹",code:"YT",dial_code:"+262"},{name:"Mexico",flag:"🇲🇽",code:"MX",dial_code:"+52"},{name:"Micronesia, Federated States of Micronesia",flag:"🇫🇲",code:"FM",dial_code:"+691"},{name:"Moldova",flag:"🇲🇩",code:"MD",dial_code:"+373"},{name:"Monaco",flag:"🇲🇨",code:"MC",dial_code:"+377"},{name:"Mongolia",flag:"🇲🇳",code:"MN",dial_code:"+976"},{name:"Montenegro",flag:"🇲🇪",code:"ME",dial_code:"+382"},{name:"Montserrat",flag:"🇲🇸",code:"MS",dial_code:"+1664"},{name:"Morocco",flag:"🇲🇦",code:"MA",dial_code:"+212"},{name:"Mozambique",flag:"🇲🇿",code:"MZ",dial_code:"+258"},{name:"Myanmar",flag:"🇲🇲",code:"MM",dial_code:"+95"},{name:"Namibia",flag:"🇳🇦",code:"NA",dial_code:"+264"},{name:"Nauru",flag:"🇳🇷",code:"NR",dial_code:"+674"},{name:"Nepal",flag:"🇳🇵",code:"NP",dial_code:"+977"},{name:"Netherlands",flag:"🇳🇱",code:"NL",dial_code:"+31"},{name:"Netherlands Antilles",flag:"",code:"AN",dial_code:"+599"},{name:"New Caledonia",flag:"🇳🇨",code:"NC",dial_code:"+687"},{name:"New Zealand",flag:"🇳🇿",code:"NZ",dial_code:"+64"},{name:"Nicaragua",flag:"🇳🇮",code:"NI",dial_code:"+505"},{name:"Niger",flag:"🇳🇪",code:"NE",dial_code:"+227"},{name:"Nigeria",flag:"🇳🇬",code:"NG",dial_code:"+234"},{name:"Niue",flag:"🇳🇺",code:"NU",dial_code:"+683"},{name:"Norfolk Island",flag:"🇳🇫",code:"NF",dial_code:"+672"},{name:"Northern Mariana Islands",flag:"🇲🇵",code:"MP",dial_code:"+1670"},{name:"Norway",flag:"🇳🇴",code:"NO",dial_code:"+47"},{name:"Oman",flag:"🇴🇲",code:"OM",dial_code:"+968"},{name:"Pakistan",flag:"🇵🇰",code:"PK",dial_code:"+92"},{name:"Palau",flag:"🇵🇼",code:"PW",dial_code:"+680"},{name:"Palestinian Territory, Occupied",flag:"🇵🇸",code:"PS",dial_code:"+970"},{name:"Panama",flag:"🇵🇦",code:"PA",dial_code:"+507"},{name:"Papua New Guinea",flag:"🇵🇬",code:"PG",dial_code:"+675"},{name:"Paraguay",flag:"🇵🇾",code:"PY",dial_code:"+595"},{name:"Peru",flag:"🇵🇪",code:"PE",dial_code:"+51"},{name:"Philippines",flag:"🇵🇭",code:"PH",dial_code:"+63"},{name:"Pitcairn",flag:"🇵🇳",code:"PN",dial_code:"+64"},{name:"Poland",flag:"🇵🇱",code:"PL",dial_code:"+48"},{name:"Portugal",flag:"🇵🇹",code:"PT",dial_code:"+351"},{name:"Puerto Rico",flag:"🇵🇷",code:"PR",dial_code:"+1939"},{name:"Qatar",flag:"🇶🇦",code:"QA",dial_code:"+974"},{name:"Romania",flag:"🇷🇴",code:"RO",dial_code:"+40"},{name:"Russia",flag:"🇷🇺",code:"RU",dial_code:"+7"},{name:"Rwanda",flag:"🇷🇼",code:"RW",dial_code:"+250"},{name:"Reunion",flag:"🇷🇪",code:"RE",dial_code:"+262"},{name:"Saint Barthelemy",flag:"🇧🇱",code:"BL",dial_code:"+590"},{name:"Saint Helena, Ascension and Tristan Da Cunha",flag:"🇸🇭",code:"SH",dial_code:"+290"},{name:"Saint Kitts and Nevis",flag:"🇰🇳",code:"KN",dial_code:"+1869"},{name:"Saint Lucia",flag:"🇱🇨",code:"LC",dial_code:"+1758"},{name:"Saint Martin",flag:"🇲🇫",code:"MF",dial_code:"+590"},{name:"Saint Pierre and Miquelon",flag:"🇵🇲",code:"PM",dial_code:"+508"},{name:"Saint Vincent and the Grenadines",flag:"🇻🇨",code:"VC",dial_code:"+1784"},{name:"Samoa",flag:"🇼🇸",code:"WS",dial_code:"+685"},{name:"San Marino",flag:"🇸🇲",code:"SM",dial_code:"+378"},{name:"Sao Tome and Principe",flag:"🇸🇹",code:"ST",dial_code:"+239"},{name:"Saudi Arabia",flag:"🇸🇦",code:"SA",dial_code:"+966"},{name:"Senegal",flag:"🇸🇳",code:"SN",dial_code:"+221"},{name:"Serbia",flag:"🇷🇸",code:"RS",dial_code:"+381"},{name:"Seychelles",flag:"🇸🇨",code:"SC",dial_code:"+248"},{name:"Sierra Leone",flag:"🇸🇱",code:"SL",dial_code:"+232"},{name:"Singapore",flag:"🇸🇬",code:"SG",dial_code:"+65"},{name:"Slovakia",flag:"🇸🇰",code:"SK",dial_code:"+421"},{name:"Slovenia",flag:"🇸🇮",code:"SI",dial_code:"+386"},{name:"Solomon Islands",flag:"🇸🇧",code:"SB",dial_code:"+677"},{name:"Somalia",flag:"🇸🇴",code:"SO",dial_code:"+252"},{name:"South Africa",flag:"🇿🇦",code:"ZA",dial_code:"+27"},{name:"South Sudan",flag:"🇸🇸",code:"SS",dial_code:"+211"},{name:"South Georgia and the South Sandwich Islands",flag:"🇬🇸",code:"GS",dial_code:"+500"},{name:"Spain",flag:"🇪🇸",code:"ES",dial_code:"+34"},{name:"Sri Lanka",flag:"🇱🇰",code:"LK",dial_code:"+94"},{name:"Sudan",flag:"🇸🇩",code:"SD",dial_code:"+249"},{name:"Suriname",flag:"🇸🇷",code:"SR",dial_code:"+597"},{name:"Svalbard and Jan Mayen",flag:"🇸🇯",code:"SJ",dial_code:"+47"},{name:"Swaziland",flag:"🇸🇿",code:"SZ",dial_code:"+268"},{name:"Sweden",flag:"🇸🇪",code:"SE",dial_code:"+46"},{name:"Switzerland",flag:"🇨🇭",code:"CH",dial_code:"+41"},{name:"Syrian Arab Republic",flag:"🇸🇾",code:"SY",dial_code:"+963"},{name:"Taiwan",flag:"🇹🇼",code:"TW",dial_code:"+886"},{name:"Tajikistan",flag:"🇹🇯",code:"TJ",dial_code:"+992"},{name:"Tanzania, United Republic of Tanzania",flag:"🇹🇿",code:"TZ",dial_code:"+255"},{name:"Thailand",flag:"🇹🇭",code:"TH",dial_code:"+66"},{name:"Timor-Leste",flag:"🇹🇱",code:"TL",dial_code:"+670"},{name:"Togo",flag:"🇹🇬",code:"TG",dial_code:"+228"},{name:"Tokelau",flag:"🇹🇰",code:"TK",dial_code:"+690"},{name:"Tonga",flag:"🇹🇴",code:"TO",dial_code:"+676"},{name:"Trinidad and Tobago",flag:"🇹🇹",code:"TT",dial_code:"+1868"},{name:"Tunisia",flag:"🇹🇳",code:"TN",dial_code:"+216"},{name:"Turkey",flag:"🇹🇷",code:"TR",dial_code:"+90"},{name:"Turkmenistan",flag:"🇹🇲",code:"TM",dial_code:"+993"},{name:"Turks and Caicos Islands",flag:"🇹🇨",code:"TC",dial_code:"+1649"},{name:"Tuvalu",flag:"🇹🇻",code:"TV",dial_code:"+688"},{name:"Uganda",flag:"🇺🇬",code:"UG",dial_code:"+256"},{name:"Ukraine",flag:"🇺🇦",code:"UA",dial_code:"+380"},{name:"United Arab Emirates",flag:"🇦🇪",code:"AE",dial_code:"+971"},{name:"United Kingdom",flag:"🇬🇧",code:"GB",dial_code:"+44"},{name:"United States",flag:"🇺🇸",code:"US",dial_code:"+1"},{name:"Uruguay",flag:"🇺🇾",code:"UY",dial_code:"+598"},{name:"Uzbekistan",flag:"🇺🇿",code:"UZ",dial_code:"+998"},{name:"Vanuatu",flag:"🇻🇺",code:"VU",dial_code:"+678"},{name:"Venezuela, Bolivarian Republic of Venezuela",flag:"🇻🇪",code:"VE",dial_code:"+58"},{name:"Vietnam",flag:"🇻🇳",code:"VN",dial_code:"+84"},{name:"Virgin Islands, British",flag:"🇻🇬",code:"VG",dial_code:"+1284"},{name:"Virgin Islands, U.S.",flag:"🇻🇮",code:"VI",dial_code:"+1340"},{name:"Wallis and Futuna",flag:"🇼🇫",code:"WF",dial_code:"+681"},{name:"Yemen",flag:"🇾🇪",code:"YE",dial_code:"+967"},{name:"Zambia",flag:"🇿🇲",code:"ZM",dial_code:"+260"},{name:"Zimbabwe",flag:"🇿🇼",code:"ZW",dial_code:"+263"}],Np={button:fd,placeholder:"Type your phone number..."},Lp=ve('<div class="typebot-input-form flex w-full gap-2 items-end max-w-[350px]"><div class="flex typebot-input w-full"><div class="relative typebot-country-select flex justify-center items-center"><div class="pl-2 pr-1 flex items-center gap-2"><span></span></div><select class="absolute top-0 left-0 w-full h-full cursor-pointer opacity-0">'),Dp=ve("<option> "),Mp=e=>{const[t,n]=_(Ge(e.defaultCountryCode)?"INT":e.defaultCountryCode),[o,r]=_(e.defaultValue??"");let i;const a=e=>{r(e),""!==e&&"+"!==e||"INT"===t()||n("INT");const o=e?.startsWith("+")&&e.length>2&&Rp.reduce(((t,n)=>!n?.dial_code||null!==t&&!t.dial_code?t:e?.startsWith(n.dial_code)&&n.dial_code.length>(t?.dial_code.length??0)?n:t),null);o&&n(o.code)},s=()=>{const n=Rp.find((e=>e.code===t()))?.dial_code;if(""!==i?.value&&i?.reportValidity()){const t=i?.value??o();e.onSubmit({type:"text",value:t.startsWith("+")?t:`${n??""}${t}`})}else i?.focus()},l=e=>{"Enter"===e.key&&s()},c=e=>{const t=e.currentTarget.value;n(t);const a=Rp.find((e=>e.code===t))?.dial_code;""===o()&&a&&r(a),i?.focus()};P((()=>{!Kt()&&i&&i.focus({preventScroll:!0}),window.addEventListener("message",d)})),I((()=>{window.removeEventListener("message",d)}));const d=e=>{const{data:t}=e;t.isFromTypebot&&"setInputValue"===t.command&&r(t.value)};return(()=>{const n=Lp(),r=n.firstChild,d=r.firstChild.firstChild,u=d.firstChild,p=d.nextSibling;return n.$$keydown=l,Se(u,(()=>Rp.find((e=>t()===e.code))?.flag)),Se(d,Z($p,{class:"w-3"}),null),p.addEventListener("change",c),Se(p,Z(se,{each:Rp,children:e=>(()=>{const n=Dp(),o=n.firstChild;return Se(n,(()=>e.name),o),Se(n,(()=>e.dial_code?`(${e.dial_code})`:""),null),T((()=>n.selected=e.code===t())),T((()=>n.value=e.code)),n})()})),Se(r,Z(sn,{type:"tel",ref(e){"function"==typeof i?i(e):i=e},get value(){return o()},onInput:a,get placeholder(){return e.labels?.placeholder??Np.placeholder},get autofocus(){return!Kt()}}),null),Se(n,Z(nn,{type:"button",class:"h-[56px]","on:click":s,get children(){return e.labels?.button}}),null),n})()};we(["keydown"]);const Up={button:fd,from:"From:",to:"To:"},Bp=ve('<div class="typebot-input-form flex gap-2 items-end"><form><div class="flex flex-col"><div><input class="focus:outline-none flex-1 w-full text-input typebot-date-input" data-testid="from-date">'),Fp=ve('<p class="font-semibold">'),jp=ve('<div class="flex items-center p-4"><input class="focus:outline-none flex-1 w-full text-input ml-2 typebot-date-input" data-testid="to-date">'),zp=e=>{const[t,n]=_(Hp(e.defaultValue??"")),o=()=>{""===t().from&&""===t().to||e.onSubmit({type:"text",value:`${t().from}${e.options?.isRange?` to ${t().to}`:""}`})};return(()=>{const r=Bp(),i=r.firstChild,a=i.firstChild,s=a.firstChild,l=s.firstChild;return i.addEventListener("submit",(e=>{e.preventDefault(),o()})),Se(s,(()=>{const t=E((()=>!!e.options?.isRange));return()=>t()&&(()=>{const t=Fp();return Se(t,(()=>e.options.labels?.from??Up.from)),t})()})(),l),l.addEventListener("change",(e=>n({...t(),from:e.currentTarget.value}))),l.style.setProperty("min-height","32px"),l.style.setProperty("min-width","100px"),l.style.setProperty("font-size","16px"),Se(a,(()=>{const o=E((()=>!!e.options?.isRange));return()=>o()&&(()=>{const o=jp(),r=o.firstChild;return Se(o,(()=>{const t=E((()=>!!e.options.isRange));return()=>t()&&(()=>{const t=Fp();return Se(t,(()=>e.options.labels?.to??Up.to)),t})()})(),r),r.addEventListener("change",(e=>n({...t(),to:e.currentTarget.value}))),r.style.setProperty("min-height","32px"),r.style.setProperty("min-width","100px"),r.style.setProperty("font-size","16px"),T((t=>{const n=e.options.hasTime?"datetime-local":"date",o=e.options?.min,i=e.options?.max;return n!==t._v$6&&xe(r,"type",t._v$6=n),o!==t._v$7&&xe(r,"min",t._v$7=o),i!==t._v$8&&xe(r,"max",t._v$8=i),t}),{_v$6:void 0,_v$7:void 0,_v$8:void 0}),T((()=>r.value=t().to)),o})()})(),null),Se(r,Z(nn,{class:"h-[56px]","on:click":o,get children(){return e.options?.labels?.button}}),null),T((t=>{const n=Ze("flex typebot-input",e.options?.isRange?"items-end":"items-center"),o="flex items-center p-4 "+(e.options?.isRange?"pb-0 gap-2":""),r=e.options?.hasTime?"datetime-local":"date",a=e.options?.min,c=e.options?.max;return n!==t._v$&&ke(i,t._v$=n),o!==t._v$2&&ke(s,t._v$2=o),r!==t._v$3&&xe(l,"type",t._v$3=r),a!==t._v$4&&xe(l,"min",t._v$4=a),c!==t._v$5&&xe(l,"max",t._v$5=c),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0}),T((()=>l.value=t().from)),r})()},Hp=e=>{if(!e.includes("to"))return{from:e,to:""};const[t,n]=e.split(" to ");return{from:t,to:n}},Vp="Numbers",Gp=10,Wp={button:fd},qp=0,Kp=ve('<form class="flex flex-col gap-2"><div class="flex flex-wrap justify-center gap-2"></div><div class="flex justify-end">'),Yp=ve('<span class="text-sm w-full rating-label">'),Xp=ve('<span class="text-sm w-full text-right pr-2 rating-label">'),Zp=ve('<div role="checkbox">'),Jp=ve("<div>"),Qp=e=>{const[t,n]=_(e.defaultValue?Number(e.defaultValue):void 0),o=n=>{n.preventDefault();const o=t();Ve(o)||e.onSubmit({type:"text",value:o.toString()})},r=t=>{e.block.options?.isOneClickSubmitEnabled&&e.onSubmit({type:"text",value:t.toString()}),n(t)};return(()=>{const n=Kp(),i=n.firstChild,a=i.nextSibling;return n.addEventListener("submit",o),Se(n,(()=>{const t=E((()=>!!e.block.options?.labels?.left));return()=>t()&&(()=>{const t=Yp();return Se(t,(()=>e.block.options.labels.left)),t})()})(),i),Se(i,Z(se,{get each(){return Array.from(Array((e.block.options?.length??Gp)+("Numbers"===(e.block.options?.buttonType??Vp)?-((e.block.options?.startsAt??qp)-1):0)))},children:(n,o)=>Z(eg,ne((()=>e.block.options),{get rating(){return t()},get idx(){return o()+("Numbers"===(e.block.options?.buttonType??Vp)?e.block.options?.startsAt??qp:1)},onClick:r}))})),Se(n,(()=>{const t=E((()=>!!e.block.options?.labels?.right));return()=>t()&&(()=>{const t=Xp();return Se(t,(()=>e.block.options.labels.right)),t})()})(),a),Se(a,(()=>{const n=E((()=>!!He(t())));return()=>n()&&Z(nn,{disableIcon:!0,get children(){return e.block.options?.labels?.button??Wp.button}})})()),n})()},eg=e=>{const t=t=>{t.preventDefault(),e.onClick(e.idx)};return Z(ce,{get children(){return[Z(de,{get when(){return"Numbers"===(e.buttonType??Vp)},get children(){return[Z(le,{get when(){return e.isOneClickSubmitEnabled},get children(){return Z(tn,{"on:click":t,get children(){return e.idx}})}}),Z(le,{get when(){return!e.isOneClickSubmitEnabled},get children(){const n=Zp();return n.addEventListener("click",t),Se(n,(()=>e.idx)),T((t=>{const o=He(e.rating)&&e.idx<=e.rating,r="py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none typebot-selectable"+(He(e.rating)&&e.idx<=e.rating?" selected":"");return o!==t._v$&&xe(n,"aria-checked",t._v$=o),r!==t._v$2&&ke(n,t._v$2=r),t}),{_v$:void 0,_v$2:void 0}),n}})]}}),Z(de,{get when(){return"Numbers"!==(e.buttonType??Vp)},get children(){const t=Jp();return t.addEventListener("click",(()=>e.onClick(e.idx))),T((n=>{const o="flex justify-center items-center rating-icon-container cursor-pointer "+(He(e.rating)&&e.idx<=e.rating?"selected":""),r=e.customIcon?.isEnabled&&!Ge(e.customIcon.svg)?e.customIcon.svg:tg;return o!==n._v$3&&ke(t,n._v$3=o),r!==n._v$4&&(t.innerHTML=n._v$4=r),n}),{_v$3:void 0,_v$4:void 0}),t}})]}})},tg='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>',ng={isRequired:!0,isMultipleAllowed:!1,visibility:"Auto",labels:{placeholder:"<strong>\n Click to upload\n </strong> or drag and drop<br>\n (size limit: 10MB)",button:"Upload",clear:"Clear",skip:"Skip",success:{single:"File uploaded",multiple:"{total} files uploaded"}}},og=ve('<div class="w-full bg-gray-200 rounded-full h-2.5"><div class="upload-progress-bar h-2.5 rounded-full">'),rg=ve('<div class="p-4 flex gap-2 border-gray-200 border overflow-auto bg-white rounded-md w-full">'),ig=ve('<div class="flex flex-col justify-center items-center gap-4 max-w-[90%]"><p class="text-sm text-gray-500 text-center">'),ag=ve('<input id="dropzone-file" type="file" class="hidden">'),sg=ve('<div class="flex justify-end">'),lg=ve('<div class="flex justify-end"><div class="flex gap-2">'),cg=ve('<form class="flex flex-col w-full gap-2"><label for="dropzone-file">'),dg=ve('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-gray-500"><polyline points="16 16 12 12 8 16"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16">'),ug=e=>{const[t,n]=_([]),[o,r]=_(!1),[i,a]=_(0),[s,l]=_(!1),c=o=>{const r=Array.from(o).map((n=>Nd({existingFiles:t(),newFile:n,params:{sizeLimit:e.block.options&&"sizeLimit"in e.block.options?e.block.options.sizeLimit:void 0},onError:({description:e,title:t})=>Ld.create({title:t,description:e})}))).filter(He);if(0!==r.length)return e.block.options?.isMultipleAllowed?void n([...t(),...r]):u(r[0])},d=async e=>{e.preventDefault(),0!==t().length&&p(t())},u=async t=>{r(!0);const n=await Dd({apiHost:e.context.apiHost??xt({ignoreChatApiUrl:!0}),files:[{file:t,input:{sessionId:e.context.sessionId,fileName:t.name}}]});if(r(!1),n.length&&n[0])return e.onSubmit({type:"text",label:e.block.options?.labels?.success?.single??ng.labels.success.single,value:n[0]?gg(n[0].url):"",attachments:[{type:t.type,url:n[0].url}]});Ld.create({description:"An error occured while uploading the file"})},p=async t=>{r(!0);const n=await Dd({apiHost:e.context.apiHost??xt({ignoreChatApiUrl:!0}),files:t.map((t=>({file:t,input:{sessionId:e.context.sessionId,fileName:t.name}}))),onUploadProgress:a});if(r(!1),a(0),n.length!==t.length)return Ld.create({description:"An error occured while uploading the files"});e.onSubmit({type:"text",label:n.length>1?(e.block.options?.labels?.success?.multiple??ng.labels.success.multiple).replaceAll("{total}",n.length.toString()):e.block.options?.labels?.success?.single??ng.labels.success.single,value:n.filter(He).map((({url:e})=>gg(e))).join(", "),attachments:n.filter(He)})},g=e=>{e.preventDefault(),l(!0)},h=()=>l(!1),f=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer?.files&&c(e.dataTransfer.files)},m=()=>n([]),b=()=>e.onSkip(e.block.options?.labels?.skip??ng.labels.skip);return(()=>{const r=cg(),a=r.firstChild;return r.addEventListener("submit",d),a.addEventListener("drop",f),a.addEventListener("dragleave",h),a.addEventListener("dragover",g),Se(a,Z(ce,{get children(){return[Z(de,{get when(){return o()},get children(){return Z(le,{get when(){return t().length>1},get fallback(){return Z(Qt,{})},get children(){const e=og(),t=e.firstChild;return t.style.setProperty("transition","width 150ms cubic-bezier(0.4, 0, 0.2, 1)"),T((()=>null!=`${i()>0?i:10}%`?t.style.setProperty("width",`${i()>0?i:10}%`):t.style.removeProperty("width"))),e}})}}),Z(de,{get when(){return!o()},get children(){return[(()=>{const o=ig(),r=o.firstChild;return Se(o,Z(le,{get when(){return t().length},get fallback(){return Z(pg,{})},get children(){const e=rg();return e.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation()})),Se(e,Z(se,{get each(){return t()},children:(e,t)=>Z($d,{file:e,onRemoveClick:()=>(e=>{n((t=>t.filter(((t,n)=>n!==e))))})(t())})})),e}}),r),T((()=>r.innerHTML=e.block.options?.labels?.placeholder??ng.labels.placeholder)),o})(),(()=>{const t=ag();return t.addEventListener("change",(e=>{e.currentTarget.files&&c(e.currentTarget.files)})),T((()=>t.multiple=e.block.options?.isMultipleAllowed??ng.isMultipleAllowed)),t})()]}})]}})),Se(r,Z(le,{get when(){return 0===t().length&&!1===e.block.options?.isRequired},get children(){const t=sg();return Se(t,Z(tn,{"on:click":b,get children(){return e.block.options?.labels?.skip??ng.labels.skip}})),t}}),null),Se(r,Z(le,{get when(){return E((()=>!!(e.block.options?.isMultipleAllowed&&t().length>0)))()&&!o()},get children(){const n=lg(),o=n.firstChild;return Se(o,Z(le,{get when(){return t().length},get children(){return Z(tn,{variant:"secondary","on:click":m,get children(){return e.block.options?.labels?.clear??ng.labels.clear}})}}),null),Se(o,Z(nn,{type:"submit",disableIcon:!0,get children(){return E((()=>(e.block.options?.labels?.button??ng.labels.button)===ng.labels.button))()?`Upload ${t().length} file${t().length>1?"s":""}`:e.block.options?.labels?.button}}),null),n}}),null),T((()=>ke(a,"typebot-upload-input py-6 flex flex-col justify-center items-center w-full bg-gray-50 border-2 border-gray-300 border-dashed cursor-pointer hover:bg-gray-100 px-8 "+(s()?"dragging-over":"")))),r})()},pg=()=>dg(),gg=e=>{const t=e.split("/").pop();if(!t)return e;const n=encodeURIComponent(t);return e.replace(t,n)};(function(e){return e.STRIPE="Stripe",e})({}).STRIPE;const hg={button:"Pay",success:"Success"},fg=ve('<div class="typebot-input-error-message mt-4 text-center animate-fade-in">'),mg=ve('<form id="payment-form" class="flex flex-col p-4 typebot-input w-full items-center"><slot name="stripe-payment-form">');let bg,yg=null,vg=null;const wg=e=>{const[t,n]=_(),[o,r]=_(!1),[i,a]=_(!1);P((async()=>{if(xg(bg),!e.options?.publicKey)return n("Missing Stripe public key");var t;if(yg=await(t=e.options?.publicKey,new Promise((e=>{if(window.Stripe)return e(window.Stripe(t));const n=document.createElement("script");n.src="https://js.stripe.com/v3",document.body.appendChild(n),n.onload=()=>{if(!window.Stripe)throw new Error("Stripe.js failed to load.");e(window.Stripe(t))}}))),!yg)return;vg=yg.elements({appearance:{theme:"stripe",variables:{colorPrimary:getComputedStyle(bg).getPropertyValue("--typebot-button-bg-color")}},clientSecret:e.options.paymentIntentSecret});vg.create("payment",{layout:"tabs"}).mount("#payment-element"),setTimeout((()=>{r(!0),e.onTransitionEnd()}),1e3)}));const s=async t=>{if(t.preventDefault(),!yg||!vg)return;var o;a(!0),o={sessionId:e.context.sessionId,resultId:e.context.resultId,typebot:e.context.typebot},sessionStorage.setItem("typebotPaymentInProgress",JSON.stringify(o));const{postalCode:r,...i}=e.options?.additionalInformation?.address??{},{error:s,paymentIntent:l}=await yg.confirmPayment({elements:vg,confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:e.options?.additionalInformation?.name,email:e.options?.additionalInformation?.email,phone:e.options?.additionalInformation?.phoneNumber,address:{...i,postal_code:r}}}},redirect:"if_required"});return _t(),a(!1),"validation_error"!==s?.type?"card_error"===s?.type?n(s.message):s||"succeeded"!==l.status?void 0:e.onSuccess():void 0};return(()=>{const n=mg(),r=n.firstChild;n.addEventListener("submit",s);return"function"==typeof bg?Te(bg,r):bg=r,r._$owner=A(),Se(n,Z(le,{get when(){return o()},get children(){return Z(nn,{get isLoading(){return i()},class:"mt-4 w-full max-w-lg animate-fade-in",disableIcon:!0,get children(){return[E((()=>e.options?.labels?.button??hg.button))," ",E((()=>e.options?.amountLabel))]}})}}),null),Se(n,Z(le,{get when(){return t()},get children(){const e=fg();return Se(e,t),e}}),null),n})()},xg=e=>{const t=e.getRootNode().host,n=document.createElement("div");n.style.width="100%",n.slot="stripe-payment-form",t.appendChild(n);const o=document.createElement("div");o.id="payment-element",n.appendChild(o)},kg=e=>Z(wg,{get onSuccess(){return e.onSuccess},get options(){return e.options},get context(){return e.context},get onTransitionEnd(){return e.onTransitionEnd}}),_g=ve('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3px" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12">'),Tg=e=>(()=>{const t=_g();return _e(t,e,!0,!0),t})(),Sg=ve("<div>"),Eg=e=>(()=>{const t=Sg();return Se(t,Z(le,{get when(){return e.isChecked},get children(){return Z(Tg,{})}})),T((()=>ke(t,"w-4 h-4 typebot-checkbox"+(e.isChecked?" checked":"")+(e.class?` ${e.class}`:"")))),t})(),Cg=ve('<button class="w-5 h-5">'),Pg=ve('<div class="flex justify-between items-center gap-2 w-full pr-4"><input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input" type="text">'),Ig=e=>{const[t,n]=_(""),[o,r]=oe(e,["onInput","ref"]),i=()=>{n(""),e.onClear()};return(()=>{const a=Pg(),s=a.firstChild;s.$$input=e=>(e=>{n(e),o.onInput(e)})(e.currentTarget.value);const l=e.ref;return"function"==typeof l?Te(l,s):e.ref=s,s.style.setProperty("font-size","16px"),_e(s,ne({get value(){return t()}},r),!1,!1),Se(a,Z(le,{get when(){return t().length>0},get children(){const e=Cg();return e.addEventListener("click",i),Se(e,Z(Zc,{})),e}}),null),a})()};we(["input"]);const Og=fd,Ag="Filter the options...",$g=ve('<div class="flex items-end typebot-input w-full">'),Rg=ve('<form class="flex flex-col items-end gap-2 w-full"><div>'),Ng=ve('<span><div role="checkbox"><div class="flex items-center gap-2"><span>'),Lg=ve('<span><div role="checkbox" aria-checked class="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none typebot-selectable selected"><div class="flex items-center gap-2"><span>'),Dg=e=>{let t;const[n,o]=_(e.defaultItems),[r,i]=_([]);P((()=>{!Kt()&&t&&t.focus({preventScroll:!0})}));const a=e=>{s(e)},s=e=>{const t=r().indexOf(e);i(-1!==t?t=>t.filter((t=>t!==e)):t=>[...t,e])},l=()=>e.onSubmit({type:"text",value:r().map((t=>e.defaultItems.find((e=>e.id===t))?.content)).join(", ")}),c=t=>{o(e.defaultItems.filter((e=>e.content?.toLowerCase().includes((t??"").toLowerCase()))))};return(()=>{const i=Rg(),s=i.firstChild;return i.addEventListener("submit",l),Se(i,Z(le,{get when(){return e.options?.isSearchable},get children(){const n=$g();return Se(n,Z(Ig,{ref(e){"function"==typeof t?t(e):t=e},onInput:c,get placeholder(){return e.options?.searchInputPlaceholder??Ag},onClear:()=>o(e.defaultItems)})),n}}),s),Se(s,Z(se,{get each(){return n()},children:e=>(()=>{const t=Ng(),n=t.firstChild,o=n.firstChild,i=o.firstChild;return n.addEventListener("click",(()=>a(e.id))),Se(o,Z(Eg,{get isChecked(){return r().some((t=>t===e.id))},class:"flex-shrink-0"}),i),Se(i,(()=>e.content)),T((o=>{const i="relative"+(Kt()?" w-full":""),a=r().some((t=>t===e.id)),s="w-full py-2 px-4 font-semibold focus:outline-none cursor-pointer select-none typebot-selectable"+(r().some((t=>t===e.id))?" selected":""),l=e.id;return i!==o._v$&&ke(t,o._v$=i),a!==o._v$2&&xe(n,"aria-checked",o._v$2=a),s!==o._v$3&&ke(n,o._v$3=s),l!==o._v$4&&xe(n,"data-itemid",o._v$4=l),o}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t})()}),null),Se(s,Z(se,{get each(){return r().filter((e=>n().every((t=>t.id!==e))))},children:t=>(()=>{const n=Lg(),o=n.firstChild,r=o.firstChild,i=r.firstChild;return o.addEventListener("click",(()=>a(t))),xe(o,"data-itemid",t),Se(r,Z(Eg,{isChecked:!0}),i),Se(i,(()=>e.defaultItems.find((e=>e.id===t))?.content)),T((()=>ke(n,"relative"+(Kt()?" w-full":"")))),n})()}),null),Se(i,(()=>{const t=E((()=>r().length>0));return()=>t()&&Z(nn,{disableIcon:!0,get children(){return e.options?.buttonLabel??Og}})})(),null),T((()=>ke(s,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-80 rounded-md":"")))),i})()},Mg=ve('<div class="flex items-end typebot-input w-full">'),Ug=ve('<div class="flex flex-col gap-2 w-full"><div>'),Bg=ve("<span>"),Fg=ve('<span class="flex h-3 w-3 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-3 w-3 brightness-150">'),jg=e=>{let t;const[n,o]=_(e.defaultItems);P((()=>{!Kt()&&t&&t.focus({preventScroll:!0})}));const r=t=>{o(e.defaultItems.filter((e=>e.content?.toLowerCase().includes((t??"").toLowerCase()))))};return(()=>{const i=Ug(),a=i.firstChild;return Se(i,Z(le,{get when(){return e.options?.isSearchable},get children(){const n=Mg();return Se(n,Z(Ig,{ref(e){"function"==typeof t?t(e):t=e},onInput:r,get placeholder(){return e.options?.searchInputPlaceholder??Ag},onClear:()=>o(e.defaultItems)})),n}}),a),Se(a,Z(se,{get each(){return n()},children:(t,o)=>(()=>{const r=Bg();return Se(r,Z(tn,{"on:click":()=>{return t=o(),e.onSubmit({type:"text",value:n()[t].content??""});var t},get"data-itemid"(){return t.id},class:"w-full",get children(){return t.content}}),null),Se(r,(()=>{const t=E((()=>!(0!==e.chunkIndex||1!==e.defaultItems.length)));return()=>t()&&Fg()})(),null),T((()=>ke(r,"relative"+(Kt()?" w-full":"")))),r})()})),T((()=>ke(a,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-80 rounded-md":"")))),i})()},zg=ve('<div class="flex items-end typebot-input w-full">'),Hg=ve('<div class="flex flex-col gap-2 w-full"><div>'),Vg=ve('<button><img fetchpriority="high" class="m-auto"><div><span class="font-semibold"></span><span class="text-sm whitespace-pre-wrap text-left">'),Gg=e=>{let t;const[n,o]=_(e.defaultItems),[r,i]=_(0);P((()=>{!Kt()&&t&&t.focus({preventScroll:!0})}));const a=t=>{o(e.defaultItems.filter((e=>e.title?.toLowerCase().includes((t??"").toLowerCase())||e.description?.toLowerCase().includes((t??"").toLowerCase()))))};S((()=>{r()===e.defaultItems.filter((e=>He(e.pictureSrc))).length&&e.onTransitionEnd()}));const s=()=>{i((e=>e+1))};return(()=>{const r=Hg(),i=r.firstChild;return Se(r,Z(le,{get when(){return e.options?.isSearchable},get children(){const n=zg();return Se(n,Z(Ig,{ref(e){"function"==typeof t?t(e):t=e},onInput:a,get placeholder(){return e.options?.searchInputPlaceholder??""},onClear:()=>o(e.defaultItems)})),n}}),i),Se(i,Z(se,{get each(){return n()},children:(t,o)=>(()=>{const r=Vg(),i=r.firstChild,a=i.nextSibling,l=a.firstChild,c=l.nextSibling;return r.addEventListener("click",(()=>(t=>{const o=n()[t];return e.onSubmit({type:"text",label:We(o.title)?o.title:o.pictureSrc??o.id,value:o.id})})(o()))),i.addEventListener("load",s),Se(l,(()=>t.title)),Se(c,(()=>t.description)),T((e=>{const n=t.id,s="flex flex-col typebot-picture-button focus:outline-none filter hover:brightness-90 active:brightness-75 justify-between "+(qe(t.pictureSrc)?"has-svg":""),l=t.pictureSrc,c=t.title??`Picture ${o()+1}`,d=`Picture choice ${o()+1}`,u="flex flex-col gap-1 py-2 flex-shrink-0 px-4 w-full"+(t.description?" items-start":"");return n!==e._v$&&xe(r,"data-itemid",e._v$=n),s!==e._v$2&&ke(r,e._v$2=s),l!==e._v$3&&xe(i,"src",e._v$3=l),c!==e._v$4&&xe(i,"alt",e._v$4=c),d!==e._v$5&&xe(i,"elementtiming",e._v$5=d),u!==e._v$6&&ke(a,e._v$6=u),e}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0}),r})()})),T((()=>ke(i,"gap-2 flex flex-wrap justify-end"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":"")))),r})()},Wg=fd,qg="Filter the options...",Kg=ve('<div class="flex items-end typebot-input w-full">'),Yg=ve('<form class="flex flex-col gap-2 w-full items-end"><div>'),Xg=ve('<span class="font-semibold">'),Zg=ve('<span class="text-sm whitespace-pre-wrap text-left">'),Jg=ve('<div class="flex flex-col gap-1 ">'),Qg=ve('<div role="checkbox"><img fetchpriority="high" class="m-auto"><div>'),eh=ve('<div role="checkbox" aria-checked class="flex flex-col focus:outline-none cursor-pointer select-none typebot-selectable-picture selected"><img fetchpriority="high"><div>'),th=e=>{let t;const[n,o]=_(e.defaultItems),[r,i]=_([]),[a,s]=_(0);P((()=>{!Kt()&&t&&t.focus({preventScroll:!0})}));const l=e=>{c(e)},c=e=>{const t=r().indexOf(e);i(-1!==t?t=>t.filter((t=>t!==e)):t=>[...t,e])},d=()=>e.onSubmit({type:"text",value:r().map((t=>{const n=e.defaultItems.find((e=>e.id===t));return We(n?.title)?n.title:n?.pictureSrc})).join(", ")}),u=t=>{o(e.defaultItems.filter((e=>e.title?.toLowerCase().includes((t??"").toLowerCase())||e.description?.toLowerCase().includes((t??"").toLowerCase()))))};S((()=>{a()===e.defaultItems.filter((e=>He(e.pictureSrc))).length&&e.onTransitionEnd()}));const p=()=>{s((e=>e+1))};return(()=>{const i=Yg(),a=i.firstChild;return i.addEventListener("submit",d),Se(i,Z(le,{get when(){return e.options?.isSearchable},get children(){const n=Kg();return Se(n,Z(Ig,{ref(e){"function"==typeof t?t(e):t=e},onInput:u,get placeholder(){return e.options?.searchInputPlaceholder??qg},onClear:()=>o(e.defaultItems)})),n}}),a),Se(a,Z(se,{get each(){return n()},children:(e,t)=>(()=>{const n=Qg(),o=n.firstChild,i=o.nextSibling;return n.addEventListener("click",(()=>l(e.id))),o.addEventListener("load",p),Se(i,Z(Eg,{get isChecked(){return r().some((t=>t===e.id))},get class(){return"flex-shrink-0"+(e.title||e.description?" mt-1":void 0)}}),null),Se(i,Z(le,{get when(){return e.title||e.description},get children(){const t=Jg();return Se(t,Z(le,{get when(){return e.title},get children(){const t=Xg();return Se(t,(()=>e.title)),t}}),null),Se(t,Z(le,{get when(){return e.description},get children(){const t=Zg();return Se(t,(()=>e.description)),t}}),null),t}}),null),T((a=>{const s=r().some((t=>t===e.id)),l="flex flex-col focus:outline-none cursor-pointer select-none typebot-selectable-picture"+(r().some((t=>t===e.id))?" selected":"")+(qe(e.pictureSrc)?" has-svg":""),c=e.id,d=e.pictureSrc,u=e.title??`Picture ${t()+1}`,p=`Picture choice ${t()+1}`,g="flex gap-3 py-2 flex-shrink-0"+(Ge(e.title)&&Ge(e.description)?" justify-center":" px-3");return s!==a._v$&&xe(n,"aria-checked",a._v$=s),l!==a._v$2&&ke(n,a._v$2=l),c!==a._v$3&&xe(n,"data-itemid",a._v$3=c),d!==a._v$4&&xe(o,"src",a._v$4=d),u!==a._v$5&&xe(o,"alt",a._v$5=u),p!==a._v$6&&xe(o,"elementtiming",a._v$6=p),g!==a._v$7&&ke(i,a._v$7=g),a}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0}),n})()}),null),Se(a,Z(se,{get each(){return r().filter((e=>n().every((t=>t.id!==e)))).map((t=>e.defaultItems.find((e=>e.id===t)))).filter(He)},children:(t,n)=>(()=>{const o=eh(),i=o.firstChild,a=i.nextSibling;return o.addEventListener("click",(()=>l(t.id))),Se(a,Z(Eg,{get isChecked(){return r().some((e=>e===t.id))},get class(){return"flex-shrink-0"+(t.title||t.description?" mt-1":void 0)}}),null),Se(a,Z(le,{get when(){return t.title||t.description},get children(){const e=Jg();return Se(e,Z(le,{get when(){return t.title},get children(){const e=Xg();return Se(e,(()=>t.title)),e}}),null),Se(e,Z(le,{get when(){return t.description},get children(){const e=Zg();return Se(e,(()=>t.description)),e}}),null),e}}),null),T((r=>{const s=t.id,l=e.defaultItems.find((e=>e.id===t.id))?.pictureSrc,c=t.title??`Selected picture ${n()+1}`,d=`Selected picture choice ${n()+1}`,u="flex gap-3 py-2 flex-shrink-0"+(Ge(t.title)&&Ge(t.description)?" justify-center":" pl-4");return s!==r._v$8&&xe(o,"data-itemid",r._v$8=s),l!==r._v$9&&xe(i,"src",r._v$9=l),c!==r._v$10&&xe(i,"alt",r._v$10=c),d!==r._v$11&&xe(i,"elementtiming",r._v$11=d),u!==r._v$12&&ke(a,r._v$12=u),r}),{_v$8:void 0,_v$9:void 0,_v$10:void 0,_v$11:void 0,_v$12:void 0}),o})()}),null),Se(i,(()=>{const t=E((()=>r().length>0));return()=>t()&&Z(nn,{disableIcon:!0,get children(){return e.options?.buttonLabel??Wg}})})(),null),T((()=>ke(a,"flex flex-wrap justify-end gap-2"+(e.options?.isSearchable?" overflow-y-scroll max-h-[464px] rounded-md":"")))),i})()},[nh,oh]=_([]);function rh(e,t){const[n,o]=_(!1);if(!t.storage)return[...e,n,o];const r=ih(t.storage||qn.rememberUser.storage),i=JSON.stringify.bind(JSON),a=JSON.parse.bind(JSON),s=r.getItem(t.key),l="function"==typeof e[0]?t=>e[1]((()=>a(t))):t=>e[1](Or(a(t)));return s&&(l(s),o(!0),t.onRecovered?.()),[e[0],"function"==typeof e[0]?n=>{o(!1);const a=e[1](n);return n?r.setItem(t.key,i(a)):r.removeItem(t.key),a}:(...n)=>{o(!1),e[1](...n);const a=i(C((()=>e[0])));r.setItem(t.key,a)},n,o]}const ih=e=>"session"===(e??qn.rememberUser.storage)?sessionStorage:localStorage,ah=ve("<div>"),sh=ve('<div class="flex justify-end animate-fade-in gap-2 typebot-input-container">'),lh=e=>{const[t,n]=rh(_(),{key:`typebot-${e.context.typebot.id}-input-${e.chunkIndex}`,storage:e.context.storage}),o=async t=>{n(t),e.onSubmit(t)},r=t=>{n({type:"text",value:t}),e.onSkip()};return S((()=>{const t=nh().findLast((t=>e.chunkIndex===t.inputIndex))?.formattedMessage;t&&e.block.type!==md.FILE&&n((e=>"text"===e?.type?{...e,label:t}:e))})),Z(ce,{get children(){return[Z(de,{get when(){return t()&&!e.hasError},get children(){return Z(pd,{get answer(){return t()},get showAvatar(){return e.guestAvatar?.isEnabled??Jd},get avatarSrc(){return e.guestAvatar?.url&&e.guestAvatar.url},get hasHostAvatar(){return e.hasHostAvatar}})}}),Z(de,{get when(){return Ve(t())||e.hasError},get children(){const n=sh(),i=e.ref;return"function"==typeof i?Te(i,n):e.ref=n,Se(n,Z(le,{get when(){return e.hasHostAvatar},get children(){const e=ah();return T((()=>ke(e,"flex flex-shrink-0 items-center "+(Kt()?"w-6 h-6":"w-10 h-10")))),e}}),null),Se(n,Z(dh,{get context(){return e.context},get block(){return e.block},get chunkIndex(){return e.chunkIndex},get isInputPrefillEnabled(){return e.isInputPrefillEnabled},get existingAnswer(){return E((()=>!!e.hasError))()?ch(t()):void 0},get onTransitionEnd(){return e.onTransitionEnd},onSubmit:o,onSkip:r}),null),T((()=>xe(n,"data-blockid",e.block.id))),n}})]}})},ch=e=>{if(e)return"text"===e.type?e.value:e.url},dh=e=>{const t=t=>e.onSubmit(t),n=()=>e.existingAnswer??(e.isInputPrefillEnabled?e.block.prefilledValue:void 0),o=()=>e.onSubmit({type:"text",value:e.block.options?.labels?.success??hg.success});return Z(ce,{get children(){return[Z(de,{get when(){return e.block.type===md.TEXT},get children(){return Z(xp,{get block(){return e.block},get defaultValue(){return n()},get context(){return e.context},onSubmit:t})}}),Z(de,{get when(){return e.block.type===md.NUMBER},get children(){return Z(Tp,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),Z(de,{get when(){return e.block.type===md.EMAIL},get children(){return Z(Cp,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),Z(de,{get when(){return e.block.type===md.URL},get children(){return Z(Op,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),Z(de,{get when(){return e.block.type===md.PHONE},get children(){return Z(Mp,{get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return n()},onSubmit:t})}}),Z(de,{get when(){return e.block.type===md.DATE},get children(){return Z(zp,{get options(){return e.block.options},get defaultValue(){return n()},onSubmit:t})}}),Z(de,{get when(){return uh(e.block)},keyed:!0,children:n=>Z(ce,{get children(){return[Z(de,{get when(){return!n.options?.isMultipleChoice},get children(){return Z(jg,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return n.items},get options(){return n.options},onSubmit:t})}}),Z(de,{get when(){return n.options?.isMultipleChoice},get children(){return Z(Dg,{get defaultItems(){return n.items},get options(){return n.options},onSubmit:t})}})]}})}),Z(de,{get when(){return ph(e.block)},keyed:!0,children:n=>Z(ce,{get children(){return[Z(de,{get when(){return!n.options?.isMultipleChoice},get children(){return Z(Gg,{get defaultItems(){return n.items},get options(){return n.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}}),Z(de,{get when(){return n.options?.isMultipleChoice},get children(){return Z(th,{get defaultItems(){return n.items},get options(){return n.options},onSubmit:t,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})}),Z(de,{get when(){return e.block.type===md.RATING},get children(){return Z(Qp,{get block(){return e.block},get defaultValue(){return n()},onSubmit:t})}}),Z(de,{get when(){return e.block.type===md.FILE},get children(){return Z(ug,{get context(){return e.context},get block(){return e.block},onSubmit:t,get onSkip(){return e.onSkip}})}}),Z(de,{get when(){return e.block.type===md.PAYMENT},get children(){return Z(kg,{get context(){return e.context},get options(){return{...e.block.options,...e.block.runtimeOptions}},onSuccess:o,get onTransitionEnd(){return e.onTransitionEnd}})}})]}})},uh=e=>e?.type===md.CHOICE?e:void 0,ph=e=>e?.type===md.PICTURE_CHOICE?e:void 0,gh=ve("<div><div>"),hh=e=>{let t;const[n,o]=_(0),r=new ResizeObserver((e=>o(e[0].target.clientHeight-(Kt()?24:40))));return P((()=>{t&&r.observe(t)})),I((()=>{t&&r.unobserve(t)})),(()=>{const o=gh(),r=o.firstChild;return"function"==typeof t?Te(t,o):t=o,Se(r,Z(mo,{get initialAvatarSrc(){return e.hostAvatarSrc}})),T((t=>{const i="flex flex-shrink-0 items-center relative typebot-avatar-container "+(Kt()?"w-6":"w-10"),a="absolute flex items-center top-0"+(Kt()?" w-6 h-6":" w-10 h-10")+(e.hideAvatar?" opacity-0":" opacity-100"),s=`${n()}px`,l=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return i!==t._v$&&ke(o,t._v$=i),a!==t._v$2&&ke(r,t._v$2=a),s!==t._v$3&&(null!=(t._v$3=s)?r.style.setProperty("top",s):r.style.removeProperty("top")),l!==t._v$4&&(null!=(t._v$4=l)?r.style.setProperty("transition",l):r.style.removeProperty("transition")),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),o})()},[fh,mh]=_();function bh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let yh={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function vh(e){yh=e}const wh=/[&<>"']/,xh=new RegExp(wh.source,"g"),kh=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,_h=new RegExp(kh.source,"g"),Th={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Sh=e=>Th[e];function Eh(e,t){if(t){if(wh.test(e))return e.replace(xh,Sh)}else if(kh.test(e))return e.replace(_h,Sh);return e}const Ch=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Ph(e){return e.replace(Ch,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Ih=/(^|[^\[])\^/g;function Oh(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,o)=>(o=(o="object"==typeof o&&"source"in o?o.source:o).replace(Ih,"$1"),e=e.replace(t,o),n),getRegex:()=>new RegExp(e,t)};return n}function Ah(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const $h={exec:()=>null};function Rh(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let o=!1,r=t;for(;--r>=0&&"\\"===n[r];)o=!o;return o?"|":" |"})),o=n.split(/ \|/);let r=0;if(o[0].trim()||o.shift(),o.length>0&&!o[o.length-1].trim()&&o.pop(),t)if(o.length>t)o.splice(t);else for(;o.length<t;)o.push("");for(;r<o.length;r++)o[r]=o[r].trim().replace(/\\\|/g,"|");return o}function Nh(e,t,n){const o=e.length;if(0===o)return"";let r=0;for(;r<o;){const i=e.charAt(o-r-1);if(i!==t||n){if(i===t||!n)break;r++}else r++}return e.slice(0,o-r)}function Lh(e,t,n,o){const r=t.href,i=t.title?Eh(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){o.state.inLink=!0;const e={type:"link",raw:n,href:r,title:i,text:a,tokens:o.inlineTokens(a)};return o.state.inLink=!1,e}return{type:"image",raw:n,href:r,title:i,text:Eh(a)}}class Dh{options;rules;lexer;constructor(e){this.options=e||yh}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Nh(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const o=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=o.length?e.slice(o.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Nh(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),n=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:o,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const o=n.length>1,r={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:!1,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let a="",s="",l=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let o=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],d=0;this.options.pedantic?(d=2,s=o.trimStart()):(d=t[2].search(/[^ ]/),d=d>4?1:d,s=o.slice(d),d+=t[1].length);let u=!1;if(!o&&/^ *$/.test(c)&&(a+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,d-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(c=l,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=d||!c.trim())s+="\n"+c.slice(d);else{if(u)break;if(o.search(/[^ ]/)>=4)break;if(r.test(o))break;if(i.test(o))break;if(n.test(o))break;s+="\n"+c}u||c.trim()||(u=!0),a+=l+"\n",e=e.substring(l.length+1),o=c.slice(d)}}r.loose||(l?r.loose=!0:/\n *\n *$/.test(a)&&(l=!0));let p,g=null;this.options.gfm&&(g=/^\[[ xX]\] /.exec(s),g&&(p="[ ] "!==g[0],s=s.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:a,task:!!g,checked:p,loose:!1,text:s,tokens:[]}),r.raw+=a}r.items[r.items.length-1].raw=a.trimEnd(),r.items[r.items.length-1].text=s.trimEnd(),r.raw=r.raw.trimEnd();for(let e=0;e<r.items.length;e++)if(this.lexer.state.top=!1,r.items[e].tokens=this.lexer.blockTokens(r.items[e].text,[]),!r.loose){const t=r.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));r.loose=n}if(r.loose)for(let e=0;e<r.items.length;e++)r.items[e].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:o}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:Rh(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,n,o,r,i=e.align.length;for(t=0;t<i;t++){const n=e.align[t];n&&(/^ *-+: *$/.test(n)?e.align[t]="right":/^ *:-+: *$/.test(n)?e.align[t]="center":/^ *:-+ *$/.test(n)?e.align[t]="left":e.align[t]=null)}for(i=e.rows.length,t=0;t<i;t++)e.rows[t]=Rh(e.rows[t],e.header.length).map((e=>({text:e,tokens:[]})));for(i=e.header.length,n=0;n<i;n++)e.header[n].tokens=this.lexer.inline(e.header[n].text);for(i=e.rows.length,n=0;n<i;n++)for(r=e.rows[n],o=0;o<r.length;o++)r[o].tokens=this.lexer.inline(r[o].text);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Eh(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Nh(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let o=0;o<e.length;o++)if("\\"===e[o])o++;else if(e[o]===t[0])n++;else if(e[o]===t[1]&&(n--,n<0))return o;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],o="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],o=e[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),Lh(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:o?o.replace(this.rules.inline._escapes,"$1"):o},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Lh(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let o=this.rules.inline.emStrong.lDelim.exec(e);if(!o)return;if(o[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...o[0]].length-1;let r,i,a=n,s=0;const l="*"===o[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+o[0].length-1);null!=(o=l.exec(t));){if(r=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!r)continue;if(i=[...r].length,o[3]||o[4]){a+=i;continue}if((o[5]||o[6])&&n%3&&!((n+i)%3)){s+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+s);const t=[...e].slice(0,n+o.index+i+1).join("");if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const l=t.slice(2,-2);return{type:"strong",raw:t,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),o=/^ /.test(e)&&/ $/.test(e);return n&&o&&(e=e.substring(1,e.length-1)),e=Eh(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=Eh(t[1]),n="mailto:"+e):(e=Eh(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=Eh(t[0]),n="mailto:"+e;else{let o;do{o=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(o!==t[0]);e=Eh(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:Eh(t[0]),{type:"text",raw:t[0],text:e}}}}const Mh={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:$h,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Mh.def=Oh(Mh.def).replace("label",Mh._label).replace("title",Mh._title).getRegex(),Mh.bullet=/(?:[*+-]|\d{1,9}[.)])/,Mh.listItemStart=Oh(/^( *)(bull) */).replace("bull",Mh.bullet).getRegex(),Mh.list=Oh(Mh.list).replace(/bull/g,Mh.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Mh.def.source+")").getRegex(),Mh._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Mh._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Mh.html=Oh(Mh.html,"i").replace("comment",Mh._comment).replace("tag",Mh._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Mh.lheading=Oh(Mh.lheading).replace(/bull/g,Mh.bullet).getRegex(),Mh.paragraph=Oh(Mh._paragraph).replace("hr",Mh.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mh._tag).getRegex(),Mh.blockquote=Oh(Mh.blockquote).replace("paragraph",Mh.paragraph).getRegex(),Mh.normal={...Mh},Mh.gfm={...Mh.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Mh.gfm.table=Oh(Mh.gfm.table).replace("hr",Mh.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mh._tag).getRegex(),Mh.gfm.paragraph=Oh(Mh._paragraph).replace("hr",Mh.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Mh.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Mh._tag).getRegex(),Mh.pedantic={...Mh.normal,html:Oh("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Mh._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$h,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Oh(Mh.normal._paragraph).replace("hr",Mh.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Mh.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Uh={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:$h,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:$h,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/,_punctuation:"\\p{P}$+<=>`^|~"};Uh.punctuation=Oh(Uh.punctuation,"u").replace(/punctuation/g,Uh._punctuation).getRegex(),Uh.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Uh.anyPunctuation=/\\[punct]/g,Uh._escapes=/\\([punct])/g,Uh._comment=Oh(Mh._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Uh.emStrong.lDelim=Oh(Uh.emStrong.lDelim,"u").replace(/punct/g,Uh._punctuation).getRegex(),Uh.emStrong.rDelimAst=Oh(Uh.emStrong.rDelimAst,"gu").replace(/punct/g,Uh._punctuation).getRegex(),Uh.emStrong.rDelimUnd=Oh(Uh.emStrong.rDelimUnd,"gu").replace(/punct/g,Uh._punctuation).getRegex(),Uh.anyPunctuation=Oh(Uh.anyPunctuation,"gu").replace(/punct/g,Uh._punctuation).getRegex(),Uh._escapes=Oh(Uh._escapes,"gu").replace(/punct/g,Uh._punctuation).getRegex(),Uh._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Uh._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Uh.autolink=Oh(Uh.autolink).replace("scheme",Uh._scheme).replace("email",Uh._email).getRegex(),Uh._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Uh.tag=Oh(Uh.tag).replace("comment",Uh._comment).replace("attribute",Uh._attribute).getRegex(),Uh._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Uh._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Uh._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Uh.link=Oh(Uh.link).replace("label",Uh._label).replace("href",Uh._href).replace("title",Uh._title).getRegex(),Uh.reflink=Oh(Uh.reflink).replace("label",Uh._label).replace("ref",Mh._label).getRegex(),Uh.nolink=Oh(Uh.nolink).replace("ref",Mh._label).getRegex(),Uh.reflinkSearch=Oh(Uh.reflinkSearch,"g").replace("reflink",Uh.reflink).replace("nolink",Uh.nolink).getRegex(),Uh.normal={...Uh},Uh.pedantic={...Uh.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Oh(/^!?\[(label)\]\((.*?)\)/).replace("label",Uh._label).getRegex(),reflink:Oh(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Uh._label).getRegex()},Uh.gfm={...Uh.normal,escape:Oh(Uh.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Uh.gfm.url=Oh(Uh.gfm.url,"i").replace("email",Uh.gfm._extended_email).getRegex(),Uh.breaks={...Uh.gfm,br:Oh(Uh.br).replace("{2,}","*").getRegex(),text:Oh(Uh.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class Bh{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yh,this.options.tokenizer=this.options.tokenizer||new Dh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Mh.normal,inline:Uh.normal};this.options.pedantic?(t.block=Mh.pedantic,t.inline=Uh.pedantic):this.options.gfm&&(t.block=Mh.gfm,this.options.breaks?t.inline=Uh.breaks:t.inline=Uh.gfm),this.tokenizer.rules=t}static get rules(){return{block:Mh,inline:Uh}}static lex(e,t){return new Bh(t).lex(e)}static lexInline(e,t){return new Bh(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,o,r,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((o=>!!(n=o.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),o=t[t.length-1],!o||"paragraph"!==o.type&&"text"!==o.type?t.push(n):(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),o=t[t.length-1],!o||"paragraph"!==o.type&&"text"!==o.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(o.raw+="\n"+n.raw,o.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let o;this.options.extensions.startBlock.forEach((e=>{o=e.call({lexer:this},n),"number"==typeof o&&o>=0&&(t=Math.min(t,o))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r)))o=t[t.length-1],i&&"paragraph"===o.type?(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),o=t[t.length-1],o&&"text"===o.type?(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,o,r,i,a,s,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,i.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(a||(s=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((o=>!!(n=o.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),o=t[t.length-1],o&&"text"===n.type&&"text"===o.type?(o.raw+=n.raw,o.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),o=t[t.length-1],o&&"text"===n.type&&"text"===o.type?(o.raw+=n.raw,o.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,s))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let o;this.options.extensions.startInline.forEach((e=>{o=e.call({lexer:this},n),"number"==typeof o&&o>=0&&(t=Math.min(t,o))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(r))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(s=n.raw.slice(-1)),a=!0,o=t[t.length-1],o&&"text"===o.type?(o.raw+=n.raw,o.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class Fh{options;constructor(e){this.options=e||yh}code(e,t,n){const o=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",o?'<pre><code class="language-'+Eh(o)+'">'+(n?e:Eh(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:Eh(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+o+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const o=Ah(e);if(null===o)return n;let r='<a href="'+(e=o)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){const o=Ah(e);if(null===o)return n;let r=`<img src="${e=o}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=">",r}text(e){return e}}class jh{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class zh{options;renderer;textRenderer;constructor(e){this.options=e||yh,this.options.renderer=this.options.renderer||new Fh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new jh}static parse(e,t){return new zh(t).parse(e)}static parseInline(e,t){return new zh(t).parseInline(e)}parse(e,t=!0){let n="";for(let o=0;o<e.length;o++){const r=e[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const e=r,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(r.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=r;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,Ph(this.parseInline(e.tokens,this.textRenderer)));continue}case"code":{const e=r;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=r;let t="",o="";for(let t=0;t<e.header.length;t++)o+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(o);let i="";for(let t=0;t<e.rows.length;t++){const n=e.rows[t];o="";for(let t=0;t<n.length;t++)o+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});i+=this.renderer.tablerow(o)}n+=this.renderer.table(t,i);continue}case"blockquote":{const e=r,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=r,t=e.ordered,o=e.start,i=e.loose;let a="";for(let t=0;t<e.items.length;t++){const n=e.items[t],o=n.checked,r=n.task;let s="";if(n.task){const e=this.renderer.checkbox(!!o);i?n.tokens.length>0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):s+=e+" "}s+=this.parse(n.tokens,i),a+=this.renderer.listitem(s,r,!!o)}n+=this.renderer.list(a,t,o);continue}case"html":{const e=r;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=r;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=r,a=i.tokens?this.parseInline(i.tokens):i.text;for(;o+1<e.length&&"text"===e[o+1].type;)i=e[++o],a+="\n"+(i.tokens?this.parseInline(i.tokens):i.text);n+=t?this.renderer.paragraph(a):a;continue}default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let o=0;o<e.length;o++){const r=e[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const e=this.options.extensions.renderers[r.type].call({parser:this},r);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=e||"";continue}}switch(r.type){case"escape":{const e=r;n+=t.text(e.text);break}case"html":{const e=r;n+=t.html(e.text);break}case"link":{const e=r;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=r;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=r;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=r;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=r;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=r;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=r;n+=t.text(e.text);break}default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class Hh{options;constructor(e){this.options=e||yh}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(e){return e}postprocess(e){return e}}const Vh=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#e(Bh.lex,zh.parse);parseInline=this.#e(Bh.lexInline,zh.parseInline);Parser=zh;parser=zh.parse;Renderer=Fh;TextRenderer=jh;Lexer=Bh;lexer=Bh.lex;Tokenizer=Dh;Hooks=Hh;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const e=o;for(const o of e.header)n=n.concat(this.walkTokens(o.tokens,t));for(const o of e.rows)for(const e of o)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=o;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=o;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((o=>{n=n.concat(this.walkTokens(e[o],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let o=e.renderer.apply(this,t);return!1===o&&(o=n.apply(this,t)),o}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new Fh(this.defaults);for(const n in e.renderer){const o=e.renderer[n],r=n,i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new Dh(this.defaults);for(const n in e.tokenizer){const o=e.tokenizer[n],r=n,i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Hh;for(const n in e.hooks){const o=e.hooks[n],r=n,i=t[r];Hh.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then((e=>i.call(t,e)));const n=o.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,o=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(o.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}#e(e,t){return(n,o)=>{const r={...o},i={...this.defaults,...r};!0===this.defaults.async&&!1===r.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const a=this.#t(!!i.silent,!!i.async);if(null==n)return a(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));const o=e(n,i);i.walkTokens&&this.walkTokens(o,i.walkTokens);let r=t(o,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+Eh(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Gh(e,t){return Vh.parse(e,t)}Gh.options=Gh.setOptions=function(e){return Vh.setOptions(e),Gh.defaults=Vh.defaults,vh(Gh.defaults),Gh},Gh.getDefaults=bh,Gh.defaults=yh,Gh.use=function(...e){return Vh.use(...e),Gh.defaults=Vh.defaults,vh(Gh.defaults),Gh},Gh.walkTokens=function(e,t){return Vh.walkTokens(e,t)},Gh.parseInline=Vh.parseInline,Gh.Parser=zh,Gh.parser=zh.parse,Gh.Renderer=Fh,Gh.TextRenderer=jh,Gh.Lexer=Bh,Gh.lexer=Bh.lex,Gh.Tokenizer=Dh,Gh.Hooks=Hh,Gh.parse=Gh,Gh.options,Gh.setOptions,Gh.use,Gh.walkTokens,Gh.parseInline;
13
- /*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */
14
- const{entries:Wh,setPrototypeOf:qh,isFrozen:Kh,getPrototypeOf:Yh,getOwnPropertyDescriptor:Xh}=Object;let{freeze:Zh,seal:Jh,create:Qh}=Object,{apply:ef,construct:tf}="undefined"!=typeof Reflect&&Reflect;Zh||(Zh=function(e){return e}),Jh||(Jh=function(e){return e}),ef||(ef=function(e,t,n){return e.apply(t,n)}),tf||(tf=function(e,t){return new e(...t)});const nf=ff(Array.prototype.forEach),of=ff(Array.prototype.pop),rf=ff(Array.prototype.push),af=ff(String.prototype.toLowerCase),sf=ff(String.prototype.toString),lf=ff(String.prototype.match),cf=ff(String.prototype.replace),df=ff(String.prototype.indexOf),uf=ff(String.prototype.trim),pf=ff(RegExp.prototype.test),gf=(hf=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return tf(hf,t)});var hf;function ff(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return ef(e,t,o)}}function mf(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:af;qh&&qh(e,null);let o=t.length;for(;o--;){let r=t[o];if("string"==typeof r){const e=n(r);e!==r&&(Kh(t)||(t[o]=e),r=e)}e[r]=!0}return e}function bf(e){const t=Qh(null);for(const[n,o]of Wh(e))void 0!==Xh(e,n)&&(t[n]=o);return t}function yf(e,t){for(;null!==e;){const n=Xh(e,t);if(n){if(n.get)return ff(n.get);if("function"==typeof n.value)return ff(n.value)}e=Yh(e)}return function(e){return console.warn("fallback value for",e),null}}const vf=Zh(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),wf=Zh(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xf=Zh(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),kf=Zh(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),_f=Zh(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Tf=Zh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Sf=Zh(["#text"]),Ef=Zh(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Cf=Zh(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Pf=Zh(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),If=Zh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Of=Jh(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Af=Jh(/<%[\w\W]*|[\w\W]*%>/gm),$f=Jh(/\${[\w\W]*}/gm),Rf=Jh(/^data-[\-\w.\u00B7-\uFFFF]/),Nf=Jh(/^aria-[\-\w]+$/),Lf=Jh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Df=Jh(/^(?:\w+script|data):/i),Mf=Jh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Uf=Jh(/^html$/i);var Bf=Object.freeze({__proto__:null,MUSTACHE_EXPR:Of,ERB_EXPR:Af,TMPLIT_EXPR:$f,DATA_ATTR:Rf,ARIA_ATTR:Nf,IS_ALLOWED_URI:Lf,IS_SCRIPT_OR_DATA:Df,ATTR_WHITESPACE:Mf,DOCTYPE_NAME:Uf});const Ff=function(){return"undefined"==typeof window?null:window};var jf=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ff();const n=t=>e(t);if(n.version="3.0.6",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:o}=t;const r=o,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:d,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:g,trustedTypes:h}=t,f=c.prototype,m=yf(f,"cloneNode"),b=yf(f,"nextSibling"),y=yf(f,"childNodes"),v=yf(f,"parentNode");if("function"==typeof s){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let w,x="";const{implementation:k,createNodeIterator:_,createDocumentFragment:T,getElementsByTagName:S}=o,{importNode:E}=r;let C={};n.isSupported="function"==typeof Wh&&"function"==typeof v&&k&&void 0!==k.createHTMLDocument;const{MUSTACHE_EXPR:P,ERB_EXPR:I,TMPLIT_EXPR:O,DATA_ATTR:A,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:N}=Bf;let{IS_ALLOWED_URI:L}=Bf,D=null;const M=mf({},[...vf,...wf,...xf,..._f,...Sf]);let U=null;const B=mf({},[...Ef,...Cf,...Pf,...If]);let F=Object.seal(Qh(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),j=null,z=null,H=!0,V=!0,G=!1,W=!0,q=!1,K=!1,Y=!1,X=!1,Z=!1,J=!1,Q=!1,ee=!0,te=!1,ne=!0,oe=!1,re={},ie=null;const ae=mf({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let se=null;const le=mf({},["audio","video","img","source","image","track"]);let ce=null;const de=mf({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ue="http://www.w3.org/1998/Math/MathML",pe="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let he=ge,fe=!1,me=null;const be=mf({},[ue,pe,ge],sf);let ye=null;const ve=["application/xhtml+xml","text/html"];let we=null,xe=null;const ke=o.createElement("form"),_e=function(e){return e instanceof RegExp||e instanceof Function},Te=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!xe||xe!==e){if(e&&"object"==typeof e||(e={}),e=bf(e),ye=ye=-1===ve.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,we="application/xhtml+xml"===ye?sf:af,D="ALLOWED_TAGS"in e?mf({},e.ALLOWED_TAGS,we):M,U="ALLOWED_ATTR"in e?mf({},e.ALLOWED_ATTR,we):B,me="ALLOWED_NAMESPACES"in e?mf({},e.ALLOWED_NAMESPACES,sf):be,ce="ADD_URI_SAFE_ATTR"in e?mf(bf(de),e.ADD_URI_SAFE_ATTR,we):de,se="ADD_DATA_URI_TAGS"in e?mf(bf(le),e.ADD_DATA_URI_TAGS,we):le,ie="FORBID_CONTENTS"in e?mf({},e.FORBID_CONTENTS,we):ae,j="FORBID_TAGS"in e?mf({},e.FORBID_TAGS,we):{},z="FORBID_ATTR"in e?mf({},e.FORBID_ATTR,we):{},re="USE_PROFILES"in e&&e.USE_PROFILES,H=!1!==e.ALLOW_ARIA_ATTR,V=!1!==e.ALLOW_DATA_ATTR,G=e.ALLOW_UNKNOWN_PROTOCOLS||!1,W=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,q=e.SAFE_FOR_TEMPLATES||!1,K=e.WHOLE_DOCUMENT||!1,Z=e.RETURN_DOM||!1,J=e.RETURN_DOM_FRAGMENT||!1,Q=e.RETURN_TRUSTED_TYPE||!1,X=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,ne=!1!==e.KEEP_CONTENT,oe=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||Lf,he=e.NAMESPACE||ge,F=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(F.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(F.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(F.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(V=!1),J&&(Z=!0),re&&(D=mf({},[...Sf]),U=[],!0===re.html&&(mf(D,vf),mf(U,Ef)),!0===re.svg&&(mf(D,wf),mf(U,Cf),mf(U,If)),!0===re.svgFilters&&(mf(D,xf),mf(U,Cf),mf(U,If)),!0===re.mathMl&&(mf(D,_f),mf(U,Pf),mf(U,If))),e.ADD_TAGS&&(D===M&&(D=bf(D)),mf(D,e.ADD_TAGS,we)),e.ADD_ATTR&&(U===B&&(U=bf(U)),mf(U,e.ADD_ATTR,we)),e.ADD_URI_SAFE_ATTR&&mf(ce,e.ADD_URI_SAFE_ATTR,we),e.FORBID_CONTENTS&&(ie===ae&&(ie=bf(ie)),mf(ie,e.FORBID_CONTENTS,we)),ne&&(D["#text"]=!0),K&&mf(D,["html","head","body"]),D.table&&(mf(D,["tbody"]),delete j.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw gf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw gf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=e.TRUSTED_TYPES_POLICY,x=w.createHTML("")}else void 0===w&&(w=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(h,i)),null!==w&&"string"==typeof x&&(x=w.createHTML(""));Zh&&Zh(e),xe=e}},Se=mf({},["mi","mo","mn","ms","mtext"]),Ee=mf({},["foreignobject","desc","title","annotation-xml"]),Ce=mf({},["title","style","font","a","script"]),Pe=mf({},wf);mf(Pe,xf),mf(Pe,kf);const Ie=mf({},_f);mf(Ie,Tf);const Oe=function(e){rf(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Ae=function(e,t){try{rf(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){rf(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!U[e])if(Z||J)try{Oe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},$e=function(e){let t=null,n=null;if(X)e="<remove></remove>"+e;else{const t=lf(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ye&&he===ge&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=w?w.createHTML(e):e;if(he===ge)try{t=(new g).parseFromString(r,ye)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(he,"template",null);try{t.documentElement.innerHTML=fe?x:r}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),he===ge?S.call(t,K?"html":"body")[0]:K?t.documentElement:i},Re=function(e){return _.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null)},Ne=function(e){return"function"==typeof l&&e instanceof l},Le=function(e,t,o){C[e]&&nf(C[e],(e=>{e.call(n,t,o,xe)}))},De=function(e){let t=null;if(Le("beforeSanitizeElements",e,null),(o=e)instanceof p&&("string"!=typeof o.nodeName||"string"!=typeof o.textContent||"function"!=typeof o.removeChild||!(o.attributes instanceof u)||"function"!=typeof o.removeAttribute||"function"!=typeof o.setAttribute||"string"!=typeof o.namespaceURI||"function"!=typeof o.insertBefore||"function"!=typeof o.hasChildNodes))return Oe(e),!0;var o;const r=we(e.nodeName);if(Le("uponSanitizeElement",e,{tagName:r,allowedTags:D}),e.hasChildNodes()&&!Ne(e.firstElementChild)&&pf(/<[/\w]/g,e.innerHTML)&&pf(/<[/\w]/g,e.textContent))return Oe(e),!0;if(!D[r]||j[r]){if(!j[r]&&Ue(r)){if(F.tagNameCheck instanceof RegExp&&pf(F.tagNameCheck,r))return!1;if(F.tagNameCheck instanceof Function&&F.tagNameCheck(r))return!1}if(ne&&!ie[r]){const t=v(e)||e.parentNode,n=y(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o)t.insertBefore(m(n[o],!0),b(e))}}return Oe(e),!0}return e instanceof c&&!function(e){let t=v(e);t&&t.tagName||(t={namespaceURI:he,tagName:"template"});const n=af(e.tagName),o=af(t.tagName);return!!me[e.namespaceURI]&&(e.namespaceURI===pe?t.namespaceURI===ge?"svg"===n:t.namespaceURI===ue?"svg"===n&&("annotation-xml"===o||Se[o]):Boolean(Pe[n]):e.namespaceURI===ue?t.namespaceURI===ge?"math"===n:t.namespaceURI===pe?"math"===n&&Ee[o]:Boolean(Ie[n]):e.namespaceURI===ge?!(t.namespaceURI===pe&&!Ee[o])&&!(t.namespaceURI===ue&&!Se[o])&&!Ie[n]&&(Ce[n]||!Pe[n]):!("application/xhtml+xml"!==ye||!me[e.namespaceURI]))}(e)?(Oe(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!pf(/<\/no(script|embed|frames)/i,e.innerHTML)?(q&&3===e.nodeType&&(t=e.textContent,nf([P,I,O],(e=>{t=cf(t,e," ")})),e.textContent!==t&&(rf(n.removed,{element:e.cloneNode()}),e.textContent=t)),Le("afterSanitizeElements",e,null),!1):(Oe(e),!0)},Me=function(e,t,n){if(ee&&("id"===t||"name"===t)&&(n in o||n in ke))return!1;if(V&&!z[t]&&pf(A,t));else if(H&&pf($,t));else if(!U[t]||z[t]){if(!(Ue(e)&&(F.tagNameCheck instanceof RegExp&&pf(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&pf(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t))||"is"===t&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&pf(F.tagNameCheck,n)||F.tagNameCheck instanceof Function&&F.tagNameCheck(n))))return!1}else if(ce[t]);else if(pf(L,cf(n,N,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==df(n,"data:")||!se[e]){if(G&&!pf(R,cf(n,N,"")));else if(n)return!1}else;return!0},Ue=function(e){return e.indexOf("-")>0},Be=function(e){Le("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U};let r=t.length;for(;r--;){const i=t[r],{name:a,namespaceURI:s,value:l}=i,c=we(a);let d="value"===a?l:uf(l);if(o.attrName=c,o.attrValue=d,o.keepAttr=!0,o.forceKeepAttr=void 0,Le("uponSanitizeAttribute",e,o),d=o.attrValue,o.forceKeepAttr)continue;if(Ae(a,e),!o.keepAttr)continue;if(!W&&pf(/\/>/i,d)){Ae(a,e);continue}q&&nf([P,I,O],(e=>{d=cf(d,e," ")}));const u=we(e.nodeName);if(Me(u,c,d)){if(!te||"id"!==c&&"name"!==c||(Ae(a,e),d="user-content-"+d),w&&"object"==typeof h&&"function"==typeof h.getAttributeType)if(s);else switch(h.getAttributeType(u,c)){case"TrustedHTML":d=w.createHTML(d);break;case"TrustedScriptURL":d=w.createScriptURL(d)}try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),of(n.removed)}catch(e){}}}Le("afterSanitizeAttributes",e,null)},Fe=function e(t){let n=null;const o=Re(t);for(Le("beforeSanitizeShadowDOM",t,null);n=o.nextNode();)Le("uponSanitizeShadowNode",n,null),De(n)||(n.content instanceof a&&e(n.content),Be(n));Le("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,i=null,s=null,c=null;if(fe=!e,fe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ne(e)){if("function"!=typeof e.toString)throw gf("toString is not a function");if("string"!=typeof(e=e.toString()))throw gf("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Y||Te(t),n.removed=[],"string"==typeof e&&(oe=!1),oe){if(e.nodeName){const t=we(e.nodeName);if(!D[t]||j[t])throw gf("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)o=$e("\x3c!----\x3e"),i=o.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i);else{if(!Z&&!q&&!K&&-1===e.indexOf("<"))return w&&Q?w.createHTML(e):e;if(o=$e(e),!o)return Z?null:Q?x:""}o&&X&&Oe(o.firstChild);const d=Re(oe?e:o);for(;s=d.nextNode();)De(s)||(s.content instanceof a&&Fe(s.content),Be(s));if(oe)return e;if(Z){if(J)for(c=T.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return(U.shadowroot||U.shadowrootmode)&&(c=E.call(r,c,!0)),c}let u=K?o.outerHTML:o.innerHTML;return K&&D["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&pf(Uf,o.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+u),q&&nf([P,I,O],(e=>{u=cf(u,e," ")})),w&&Q?w.createHTML(u):u},n.setConfig=function(){Te(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Y=!0},n.clearConfig=function(){xe=null,Y=!1},n.isValidAttribute=function(e,t,n){xe||Te({});const o=we(e),r=we(t);return Me(o,r,n)},n.addHook=function(e,t){"function"==typeof t&&(C[e]=C[e]||[],rf(C[e],t))},n.removeHook=function(e){if(C[e])return of(C[e])},n.removeHooks=function(e){C[e]&&(C[e]=[])},n.removeAllHooks=function(){C={}},n}();const zf=ve('<div class="flex flex-col animate-fade-in typebot-streaming-container"><div class="flex w-full items-center"><div class="flex relative items-start typebot-host-bubble max-w-full"><div class="flex items-center absolute px-4 py-2 bubble-typing " data-testid="host-bubble"></div><div class="flex flex-col overflow-hidden text-fade-in mx-4 my-2 relative text-ellipsis h-full gap-6">'),Hf=ve("<span>"),Vf=e=>{const[t,n]=rh(_([]),{key:`typebot-streaming-message-${e.streamingMessageId}`,storage:e.context.storage});return Gh.use({renderer:{link:(e,t,n)=>`<a href="${e}" target="_blank" rel="noopener noreferrer">${n}</a>`}}),S((()=>{if(fh()?.id!==e.streamingMessageId)return[];n(fh()?.content.split("```").map(((e,t)=>t%2==0?e.split("\n\n").map((e=>jf.sanitize(Gh.parse(e.replace(/【.+】/g,""),{breaks:!0}),{ADD_ATTR:["target"]}))):[jf.sanitize(Gh.parse("```"+e+"```",{breaks:!0}),{ADD_ATTR:["target"]})])).flat().filter(We)??[])})),(()=>{const e=zf(),n=e.firstChild.firstChild.firstChild,o=n.nextSibling;return n.style.setProperty("width","100%"),n.style.setProperty("height","100%"),Se(o,Z(se,{get each(){return t()},children:e=>(()=>{const t=Hf();return t.innerHTML=e,t})()})),e})()},Gf=ve('<div><div class="flex flex-col flex-1 gap-2">'),Wf=ve('<div class="flex flex-col w-full min-w-0 gap-2 typebot-chat-chunk">'),qf=e=>{let t;const[n,o]=_(e.isTransitionDisabled?e.messages.length:0),[r,i]=_();P((()=>{e.streamingMessageId||(0===e.messages.length&&e.onAllBubblesDisplayed(),e.onScrollToBottom(t,50))}));const a=async t=>{(e.settings.typingEmulation?.delayBetweenBubbles??Kn.delayBetweenBubbles)>0&&n()<e.messages.length-1&&await new Promise((t=>setTimeout(t,1e3*(e.settings.typingEmulation?.delayBetweenBubbles??Kn.delayBetweenBubbles))));const r=e.messages[n()].id;await e.onNewBubbleDisplayed(r),o(n()===e.messages.length?n():n()+1),e.onScrollToBottom(t),n()===e.messages.length&&(i(t),e.onAllBubblesDisplayed())};return(()=>{const o=Wf();return Se(o,Z(le,{get when(){return e.messages.length>0},get children(){const t=Gf(),o=t.firstChild;return Se(t,Z(le,{get when(){return(e.theme.chat?.hostAvatar?.isEnabled??Zd)&&e.messages.length>0},get children(){return Z(hh,{get hostAvatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled}})}}),o),Se(o,Z(se,{get each(){return e.messages.slice(0,n()+1)},children:(t,n)=>Z(po,{message:t,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return E((()=>!(!(e.settings.typingEmulation?.isDisabledOnFirstMessage??Kn.isDisabledOnFirstMessage)||0!==e.index)))()&&0===n()},get onTransitionEnd(){return e.isTransitionDisabled?void 0:a},get onCompleted(){return e.onSubmit}})})),T((n=>{const r="flex"+(Kt()?" gap-1":" gap-2"),i=e.theme.chat?.guestAvatar?.isEnabled?Kt()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return r!==n._v$&&ke(t,n._v$=r),i!==n._v$2&&(null!=(n._v$2=i)?o.style.setProperty("max-width",i):o.style.removeProperty("max-width")),n}),{_v$:void 0,_v$2:void 0}),t}}),null),Se(o,(()=>{const o=E((()=>!(!e.input||n()!==e.messages.length)));return()=>o()&&Z(lh,{ref(e){"function"==typeof t?t(e):t=e},get block(){return e.input},get chunkIndex(){return e.index},get hasHostAvatar(){return e.theme.chat?.hostAvatar?.isEnabled??Zd},get guestAvatar(){return e.theme.chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??qn.isInputPrefillEnabled},get hasError(){return e.hasError},onTransitionEnd:()=>e.onScrollToBottom(r()),get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})})(),null),Se(o,Z(le,{get when(){return e.streamingMessageId},keyed:!0,children:t=>(()=>{const n=Gf(),o=n.firstChild;return Se(n,Z(le,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Zd},get children(){return Z(hh,{get hostAvatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar}})}}),o),Se(o,Z(Vf,{streamingMessageId:t,get context(){return e.context}})),T((t=>{const r="flex"+(Kt()?" gap-1":" gap-2"),i=e.theme.chat?.guestAvatar?.isEnabled?Kt()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%";return r!==t._v$3&&ke(n,t._v$3=r),i!==t._v$4&&(null!=(t._v$4=i)?o.style.setProperty("max-width",i):o.style.removeProperty("max-width")),t}),{_v$3:void 0,_v$4:void 0}),n})()}),null),o})()},Kf=async e=>{e?.trackingId&&(e=>{e&&(window.gtag?window.gtag("event",e.action,{event_category:Ge(e.category)?void 0:e.category,event_label:Ge(e.label)?void 0:e.label,value:e.value,send_to:Ge(e.sendTo)?void 0:e.sendTo}):console.error("Google Analytics was not properly initialized"))})(e)};var Yf={exports:{}};const Xf="undefined"!=typeof Buffer,Zf=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Jf=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Qf(e,t,n){null==n&&null!==t&&"object"==typeof t&&(n=t,t=void 0),Xf&&Buffer.isBuffer(e)&&(e=e.toString()),e&&65279===e.charCodeAt(0)&&(e=e.slice(1));const o=JSON.parse(e,t);if(null===o||"object"!=typeof o)return o;const r=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if("ignore"===r&&"ignore"===i)return o;if("ignore"!==r&&"ignore"!==i){if(!1===Zf.test(e)&&!1===Jf.test(e))return o}else if("ignore"!==r&&"ignore"===i){if(!1===Zf.test(e))return o}else if(!1===Jf.test(e))return o;return em(o,{protoAction:r,constructorAction:i,safe:n&&n.safe})}function em(e,{protoAction:t="error",constructorAction:n="error",safe:o}={}){let r=[e];for(;r.length;){const e=r;r=[];for(const i of e){if("ignore"!==t&&Object.prototype.hasOwnProperty.call(i,"__proto__")){if(!0===o)return null;if("error"===t)throw new SyntaxError("Object contains forbidden prototype property");delete i.__proto__}if("ignore"!==n&&Object.prototype.hasOwnProperty.call(i,"constructor")&&Object.prototype.hasOwnProperty.call(i.constructor,"prototype")){if(!0===o)return null;if("error"===n)throw new SyntaxError("Object contains forbidden prototype property");delete i.constructor}for(const e in i){const t=i[e];t&&"object"==typeof t&&r.push(t)}}}return e}function tm(e,t,n){const o=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Qf(e,t,n)}finally{Error.stackTraceLimit=o}}Yf.exports=tm,Yf.exports.default=tm,Yf.exports.parse=tm,Yf.exports.safeParse=function(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Qf(e,t,{safe:!0})}catch(e){return null}finally{Error.stackTraceLimit=n}},Yf.exports.scan=em;var nm={code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},om={code:"1",name:"function_call",parse:e=>{if(null==e||"object"!=typeof e||!("function_call"in e)||"object"!=typeof e.function_call||null==e.function_call||!("name"in e.function_call)||!("arguments"in e.function_call)||"string"!=typeof e.function_call.name||"string"!=typeof e.function_call.arguments)throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},rm={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},im={code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},am={code:"4",name:"assistant_message",parse:e=>{if(!(null!=e&&"object"==typeof e&&"id"in e&&"role"in e&&"content"in e&&"string"==typeof e.id&&"string"==typeof e.role&&"assistant"===e.role&&Array.isArray(e.content)&&e.content.every((e=>null!=e&&"object"==typeof e&&"type"in e&&"text"===e.type&&"text"in e&&null!=e.text&&"object"==typeof e.text&&"value"in e.text&&"string"==typeof e.text.value))))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},sm={code:"5",name:"assistant_control_data",parse:e=>{if(null==e||"object"!=typeof e||!("threadId"in e)||!("messageId"in e)||"string"!=typeof e.threadId||"string"!=typeof e.messageId)throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},lm={code:"6",name:"data_message",parse:e=>{if(null==e||"object"!=typeof e||!("role"in e)||!("data"in e)||"string"!=typeof e.role||"data"!==e.role)throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},cm={code:"7",name:"tool_calls",parse:e=>{if(null==e||"object"!=typeof e||!("tool_calls"in e)||"object"!=typeof e.tool_calls||null==e.tool_calls||!Array.isArray(e.tool_calls)||e.tool_calls.some((e=>!(null!=e&&"object"==typeof e&&"id"in e&&"string"==typeof e.id&&"type"in e&&"string"==typeof e.type&&"function"in e&&null!=e.function&&"object"==typeof e.function&&"arguments"in e.function&&"string"==typeof e.function.name&&"string"==typeof e.function.arguments))))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},dm={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},um={code:"9",name:"tool_call",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName||!("args"in e)||"object"!=typeof e.args)throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},pm={code:"a",name:"tool_result",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},gm={code:"b",name:"tool_call_streaming_start",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName)throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},hm={code:"c",name:"tool_call_delta",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("argsTextDelta"in e)||"string"!=typeof e.argsTextDelta)throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},fm={code:"d",name:"finish_message",parse:e=>{if(!(null!=e&&"object"==typeof e&&"finishReason"in e&&"string"==typeof e.finishReason&&"usage"in e&&null!=e.usage&&"object"==typeof e.usage&&"promptTokens"in e.usage&&"completionTokens"in e.usage))throw new Error('"finish_message" parts expect an object with a "finishReason" and "usage" property.');return"number"!=typeof e.usage.promptTokens&&(e.usage.promptTokens=Number.NaN),"number"!=typeof e.usage.completionTokens&&(e.usage.completionTokens=Number.NaN),{type:"finish_message",value:e}}},mm=[nm,om,rm,im,am,sm,lm,cm,dm,um,pm,gm,hm,fm],bm={[nm.code]:nm,[om.code]:om,[rm.code]:rm,[im.code]:im,[am.code]:am,[sm.code]:sm,[lm.code]:lm,[cm.code]:cm,[dm.code]:dm,[um.code]:um,[pm.code]:pm,[gm.code]:gm,[hm.code]:hm,[fm.code]:fm},ym=mm.map((e=>e.code)),vm=e=>{const t=e.indexOf(":");if(-1===t)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!ym.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const o=n,r=e.slice(t+1),i=JSON.parse(r);return bm[o].parse(i)},wm="\n".charCodeAt(0);function xm(e,t){const n=new Uint8Array(t);let o=0;for(const t of e)n.set(t,o),o+=t.length;return e.length=0,n}let km=null;const _m=e=>async({messages:t,onMessageStream:n})=>{try{km=new AbortController;const o=e.apiHost,r=await fetch((We(o)?o:xt())+`/api/v2/sessions/${e.sessionId}/streamMessage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t}),signal:km.signal});if(!r.ok)return(e.retryAttempt??0)<1&&(403===r.status||500===r.status||503===r.status)?(await new Promise((e=>setTimeout(e,3e3))),_m({...e,retryAttempt:(e.retryAttempt??0)+1})({messages:t,onMessageStream:n})):{error:await r.json()||"Failed to fetch the chat response."};if(!r.body)throw new Error("The response body is empty.");let i="";const a=r.body.getReader(),s=ie();for await(const{type:e,value:t}of async function*(e,{isAborted:t}={}){const n=new TextDecoder,o=[];let r=0;for(;;){const{value:i}=await e.read();if(i&&(o.push(i),r+=i.length,i[i.length-1]!==wm))continue;if(0===o.length)break;const a=xm(o,r);r=0;const s=n.decode(a,{stream:!0}).split("\n").filter((e=>""!==e)).map(vm);for(const e of s)yield e;if(null==t?void 0:t()){e.cancel();break}}}(a,{isAborted:()=>null===km}))"text"===e&&(i+=t,n&&n({id:s,message:i}));return km=null,{message:i}}catch(e){return console.error(e),"AbortError"===e.name?(km=null,{error:{message:"Request aborted"}}):e instanceof Error?{error:{message:e.message}}:{error:{message:"Failed to fetch the chat response."}}}},Tm=e=>{if(Ve(e))return null;if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return console.warn("Failed to safely stringify variable value",e),null}},Sm=Object.getPrototypeOf((async function(){})).constructor,Em=async e=>{Ge(e?.pixelId)||(e=>{if(!e?.eventType||!e.pixelId)return;if(!window.fbq)return void console.error("Facebook Pixel was not properly initialized");const t=e.params?.length?e.params.reduce(((e,t)=>t.key&&t.value?{...e,[t.key]:t.value}:e),{}):void 0;if("Custom"===e.eventType){if(!e.name)return;window.fbq("trackSingleCustom",e.pixelId,e.name,t)}window.fbq("trackSingle",e.pixelId,e.eventType,t)})(e)},Cm=async e=>{const t=e.customHeadCode;We(t)&&(e=>{e.split("</noscript>").forEach((e=>{const[t,n]=e.split("<noscript>"),o=document.createRange().createContextualFragment(t);if(document.head.append(o),Ve(n))return;const r=document.createElement("noscript"),i=document.createRange().createContextualFragment(n);r.append(i),document.head.append(r)}))})(t);const n=e.gtmId;We(n)&&document.body.prepend((e=>{if(document.getElementById("gtm-noscript"))return"";const t=document.createElement("noscript");t.id="gtm-noscript";const n=document.createElement("iframe");return n.src=`https://www.googletagmanager.com/ns.html?id=${e}`,n.height="0",n.width="0",n.style.display="none",n.style.visibility="hidden",t.appendChild(n),t})(n));const o=e.googleAnalyticsId;var r;We(o)&&await(r=o,He(window.gtag)?Promise.resolve():new Promise((e=>{const t=document.getElementById("gtag");if(!t){const t=document.createElement("script");t.src=`https://www.googletagmanager.com/gtag/js?id=${r}`,t.id="gtag";const n=document.createElement("script");n.innerHTML=`window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n \n gtag('config', '${r}');\n `,document.body.appendChild(t),document.body.appendChild(n),t.onload=()=>{e()}}t&&e()})));const i=e.pixelIds;He(i)&&(e=>{const t=document.createElement("script");t.innerHTML=`!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n ${e.map((e=>`fbq('init', '${e}');`)).join("\n")}\n fbq('track', 'PageView');`,document.head.appendChild(t)})(i)},Pm=async({clientSideAction:e,context:t,onMessageStream:n})=>{if("chatwoot"in e)return o=e.chatwoot,void wn(o.scriptToExecute);var o;if("googleAnalytics"in e)return Kf(e.googleAnalytics);if("scriptToExecute"in e)return wn(e.scriptToExecute);if("redirect"in e)return(({url:e,isNewTab:t}={})=>{if(!e)return;return window.open(e,t?"_blank":"_top")?void 0:{blockedPopupUrl:e}})(e.redirect);if("wait"in e)return await(async({secondsToWaitFor:e})=>{await new Promise((t=>setTimeout(t,1e3*e)))})(e.wait),e.expectsDedicatedReply?{replyToSend:void 0}:void 0;if("setVariable"in e)return(async({content:e,args:t,isCode:n})=>{try{if(!isNaN(e)&&/0[^.].+/.test(e))return{replyToSend:e};const n=Sm(...t.map((e=>e.id)),e.includes("return ")?e:`return ${e}`),o=await n(...t.map((e=>e.value)));return{replyToSend:Tm(o)??void 0}}catch(t){return console.error(t),{replyToSend:Tm(e)??void 0,logs:n?[{status:"error",description:"Failed to execute Set Variable code",details:yn(t)}]:void 0}}})(e.setVariable.scriptToExecute);if("streamOpenAiChatCompletion"in e||"stream"in e){const{error:o,message:r}=await _m(t)({messages:"streamOpenAiChatCompletion"in e?e.streamOpenAiChatCompletion?.messages:void 0,onMessageStream:n});return o?{replyToSend:void 0,logs:[{status:"error",description:"Message streaming returned an error",details:JSON.stringify(o,null,2)}]}:{replyToSend:r}}if("webhookToExecute"in e){return{replyToSend:await(async e=>{const{url:t,method:n,body:o,headers:r}=e;try{const e=await fetch(t,{method:n,body:"GET"!==n&&o?JSON.stringify(o):void 0,headers:r}),i=e.status,a=await e.json();return JSON.stringify({statusCode:i,data:a})}catch(e){return console.error(e),JSON.stringify({statusCode:500,data:"An error occured while executing the webhook on the client"})}})(e.webhookToExecute)}}return"startPropsToInject"in e?Cm(e.startPropsToInject):"pixel"in e?Em(e.pixel):"codeToExecute"in e?kn(e.codeToExecute):void 0},Im=ve('<div class="flex flex-col animate-fade-in"><div class="flex w-full items-center"><div class="flex relative items-start typebot-host-bubble"><div class="flex items-center absolute px-4 py-2 bubble-typing " data-testid="host-bubble"></div><p class="overflow-hidden text-fade-in mx-4 my-2 whitespace-pre-wrap slate-html-container relative opacity-0 h-6 text-ellipsis">'),Om=()=>(()=>{const e=Im(),t=e.firstChild.firstChild.firstChild;return t.style.setProperty("width","64px"),t.style.setProperty("height","32px"),Se(t,Z(rn,{})),e})(),Am=ve('<div class="flex w-full typebot-loading-chunk"><div class="flex flex-col w-full min-w-0"><div class="flex gap-2">'),$m=e=>(()=>{const t=Am(),n=t.firstChild.firstChild;return Se(n,Z(le,{get when(){return e.theme.chat?.hostAvatar?.isEnabled??Zd},get children(){return Z(hh,{get hostAvatarSrc(){return e.theme.chat?.hostAvatar?.url}})}}),null),Se(n,Z(Om,{}),null),t})(),Rm=ve('<div class="w-full max-w-xs p-4 text-gray-500 bg-white shadow flex flex-col gap-2 typebot-popup-blocked-toast" role="alert"><div class="flex flex-col gap-1"><span class=" text-sm font-semibold text-gray-900">Popup blocked</span><div class="text-sm font-normal">The bot wants to open a new tab but it was blocked by your browser. It needs a manual approval.</div></div><a target="_blank" class="py-1 px-4 justify-center text-sm font-semibold text-white focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 filter hover:brightness-90 active:brightness-75 typebot-button" rel="noreferrer">Continue in new tab'),Nm=e=>(()=>{const t=Rm(),n=t.firstChild.nextSibling;return n.$$click=()=>e.onLinkClick(),T((()=>xe(n,"href",e.url))),t})();we(["click"]);const Lm=async({apiHost:e,sessionId:t,clientLogs:n})=>{try{await Wt.post(`${We(e)?e:xt()}/api/v1/sessions/${t}/clientLogs`,{json:{clientLogs:n}})}catch(e){console.log(e)}},Dm=e=>"text"===e.type?e.label??e.value:e.url,Mm=ve('<div class="flex flex-col overflow-y-auto w-full px-3 pt-10 relative scrollable-container typebot-chat-view scroll-smooth gap-2">'),Um=ve('<div class="flex justify-end">'),Bm=ve('<div class="w-full flex-shrink-0 typebot-bottom-spacer">'),Fm=e=>{let t;const[n,o,r,i]=rh(_([{input:e.initialChatReply.input,messages:e.initialChatReply.messages,clientSideActions:e.initialChatReply.clientSideActions}]),{key:`typebot-${e.context.typebot.id}-chatChunks`,storage:e.context.storage,onRecovered:()=>{setTimeout((()=>{t?.scrollTo(0,t.scrollHeight)}),200)}}),[a,s]=_(e.initialChatReply.dynamicTheme),[l,c]=_(e.initialChatReply.typebot.theme),[d,u]=_(!1),[p,g]=_(),[h,f]=_(!1);P((()=>{(async()=>{const e=n()[0];if(!e.clientSideActions)return;const t=e.clientSideActions.filter((e=>Ve(e.lastBubbleBlockId)));await k(t)})()}));const m=({id:e,message:t})=>{u(!1);const r=[...n()].pop();r&&(r.streamingMessageId!==e&&o((t=>[...t,{messages:[],streamingMessageId:e}])),mh({id:e,content:t}))};S((()=>{c(((e,t)=>({...e,chat:{...e.chat,hostAvatar:e.chat?.hostAvatar&&t?.hostAvatarUrl?{...e.chat.hostAvatar,url:t.hostAvatarUrl}:e.chat?.hostAvatar,guestAvatar:e.chat?.guestAvatar&&t?.guestAvatarUrl?{...e.chat.guestAvatar,url:t?.guestAvatarUrl}:e.chat?.guestAvatar}}))(e.initialChatReply.typebot.theme,a()))}));const b=async t=>{t&&(e.onNewLogs?.(t),e.context.isPreview||await Lm({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:t}))},y=async t=>{i(!1),f(!1);const r=[...n()].pop()?.input;r?.id&&e.onAnswer&&t&&e.onAnswer({message:Dm(t),blockId:r.id});const a=setTimeout((()=>{u(!0)}),1e3);v();const{data:l,error:c}=await(async({apiHost:e,message:t,sessionId:n})=>{try{return{data:await Wt.post(`${We(e)?e:xt()}/api/v1/sessions/${n}/continueChat`,{json:{message:t},timeout:!1}).json()}}catch(e){return{error:e}}})({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,message:zm(t)});if(clearTimeout(a),u(!1),c){f(!0);const t=[{description:"Failed to send the reply",details:c instanceof Tt?{status:c.response.status,body:await c.response.json()}:c,status:"error"}];return await Lm({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:t}),void e.onNewLogs?.(t)}if(l){if(l.progress&&e.onProgressUpdate?.(l.progress),l.lastMessageNewFormat&&oh([...nh(),{inputIndex:[...n()].length-1,formattedMessage:l.lastMessageNewFormat}]),l.logs&&e.onNewLogs?.(l.logs),l.dynamicTheme&&s(l.dynamicTheme),l.input&&e.onNewInputBlock&&e.onNewInputBlock(l.input),l.clientSideActions){const e=l.clientSideActions.filter((e=>Ve(e.lastBubbleBlockId)));if(await k(e),1===l.clientSideActions.length&&"stream"===l.clientSideActions[0].type&&0===l.messages.length&&void 0===l.input)return}o((e=>[...e,{input:l.input,messages:l.messages,clientSideActions:l.clientSideActions}]))}},v=(e,n=0)=>{if(!t)return;const o=.6*t.clientHeight-128;t.scrollTop+t.clientHeight>=t.scrollHeight-o&&setTimeout((()=>{t?.scrollTo(0,e?e.offsetTop-n:t.scrollHeight)}),50)},w=async()=>{const t=[...n()].pop();t&&Ve(t.input)&&e.onEnd?.()},x=async e=>{const t=[...n()].pop();if(t&&t.clientSideActions){const n=t.clientSideActions.filter((t=>t.lastBubbleBlockId===e));await k(n)}},k=async t=>{if(!r())for(const n of t){("streamOpenAiChatCompletion"in n||"webhookToExecute"in n||"stream"in n)&&u(!0);const t=await Pm({clientSideAction:n,context:{apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId},onMessageStream:m});if(t&&"logs"in t&&b(t.logs),t&&"replyToSend"in t)return u(!1),void y(t.replyToSend?{type:"text",value:t.replyToSend}:void 0);t&&"blockedPopupUrl"in t&&g(t.blockedPopupUrl)}};I((()=>{mh(void 0),oh([])}));const T=()=>y(void 0);return(()=>{const o=Mm();return"function"==typeof t?Te(t,o):t=o,Se(o,Z(se,{get each(){return n()},children:(t,o)=>Z(qf,{get index(){return o()},get messages(){return t.messages},get input(){return t.input},get theme(){return l()},get settings(){return e.initialChatReply.typebot.settings},get streamingMessageId(){return t.streamingMessageId},get context(){return e.context},get hideAvatar(){return E((()=>!t.input))()&&((n()[o()+1]?.messages??0).length>0||void 0!==n()[o()+1]?.streamingMessageId||t.messages.length>0&&d())},get hasError(){return E((()=>!!h()))()&&o()===n().length-1},get isTransitionDisabled(){return o()!==n().length-1},onNewBubbleDisplayed:x,onAllBubblesDisplayed:w,onSubmit:y,onScrollToBottom:v,onSkip:T})}),null),Se(o,Z(le,{get when(){return d()},get children(){return Z($m,{get theme(){return l()}})}}),null),Se(o,Z(le,{get when(){return p()},keyed:!0,children:e=>(()=>{const t=Um();return Se(t,Z(Nm,{url:e,onLinkClick:()=>g(void 0)})),t})()}),null),Se(o,Z(jm,{}),null),o})()},jm=()=>(()=>{const e=Bm();return e.style.setProperty("height","128px"),e})(),zm=e=>{if(e)return"text"===e.type?{type:"text",text:e.value,attachedFileUrls:e.attachments?.map((e=>e.url))}:"recording"===e.type?{type:"audio",url:e.url}:void 0},Hm=ve('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),Vm=e=>(()=>{const t=Hm(),n=t.firstChild,o=n.nextSibling;return Se(n,(()=>e.error.message)),Se(o,(()=>JSON.stringify(e.error.cause,null,2))),t})(),Gm="resultId",Wm=(e,{typebotId:t,storage:n})=>{try{const o=JSON.stringify(e);Xm(n).setItem(`typebot-${t}-initialChatReply`,o)}catch{}},qm=()=>{try{sessionStorage.setItem("typebot-botOpened","true")}catch{}},Km=()=>{try{sessionStorage.removeItem("typebot-botOpened")}catch{}},Ym=()=>{try{return"true"===sessionStorage.getItem("typebot-botOpened")}catch{return!1}},Xm=e=>"session"===(e??qn.rememberUser.storage)?sessionStorage:localStorage,Zm=e=>{Object.keys(localStorage).forEach((t=>{t.startsWith(`typebot-${e}`)&&localStorage.removeItem(t)})),Object.keys(sessionStorage).forEach((t=>{t.startsWith(`typebot-${e}`)&&sessionStorage.removeItem(t)}))},Jm={bgImage:"--typebot-container-bg-image",bgColor:"--typebot-container-bg-color",fontFamily:"--typebot-container-font-family",progressBar:{position:"--typebot-progress-bar-position",color:"--typebot-progress-bar-color",colorRgb:"--typebot-progress-bar-bg-rgb",height:"--typebot-progress-bar-height",top:"--typebot-progress-bar-top",bottom:"--typebot-progress-bar-bottom"}},Qm={container:{maxWidth:"--typebot-chat-container-max-width",maxHeight:"--typebot-chat-container-max-height",bgColor:"--typebot-chat-container-bg-rgb",color:"--typebot-chat-container-color",borderRadius:"--typebot-chat-container-border-radius",borderWidth:"--typebot-chat-container-border-width",borderColor:"--typebot-chat-container-border-rgb",borderOpacity:"--typebot-chat-container-border-opacity",opacity:"--typebot-chat-container-opacity",blur:"--typebot-chat-container-blur",boxShadow:"--typebot-chat-container-box-shadow"},hostBubbles:{bgColor:"--typebot-host-bubble-bg-rgb",color:"--typebot-host-bubble-color",borderRadius:"--typebot-host-bubble-border-radius",borderWidth:"--typebot-host-bubble-border-width",borderColor:"--typebot-host-bubble-border-rgb",borderOpacity:"--typebot-host-bubble-border-opacity",opacity:"--typebot-host-bubble-opacity",blur:"--typebot-host-bubble-blur",boxShadow:"--typebot-host-bubble-box-shadow"},guestBubbles:{bgColor:"--typebot-guest-bubble-bg-rgb",color:"--typebot-guest-bubble-color",borderRadius:"--typebot-guest-bubble-border-radius",borderWidth:"--typebot-guest-bubble-border-width",borderColor:"--typebot-guest-bubble-border-rgb",borderOpacity:"--typebot-guest-bubble-border-opacity",opacity:"--typebot-guest-bubble-opacity",blur:"--typebot-guest-bubble-blur",boxShadow:"--typebot-guest-bubble-box-shadow"},inputs:{bgColor:"--typebot-input-bg-rgb",color:"--typebot-input-color",placeholderColor:"--typebot-input-placeholder-color",borderRadius:"--typebot-input-border-radius",borderWidth:"--typebot-input-border-width",borderColor:"--typebot-input-border-rgb",borderOpacity:"--typebot-input-border-opacity",opacity:"--typebot-input-opacity",blur:"--typebot-input-blur",boxShadow:"--typebot-input-box-shadow"},buttons:{bgRgb:"--typebot-button-bg-rgb",color:"--typebot-button-color",borderRadius:"--typebot-button-border-radius",borderWidth:"--typebot-button-border-width",borderColor:"--typebot-button-border-rgb",borderOpacity:"--typebot-button-border-opacity",opacity:"--typebot-button-opacity",blur:"--typebot-button-blur",boxShadow:"--typebot-button-box-shadow"},checkbox:{bgRgb:"--typebot-checkbox-bg-rgb",alphaRatio:"--selectable-alpha-ratio"}},eb=(e,t,n)=>{cb(e?.background,t),t.setProperty(Jm.fontFamily,("string"==typeof e?.font?e.font:e?.font?.family)??Fd),tb(e?.progressBar,t,n)},tb=(e,t,n)=>{const o=e?.position??Hd;t.setProperty(Jm.progressBar.position,"fixed"===o?n?"absolute":"fixed":o),t.setProperty(Jm.progressBar.color,e?.color??"#0042DA"),t.setProperty(Jm.progressBar.colorRgb,Ke(e?.backgroundColor??"#e0edff").join(", ")),t.setProperty(Jm.progressBar.height,`${e?.thickness??4}px`);const r=e?.placement??"Top";t.setProperty(Jm.progressBar.top,"Top"===r?"0":"auto"),t.setProperty(Jm.progressBar.bottom,"Bottom"===r?"0":"auto")},nb=(e,t,n)=>{ob(e?.container,t,n,e?.roundness),rb(e?.hostBubbles,n,e?.roundness),ib(e?.guestBubbles,n,e?.roundness),ab(e?.buttons,n,e?.roundness),sb(e?.inputs,n,e?.roundness),lb(e?.container,t,n)},ob=(e,t,n,o)=>{const r=e?.backgroundColor??Gd,i="transparent"===r||Ge(r);n.setProperty(Qm.container.bgColor,i?"0, 0, 0":Ke(r).join(", ")),n.setProperty(Qm.container.color,Ke(e?.color??((({chatContainer:e,generalBackground:t})=>{const n=e?.backgroundColor??Gd;if((e?.opacity??1)<=.3||"transparent"===n||Ge(n)){const e=t?.type??jd,n=e===Md.IMAGE?"#000000":e===Md.COLOR&&We(t?.content)?t.content:"#ffffff";return Ye(n)}return Ye(e?.backgroundColor??zd)})({chatContainer:e,generalBackground:t})?Ud:Bd)).join(", ")),n.setProperty(Qm.container.maxWidth,e?.maxWidth??"800px"),n.setProperty(Qm.container.maxHeight,e?.maxHeight??"100%");const a=i?"1":(e?.opacity??1).toString();n.setProperty(Qm.container.opacity,i?"0":(e?.opacity??1).toString()),n.setProperty(Qm.container.blur,"1"===a||i?"0xp":`${e?.blur??0}px`),pb(e?.shadow,n,Qm.container.boxShadow),ub(e?.border??{roundeness:o??Vd},n,Qm.container.borderRadius),n.setProperty(Qm.container.borderWidth,He(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),n.setProperty(Qm.container.borderOpacity,He(e?.border?.opacity)?e.border.opacity.toString():1..toString()),n.setProperty(Qm.container.borderColor,Ke(e?.border?.color??"").join(", "))},rb=(e,t,n)=>{t.setProperty(Qm.hostBubbles.bgColor,Ke(e?.backgroundColor??"#F7F8FF").join(", ")),t.setProperty(Qm.hostBubbles.color,e?.color??Wd),ub(e?.border??{roundeness:n??Vd},t,Qm.hostBubbles.borderRadius),t.setProperty(Qm.hostBubbles.borderWidth,He(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(Qm.hostBubbles.borderColor,Ke(e?.border?.color??"").join(", ")),t.setProperty(Qm.hostBubbles.opacity,"transparent"===e?.backgroundColor?"0":He(e?.opacity)?e.opacity.toString():1..toString()),t.setProperty(Qm.hostBubbles.borderOpacity,He(e?.border?.opacity)?e.border.opacity.toString():1..toString()),t.setProperty(Qm.hostBubbles.blur,He(e?.blur)?`${e.blur??0}px`:"none"),pb(e?.shadow,t,Qm.hostBubbles.boxShadow)},ib=(e,t,n)=>{t.setProperty(Qm.guestBubbles.bgColor,Ke(e?.backgroundColor??"#FF8E21").join(", ")),t.setProperty(Qm.guestBubbles.color,e?.color??qd),ub(e?.border??{roundeness:n??Vd},t,Qm.guestBubbles.borderRadius),t.setProperty(Qm.guestBubbles.borderWidth,He(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(Qm.guestBubbles.borderColor,Ke(e?.border?.color??"").join(", ")),t.setProperty(Qm.guestBubbles.borderOpacity,He(e?.border?.opacity)?e.border.opacity.toString():1..toString()),t.setProperty(Qm.guestBubbles.opacity,"transparent"===e?.backgroundColor?"0":He(e?.opacity)?e.opacity.toString():1..toString()),t.setProperty(Qm.guestBubbles.blur,He(e?.blur)?`${e.blur??0}px`:"none"),pb(e?.shadow,t,Qm.guestBubbles.boxShadow)},ab=(e,t,n)=>{const o=e?.backgroundColor??Kd;t.setProperty(Qm.buttons.bgRgb,Ke(o).join(", ")),t.setProperty(Qm.buttons.bgRgb,Ke(o).join(", ")),t.setProperty(Qm.buttons.color,e?.color??Yd),ub(e?.border??{roundeness:n??Vd},t,Qm.buttons.borderRadius),t.setProperty(Qm.buttons.borderWidth,He(e?.border?.thickness)?`${e?.border?.thickness}px`:"1px"),t.setProperty(Qm.buttons.borderColor,Ke(e?.border?.color??e?.backgroundColor??Kd).join(", ")),t.setProperty(Qm.buttons.borderOpacity,He(e?.border?.opacity)?e.border.opacity.toString():1..toString()),t.setProperty(Qm.buttons.opacity,"transparent"===e?.backgroundColor?"0":He(e?.opacity)?e.opacity.toString():1..toString()),t.setProperty(Qm.buttons.blur,He(e?.blur)?`${e.blur??0}px`:"none"),pb(e?.shadow,t,Qm.buttons.boxShadow)},sb=(e,t,n)=>{t.setProperty(Qm.inputs.bgColor,Ke(e?.backgroundColor??"#FFFFFF").join(", ")),t.setProperty(Qm.inputs.color,e?.color??Xd),t.setProperty(Qm.inputs.placeholderColor,e?.placeholderColor??"#9095A0"),ub(e?.border??{roundeness:n??Vd},t,Qm.inputs.borderRadius),t.setProperty(Qm.inputs.borderWidth,He(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(Qm.inputs.borderColor,Ke(e?.border?.color??"").join(", ")),t.setProperty(Qm.inputs.borderOpacity,He(e?.border?.opacity)?e.border.opacity.toString():1..toString()),t.setProperty(Qm.inputs.opacity,"transparent"===e?.backgroundColor?"0":He(e?.opacity)?e.opacity.toString():1..toString()),t.setProperty(Qm.inputs.blur,He(e?.blur)?`${e.blur??0}px`:"none"),pb(e?.shadow??"md",t,Qm.inputs.boxShadow)},lb=(e,t,n)=>{const o=e?.backgroundColor??Gd;if("transparent"===o||Ge(o)||(e?.opacity??1)<=.2){const e=t?.type??jd;n.setProperty(Qm.checkbox.bgRgb,e===Md.IMAGE?"rgba(255, 255, 255, 0.75)":Ke((e===Md.COLOR?t?.content:"#ffffff")??"#ffffff").join(", ")),e===Md.IMAGE?n.setProperty(Qm.checkbox.alphaRatio,"3"):n.setProperty(Qm.checkbox.alphaRatio,t?.content&&Ye(t?.content)?"1":"2")}else n.setProperty(Qm.checkbox.bgRgb,Ke(o).concat(e?.opacity??1).join(", ")),n.setProperty(Qm.checkbox.alphaRatio,Ye(o)?"1":"2")},cb=(e,t)=>{t.setProperty(Jm.bgImage,null),t.setProperty(Jm.bgColor,null),t.setProperty((e?.type??jd)===Md.IMAGE?Jm.bgImage:Jm.bgColor,db({type:e?.type??jd,content:e?.content??zd}))},db=({type:e,content:t}={})=>{switch(e){case Md.NONE:return"transparent";case void 0:case Md.COLOR:return t??zd;case Md.IMAGE:return`url(${t})`}},ub=(e,t,n)=>{switch(e?.roundeness??Vd){case"none":t.setProperty(n,"0");break;case"medium":t.setProperty(n,"6px");break;case"large":t.setProperty(n,"20px");break;case"custom":t.setProperty(n,`${e.customRoundeness??6}px`)}},pb=(e,t,n)=>{if(void 0!==e)switch(e){case"none":t.setProperty(n,"0 0 #0000");break;case"sm":t.setProperty(n,"0 1px 2px 0 rgb(0 0 0 / 0.05)");break;case"md":t.setProperty(n,"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)");break;case"lg":t.setProperty(n,"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)");break;case"xl":t.setProperty(n,"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)");break;case"2xl":t.setProperty(n,"0 25px 50px -12px rgb(0 0 0 / 0.25)")}else t.setProperty(n,"0 0 #0000")};const gb="typebot-font",hb=e=>{const t=document.getElementById(gb);if("string"==typeof e||"Google"===e.type){const n=("string"==typeof e?e:e.family)??Fd;if(t?.getAttribute("href")?.includes(n))return;t?.remove();const o=document.createElement("link");return o.href=`https://fonts.bunny.net/css2?family=${n}:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&display=swap`,o.rel="stylesheet",o.id=gb,void document.head.appendChild(o)}if("Custom"===e.type){if(We(e.css)){if(t?.innerHTML===e.css)return;t?.remove();const n=document.createElement("style");n.innerHTML=e.css,n.id=gb,document.head.appendChild(n)}if(We(e.url)){if(t?.getAttribute("href")===e.url)return;t?.remove();const n=document.createElement("link");n.href=e.url,n.rel="stylesheet",n.id=gb,document.head.appendChild(n)}}},fb=ve('<div class="typebot-progress-bar-container"><div class="typebot-progress-bar">'),mb=e=>(()=>{const t=fb(),n=t.firstChild;return T((()=>null!=`${e.value}%`?n.style.setProperty("width",`${e.value}%`):n.style.removeProperty("width"))),t})(),[bb,yb]=_(),vb=ve("<style>"),wb=ve("<div>"),xb=e=>{const[t,n]=_(),[o,r]=_(""),[i,a]=_(!1),[s,l]=_(),c=async()=>{e.font&&hb(e.font),a(!0);const t=new URLSearchParams(location.search);e.onInit?.();const o={};t.forEach(((e,t)=>{o[t]=e}));const i="string"==typeof e.typebot?e.typebot:void 0,s="string"!=typeof e.typebot||(e.isPreview??!1),c=(e=>{if(e)try{return sessionStorage.getItem(`${Gm}-${e}`)??localStorage.getItem(`${Gm}-${e}`)??void 0}catch{}})(i),{data:d,error:u}=await async function({typebot:e,isPreview:t,apiHost:n,prefilledVariables:o,resultId:r,stripeRedirectStatus:i,startFrom:a,sessionId:s}){if(Ve(e))throw new Error("Typebot ID is required to get initial messages");const l=kt()??void 0,c=l?JSON.parse(l):void 0;if(c){_t();try{return{data:{...await Wt.post(`${We(n)?n:xt()}/api/v1/sessions/${c.sessionId}/continueChat`,{json:{message:c?"failed"===i?"fail":"Success":void 0},timeout:!1}).json(),...c}}}catch(e){return{error:e}}}const d="string"==typeof e?e:e.id;if(t)try{return{data:await Wt.post(`${We(n)?n:xt()}/api/v1/bots/${d}/preview/startChat`,{json:{isStreamEnabled:!0,startFrom:a,typebot:e,prefilledVariables:o,sessionId:s},timeout:!1}).json()}}catch(e){return{error:e}}try{const e=parent!==window&&We(document.referrer)?new URL(document.referrer).origin:void 0,t=await Wt.post(`${We(n)?n:xt()}/api/v1/bots/${d}/startChat`,{headers:{"x-typebot-iframe-referrer-origin":e},json:{isStreamEnabled:!0,prefilledVariables:o,resultId:r,isOnlyRegistering:!1},timeout:!1}),i=t.headers.get("access-control-allow-origin");if(e&&i&&"*"!==i&&!e.includes(i))throw new qt(i);return{data:await t.json()}}catch(e){return{error:e}}}({stripeRedirectStatus:t.get("redirect_status")??void 0,typebot:e.typebot,apiHost:e.apiHost,isPreview:s,resultId:We(e.resultId)?e.resultId:c,prefilledVariables:{...o,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(u instanceof Tt)return s?l(new Error("An error occurred while loading the bot.",{cause:{status:u.response.status,body:await u.response.json()}})):400===u.response.status||403===u.response.status?l(new Error("This bot is now closed.")):404===u.response.status?l(new Error("The bot you're looking for doesn't exist.")):l(new Error(`Error! Couldn't initiate the chat. (${u.response.statusText})`));if(u instanceof qt)return l(new Error(u.message));if(!d)return u&&(console.error(u),s)?l(new Error("Error! Could not reach server. Check your connection.",{cause:u})):l(new Error("Error! Could not reach server. Check your connection."));if(d.resultId&&i&&(d.typebot.settings.general?.rememberUser?.isEnabled??qn.rememberUser.isEnabled)){c&&c!==d.resultId&&Zm(d.typebot.id);const t=d.typebot.settings.general?.rememberUser?.storage??qn.rememberUser.storage;((e="session")=>(t,n)=>{try{Xm(e).setItem(`${Gm}-${t}`,n)}catch{}})(t)(i,d.resultId);const o=(e=>{if(e)try{const t=sessionStorage.getItem(`typebot-${e}-initialChatReply`)??localStorage.getItem(`typebot-${e}-initialChatReply`);if(!t)return;return JSON.parse(t)}catch{}})(d.typebot.id);o&&o.typebot.publishedAt&&d.typebot.publishedAt?new Date(o.typebot.publishedAt).getTime()===new Date(d.typebot.publishedAt).getTime()?n(o):(Zm(d.typebot.id),n(d),Wm(d,{typebotId:d.typebot.id,storage:t})):(n(d),Wm(d,{typebotId:d.typebot.id,storage:t})),e.onChatStatePersisted?.(!0)}else Zm(d.typebot.id),n(d),d.input?.id&&e.onNewInputBlock&&e.onNewInputBlock(d.input),d.logs&&e.onNewLogs?.(d.logs),e.onChatStatePersisted?.(!1);r(d.typebot.theme.customCss??"")};return S((()=>{Ve(e.typebot)||i()||c().then()})),S((()=>{Ve(e.typebot)||"string"==typeof e.typebot||(r(e.typebot.theme.customCss??""),e.typebot.theme.general?.progressBar?.isEnabled&&t()&&!t()?.typebot.theme.general?.progressBar?.isEnabled&&(a(!1),c().then()))})),I((()=>{a(!1)})),[(()=>{const e=vb();return Se(e,o),e})(),(()=>{const e=vb();return Se(e,"#lite-badge{background-color:#fff!important;border-radius:4px!important;border-width:1px!important;bottom:20px!important;color:#111827!important;display:flex!important;font-size:14px!important;font-weight:600!important;gap:8px!important;left:auto!important;line-height:20px!important;opacity:1!important;padding:4px 8px!important;position:absolute!important;right:auto!important;text-decoration:none!important;top:auto!important;transition:background-color .2s ease-in-out!important;visibility:visible!important;z-index:50!important}#lite-badge:hover{background-color:#f7f8ff!important}"),e})(),Z(le,{get when(){return s()},keyed:!0,children:e=>Z(Vm,{error:e})}),Z(le,{get when(){return t()},keyed:!0,children:t=>Z(kb,{get class(){return e.class},get initialChatReply(){return{...t,typebot:{...t.typebot,settings:"string"==typeof e.typebot?t.typebot?.settings:e.typebot?.settings,theme:"string"==typeof e.typebot?t.typebot?.theme:e.typebot?.theme}}},get context(){return{apiHost:e.apiHost,isPreview:"string"!=typeof e.typebot||(e.isPreview??!1),resultId:t.resultId,sessionId:t.sessionId,typebot:t.typebot,storage:t.typebot.settings.general?.rememberUser?.isEnabled&&"string"==typeof e.typebot&&!e.isPreview?t.typebot.settings.general?.rememberUser?.storage??qn.rememberUser.storage:void 0}},get progressBarRef(){return e.progressBarRef},get onNewInputBlock(){return e.onNewInputBlock},get onNewLogs(){return e.onNewLogs},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd}})})]},kb=e=>{const[t,n]=rh(_(e.initialChatReply.progress),{storage:e.context.storage,key:`typebot-${e.context.typebot.id}-progressValue`});let o;const r=new ResizeObserver((e=>Yt(e[0].target.clientWidth<400)));return P((()=>{o&&(yb(o),r.observe(o),Tn(`${o.clientHeight}px`))})),S((()=>{hb(e.initialChatReply.typebot.theme.general?.font??{type:"Google",family:Fd}),o&&((e,t,n)=>{if(!e)return;const o=t?.style;o&&(eb(e.general,o,n),nb(e.chat,e.general?.background,o))})(e.initialChatReply.typebot.theme,o,e.context.isPreview)})),I((()=>{o&&r.unobserve(o)})),(()=>{const r=wb();return"function"==typeof o?Te(o,r):o=r,Se(r,Z(le,{get when(){return He(t())&&e.initialChatReply.typebot.theme.general?.progressBar?.isEnabled},get children(){return Z(le,{get when(){return e.progressBarRef&&"fixed"===(e.initialChatReply.typebot.theme.general?.progressBar?.position??Hd)},get fallback(){return Z(mb,{get value(){return t()}})},get children(){return Z(Ne,{get mount(){return e.progressBarRef},get children(){return Z(mb,{get value(){return t()}})}})}})}}),null),Se(r,Z(Fm,{get context(){return e.context},get initialChatReply(){return e.initialChatReply},get onNewInputBlock(){return e.onNewInputBlock},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onNewLogs(){return e.onNewLogs},onProgressUpdate:n}),null),Se(r,Z(le,{get when(){return e.initialChatReply.typebot.settings.general?.isBrandingEnabled},get children(){return Z(vt,{botContainer:o})}}),null),Se(r,Z(qc,{toaster:Ld,children:e=>Z(Yc.Root,{get children(){return[Z(Yc.Title,{get children(){return e().title}}),Z(Yc.Description,{get children(){return e().description}}),Z(Yc.CloseTrigger,{class:"absolute right-2 top-2",get children(){return Z(Zc,{class:"w-4 h-4"})}})]}})}),null),T((()=>ke(r,Ze("relative flex w-full h-full text-base overflow-hidden flex-col justify-center items-center typebot-container",e.class)))),r})()},_b=ve("<style>"),Tb=ve("<div>"),Sb=ve('<div part="bot">'),Eb=e=>{const[t,n]=oe(e,["onOpen","onClose","previewMessage","onPreviewMessageClick","theme","autoShowDelay"]),[o,r]=_(!0),[i,a]=_(n.prefilledVariables),[s,l]=_(!1),[c,d]=_({message:t.previewMessage?.message??"",avatarUrl:t.previewMessage?.avatarUrl}),[u,p]=_(!1),[g,h]=_(!1),[f,m]=_(Cb(t.theme?.button?.size??"medium"));let b;S((()=>{m(Cb(t.theme?.button?.size??"medium"))})),P((()=>{window.addEventListener("message",y);const e=t.autoShowDelay,n=t.previewMessage?.autoShowDelay;(Ym()||kt())&&v(),He(e)&&setTimeout((()=>{v()}),e),He(n)&&setTimeout((()=>{E()}),n)})),I((()=>{window.removeEventListener("message",y)})),S((()=>{e.prefilledVariables&&a((t=>({...t,...e.prefilledVariables})))}));const y=e=>{const{data:t}=e;t.isFromTypebot&&("open"===t.command&&v(),"close"===t.command&&w(),"toggle"===t.command&&x(),"showPreviewMessage"===t.command&&E(t.message),"hidePreviewMessage"===t.command&&C(),"setPrefilledVariables"===t.command&&a((e=>({...e,...t.variables}))),"unmount"===t.command&&O())},v=()=>{g()||h(!0),C(),p(!0),u()&&t.onOpen?.()},w=()=>{p(!1),Km(),u()&&t.onClose?.()},x=()=>{u()?w():v()},k=()=>{t.onPreviewMessageClick?.(),v()},E=e=>{e&&d(e),u()||l(!0)},C=()=>{l(!1)},O=()=>{u()?(w(),setTimeout((()=>{r(!1)}),200)):r(!1)},A=e=>{n.onChatStatePersisted?.(e),e&&qm()};return Z(le,{get when(){return o()},get children(){return Z(dc,{get value(){return document.querySelector("typebot-bubble")?.shadowRoot},get children(){return[(()=>{const e=_b();return Se(e,je),e})(),Z(le,{get when(){return s()},get children(){return Z(ht,ne(c,{get placement(){return t.theme?.placement},get previewMessageTheme(){return t.theme?.previewMessage},get buttonSize(){return f()},onClick:k,onCloseClick:C}))}}),Z(lt,ne((()=>t.theme?.button),{get placement(){return t.theme?.placement},toggleBot:x,get isBotOpened(){return u()},get buttonSize(){return f()}})),(()=>{const e=Tb();return"function"==typeof b?Te(b,e):b=e,e})(),(()=>{const o=Sb();return o.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),o.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),o.style.setProperty("z-index","42424242"),Se(o,Z(le,{get when(){return g()},get children(){return Z(xb,ne(n,{onChatStatePersisted:A,get prefilledVariables(){return i()},class:"rounded-lg",progressBarRef:b}))}})),T((n=>{const r=`calc(100% - ${f()} - 32px)`,i=e.theme?.chatWindow?.maxHeight??"704px",a=e.theme?.chatWindow?.maxWidth??"400px",s="left"===e.theme?.placement?"bottom left":"bottom right",l=u()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",c=t.theme?.chatWindow?.backgroundColor,d=`calc(${f()} + 32px)`,p="fixed rounded-lg w-full"+(u()?" opacity-1":" opacity-0 pointer-events-none")+("left"===e.theme?.placement?" left-5":" sm:right-5 right-0");return r!==n._v$&&(null!=(n._v$=r)?o.style.setProperty("height",r):o.style.removeProperty("height")),i!==n._v$2&&(null!=(n._v$2=i)?o.style.setProperty("max-height",i):o.style.removeProperty("max-height")),a!==n._v$3&&(null!=(n._v$3=a)?o.style.setProperty("max-width",a):o.style.removeProperty("max-width")),s!==n._v$4&&(null!=(n._v$4=s)?o.style.setProperty("transform-origin",s):o.style.removeProperty("transform-origin")),l!==n._v$5&&(null!=(n._v$5=l)?o.style.setProperty("transform",l):o.style.removeProperty("transform")),c!==n._v$6&&(null!=(n._v$6=c)?o.style.setProperty("background-color",c):o.style.removeProperty("background-color")),d!==n._v$7&&(null!=(n._v$7=d)?o.style.setProperty("bottom",d):o.style.removeProperty("bottom")),p!==n._v$8&&ke(o,n._v$8=p),n}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0}),o})()]}})}})},Cb=e=>"medium"===e?"48px":"large"===e?"64px":e||"48px",Pb=ve("<style>"),Ib=ve('<div class="relative" aria-labelledby="modal-title" role="dialog" aria-modal="true"><style></style><div class="fixed inset-0 bg-black bg-opacity-50 transition-opacity animate-fade-in" part="overlay"></div><div class="fixed inset-0 z-10 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div>'),Ob=e=>{const[t,n]=oe(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[o,r]=_(n.prefilledVariables),[i,a]=_(t.isOpen??!1);P((()=>{(t.defaultOpen||kt()||Ym())&&c(),window.addEventListener("message",l);const e=t.autoShowDelay;He(e)&&setTimeout((()=>{c()}),e)})),I((()=>{window.removeEventListener("message",l)})),S((()=>{Ve(e.isOpen)||e.isOpen===i()||u()})),S((()=>{e.prefilledVariables&&r((t=>({...t,...e.prefilledVariables})))}));const s=e=>{e.stopPropagation()},l=e=>{const{data:t}=e;t.isFromTypebot&&("open"===t.command&&c(),"close"===t.command&&d(),"toggle"===t.command&&u(),"setPrefilledVariables"===t.command&&r((e=>({...e,...t.variables}))))},c=()=>{a(!0),t.onOpen?.(),document.body.style.setProperty("overflow","hidden","important"),document.addEventListener("pointerdown",d)},d=()=>{a(!1),t.onClose?.(),document.body.style.overflow="auto",document.removeEventListener("pointerdown",d),Km()},u=()=>i()?d():c(),p=e=>{n.onChatStatePersisted?.(e),e&&qm()};return Z(le,{get when(){return i()},get children(){return Z(dc,{get value(){return document.querySelector("typebot-popup")?.shadowRoot},get children(){return[(()=>{const e=Pb();return Se(e,je),e})(),(()=>{const t=Ib(),r=t.firstChild,i=r.nextSibling.nextSibling.firstChild.firstChild;return Se(r,je),i.addEventListener("pointerdown",s),Se(i,Z(xb,ne(n,{get prefilledVariables(){return o()},onChatStatePersisted:p}))),T((n=>{const o=e.theme?.zIndex??42424242,r="relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg"+(e.theme?.backgroundColor?" shadow-xl":""),a=e.theme?.backgroundColor??"transparent",s=e.theme?.width??"512px";return o!==n._v$&&(null!=(n._v$=o)?t.style.setProperty("z-index",o):t.style.removeProperty("z-index")),r!==n._v$2&&ke(i,n._v$2=r),a!==n._v$3&&(null!=(n._v$3=a)?i.style.setProperty("background-color",a):i.style.removeProperty("background-color")),s!==n._v$4&&(null!=(n._v$4=s)?i.style.setProperty("max-width",s):i.style.removeProperty("max-width")),n}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t})()]}})}})},Ab=ve("<style>\n:host {\n display: block;\n width: 100%;\n height: 100%;\n overflow-y: hidden;\n}\n"),$b=(e,{element:t})=>{const[n,o]=_(!1),r=new IntersectionObserver((e=>{e.some((e=>e.isIntersecting))&&o(!0)}));P((()=>{window.addEventListener("message",i),r.observe(t)}));const i=e=>{const{data:t}=e;t.isFromTypebot};return I((()=>{r.disconnect()})),Z(dc,{get value(){return document.querySelector("typebot-standard")?.shadowRoot},get children(){return[(()=>{const e=Ab(),t=e.firstChild;return Se(e,je,t),e})(),Z(le,{get when(){return n()},get children(){return Z(xb,e)}})]}})},Rb=()=>{window.postMessage({isFromTypebot:!0,command:"close"})},Nb=()=>{window.postMessage({isFromTypebot:!0,command:"hidePreviewMessage"})},Lb=()=>{window.postMessage({isFromTypebot:!0,command:"open"})},Db=e=>{const t={isFromTypebot:!0,command:"setPrefilledVariables",variables:e};window.postMessage(t)},Mb=e=>{const t={isFromTypebot:!0,command:"showPreviewMessage",message:e};window.postMessage(t)},Ub=()=>{window.postMessage({isFromTypebot:!0,command:"toggle"})},Bb=e=>{const t={isFromTypebot:!0,command:"setInputValue",value:e};window.postMessage(t)},Fb=()=>{window.postMessage({isFromTypebot:!0,command:"unmount"})},jb=e=>{const t=e.id?document.getElementById(e.id):document.querySelector("typebot-standard");if(!t)throw new Error("<typebot-standard> element not found.");Object.assign(t,e)},zb=e=>{const t=document.createElement("typebot-popup");Object.assign(t,e),document.body.prepend(t)},Hb=e=>{const t=document.createElement("typebot-bubble");Object.assign(t,e),document.body.prepend(t)};"undefined"!=typeof window&&(Me("typebot-standard",Ue,$b),Me("typebot-bubble",Fe,Eb),Me("typebot-popup",Be,Ob));const Vb={initStandard:jb,initPopup:zb,initBubble:Hb,close:Rb,hidePreviewMessage:Nb,open:Lb,setPrefilledVariables:Db,showPreviewMessage:Mb,toggle:Ub,setInputValue:Bb,unmount:Fb};(e=>{"undefined"!=typeof window&&(window.Typebot={...e})})(Vb);export{Vb as default};
37
+ function a$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a$(Object(n),!0).forEach(function(t){l$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l$(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}r$()(["closeOnSelect","dir","disabled","fixedWeeks","focusedValue","format","getRootNode","id","ids","isDateUnavailable","isDateUnavailable","locale","max","min","modal","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","open","open.controlled","positioning","readOnly","selectionMode","startOfWeek","timeZone","translations","value","view"]),r$()(["index"]),r$()(["value"]),r$()(["columns","id","view"]),r$()(["disabled","value","columns"]),r$()(["view"]),o$.extendWith("view");var u$=function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)},c$=function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()},d$=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},p$=function(e){return d$(e)&&!e.shiftKey},f$=function(e){return d$(e)&&e.shiftKey},h$=function(e){return setTimeout(e,0)},g$=function(e,t){var n=-1;return e.every(function(e,r){return!t(e)||(n=r,!1)}),n},m$=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},v$=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},y$=[],b$=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||y$,i=s$({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:p$,isKeyBackward:f$},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},l=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,o=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||o.find(function(t){return t===e})})},u=function(e){var t=i[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];t=t.apply(void 0,o)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=t;if("string"==typeof t&&!(s=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},c=function(){var e=u("initialFocus");if(!1===e)return!1;if(void 0===e||!gF(e,i.tabbableOptions))if(l(r.activeElement)>=0)e=r.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||u("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(a.containerGroups=a.containers.map(function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?tF([e],t.includeContainer,{filter:cF.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dF}):eF(e,t.includeContainer,cF.bind(null,t)),pF(n)}(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?tF([e],t.includeContainer,{filter:uF.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):eF(e,t.includeContainer,uF.bind(null,t))}(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,a=n.find(function(e){return fF(e)}),s=n.slice().reverse().find(function(e){return fF(e)}),l=!!t.find(function(e){return rF(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:l,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(e);return o<0?r?n.slice(n.indexOf(e)+1).find(function(e){return fF(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return fF(e)}):t[o+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function e(t){var n=t.activeElement;if(n)return n.shadowRoot&&null!==n.shadowRoot.activeElement?e(n.shadowRoot):n},f=function e(t){!1!==t&&t!==p(document)&&(t&&t.focus?(t.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(c()))},h=function(e){var t=u("setReturnFocus",e);return t||!1!==t&&e},g=function(e){var t=e.target,n=e.event,r=e.isBackward,o=void 0!==r&&r;t=t||v$(n),d();var s=null;if(a.tabbableGroups.length>0){var c=l(t,n),p=c>=0?a.containerGroups[c]:void 0;if(c<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var f=g$(a.tabbableGroups,function(e){var n=e.firstTabbableNode;return t===n});if(f<0&&(p.container===t||gF(t,i.tabbableOptions)&&!fF(t,i.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(f=c),f>=0){var h=0===f?a.tabbableGroups.length-1:f-1,g=a.tabbableGroups[h];s=rF(t)>=0?g.lastTabbableNode:g.lastDomTabbableNode}else d$(n)||(s=p.nextTabbableNode(t,!1))}else{var m=g$(a.tabbableGroups,function(e){var n=e.lastTabbableNode;return t===n});if(m<0&&(p.container===t||gF(t,i.tabbableOptions)&&!fF(t,i.tabbableOptions)&&!p.nextTabbableNode(t))&&(m=c),m>=0){var v=m===a.tabbableGroups.length-1?0:m+1,y=a.tabbableGroups[v];s=rF(t)>=0?y.firstTabbableNode:y.firstDomTabbableNode}else d$(n)||(s=p.nextTabbableNode(t))}}else s=u("fallbackFocus");return s},m=function(e){var t=v$(e);l(t,e)>=0||(m$(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):m$(i.allowOutsideClick,e)||e.preventDefault())},v=function(e){var t=v$(e),n=l(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var o=!0;if(a.mostRecentlyFocusedNode)if(rF(a.mostRecentlyFocusedNode)>0){var s=l(a.mostRecentlyFocusedNode),u=a.containerGroups[s].tabbableNodes;if(u.length>0){var d=u.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<u.length&&(r=u[d+1],o=!1):d-1>=0&&(r=u[d-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return rF(e)>0})})||(o=!1);else o=!1;o&&(r=g({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),f(r||(a.mostRecentlyFocusedNode||c()))}a.recentNavEvent=void 0},y=function(e){if(function(e){return"Escape"===(null==e?void 0:e.key)||"Esc"===(null==e?void 0:e.key)||27===(null==e?void 0:e.keyCode)}(e)&&!1!==m$(i.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(i.isKeyForward(e)||i.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=g({event:e,isBackward:t});n&&(d$(e)&&e.preventDefault(),f(n))}(e,i.isKeyBackward(e))},b=function(e){var t=v$(e);l(t,e)>=0||m$(i.clickOutsideDeactivates,e)||m$(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(a.active)return u$(o,n),a.delayInitialFocusTimer=i.delayInitialFocus?h$(function(){f(c())}):f(c()),r.addEventListener("focusin",v,!0),r.addEventListener("mousedown",m,{capture:!0,passive:!1}),r.addEventListener("touchstart",m,{capture:!0,passive:!1}),r.addEventListener("click",b,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),n},E=function(){if(a.active)return r.removeEventListener("focusin",v,!0),r.removeEventListener("mousedown",m,!0),r.removeEventListener("touchstart",m,!0),r.removeEventListener("click",b,!0),r.removeEventListener("keydown",y,!0),n},_="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver(function(e){var t=e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===a.mostRecentlyFocusedNode})});t&&f(c())}):void 0,x=function(){_&&(_.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){_.observe(e,{subtree:!0,childList:!0})}))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var i=function(){o&&d(),w(),x(),null==n||n()};return o?(o(a.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!a.active)return this;var t=s$({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,E(),a.active=!1,a.paused=!1,x(),c$(o,n);var r=s(t,"onDeactivate"),l=s(t,"onPostDeactivate"),u=s(t,"checkCanReturnFocus"),c=s(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){h$(function(){c&&f(h(a.nodeFocusedBeforeActivation)),null==l||l()})};return c&&u?(u(h(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(a.paused||!a.active)return this;var t=s(e,"onPause"),n=s(e,"onPostPause");return a.paused=!0,null==t||t(),E(),x(),null==n||n(),this},unpause:function(e){if(!a.paused||!a.active)return this;var t=s(e,"onUnpause"),n=s(e,"onPostUnpause");return a.paused=!1,null==t||t(),d(),w(),x(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map(function(e){return"string"==typeof e?r.querySelector(e):e}),a.active&&d(),x(),this}},n.updateContainerElements(e),n};Uj("field").parts("root","errorText","helperText","input","label","select","textarea"),Uj("fieldset").parts("root","errorText","helperText","legend");function w$(e){return(e=>e.nodeType===Node.DOCUMENT_NODE)(e)?e:(e=>null!=e&&e===e.window)(e)?e.document:e?.ownerDocument??document}var E$=()=>e=>Array.from(new Set(e)),_$=Uj("radio-group").parts("root","label","item","itemText","itemControl","indicator");_$.build();var x$=function(e){const t={getRootNode:e=>e.getRootNode?.()??document,getDoc:e=>w$(t.getRootNode(e)),getWin:e=>t.getDoc(e).defaultView??window,getActiveElement:e=>t.getRootNode(e).activeElement,isActiveElement:(e,n)=>n===t.getActiveElement(e),getById:(e,n)=>t.getRootNode(e).getElementById(n),setValue:(e,t)=>{if(null==e||null==t)return;const n=t.toString();e.value!==n&&(e.value=t.toString())}};return{...t,...e}}({getRootId:e=>e.ids?.root??`radio-group:${e.id}`,getLabelId:e=>e.ids?.label??`radio-group:${e.id}:label`,getItemId:(e,t)=>e.ids?.item?.(t)??`radio-group:${e.id}:radio:${t}`,getItemHiddenInputId:(e,t)=>e.ids?.itemHiddenInput?.(t)??`radio-group:${e.id}:radio:input:${t}`,getItemControlId:(e,t)=>e.ids?.itemControl?.(t)??`radio-group:${e.id}:radio:control:${t}`,getItemLabelId:(e,t)=>e.ids?.itemLabel?.(t)??`radio-group:${e.id}:radio:label:${t}`,getIndicatorId:e=>e.ids?.indicator??`radio-group:${e.id}:indicator`,getRootEl:e=>x$.getById(e,x$.getRootId(e)),getItemHiddenInputEl:(e,t)=>x$.getById(e,x$.getItemHiddenInputId(e,t)),getIndicatorEl:e=>x$.getById(e,x$.getIndicatorId(e)),getFirstEnabledInputEl:e=>x$.getRootEl(e)?.querySelector("input:not(:disabled)"),getFirstEnabledAndCheckedInputEl:e=>x$.getRootEl(e)?.querySelector("input:not(:disabled):checked"),getInputEls:e=>{const t=`input[type=radio][data-ownedby='${CSS.escape(x$.getRootId(e))}']:not([disabled])`;return function(e,t){return Array.from(e?.querySelectorAll(t)??[])}(x$.getRootEl(e),t)},getActiveRadioEl:e=>{if(e.value)return x$.getById(e,x$.getItemId(e,e.value))},getOffsetRect:e=>({left:e?.offsetLeft??0,top:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),getRectById:(e,t)=>{const n=x$.getById(e,x$.getItemId(e,t));if(n)return x$.resolveRect(x$.getOffsetRect(n))},resolveRect:e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`})});function k$(e){const t=HB(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=DB(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=ZR(n)!==i||ZR(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function C$(e){return TB(e)?e:e.contextElement}function S$(e){const t=C$(e);if(!DB(t))return QR(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=k$(t);let a=(i?ZR(n.width):n.width)/r,s=(i?ZR(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}E$()(["dir","disabled","form","getRootNode","id","ids","name","onValueChange","orientation","readOnly","value"]),E$()(["value","disabled","invalid"]),_$.rename("segment-group");const T$=QR(0);function D$(e){const t=kB(e);return jB()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:T$}function A$(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=C$(e);let a=QR(1);t&&(r?TB(r)&&(a=S$(r)):a=S$(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==kB(e))&&t}(i,n,r)?D$(i):QR(0);let l=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=kB(i),t=r&&TB(r)?kB(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=S$(o),t=o.getBoundingClientRect(),r=HB(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,d*=e.y,l+=i,u+=a,n=kB(o),o=n.frameElement}}return yB({width:c,height:d,x:l,y:u})}const O$=[":popover-open",":modal"];function P$(e){return O$.some(t=>{try{return e.matches(t)}catch(e){return!1}})}function I$(e){return A$(CB(e)).left+VB(e).scrollLeft}function N$(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=kB(e),r=CB(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=jB();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=CB(e),n=VB(e),r=e.ownerDocument.body,o=YR(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=YR(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+I$(e);const s=-n.scrollTop;return"rtl"===HB(r).direction&&(a+=YR(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(CB(e));else if(TB(t))r=function(e,t){const n=A$(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=DB(e)?S$(e):QR(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=D$(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return yB(r)}function R$(e,t){const n=WB(e);return!(n===t||!TB(n)||zB(n))&&("fixed"===HB(n).position||R$(n,t))}function B$(e,t,n){const r=DB(t),o=CB(t),i="fixed"===n,a=A$(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=QR(0);if(r||!r&&!i)if(("body"!==xB(t)||PB(o))&&(s=VB(t)),r){const e=A$(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=I$(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function F$(e){return"static"===HB(e).position}function L$(e,t){return DB(e)&&"fixed"!==HB(e).position?t?t(e):e.offsetParent:null}function M$(e,t){const n=kB(e);if(P$(e))return n;if(!DB(e)){let t=WB(e);for(;t&&!zB(t);){if(TB(t)&&!F$(t))return t;t=WB(t)}return n}let r=L$(e,t);for(;r&&NB(r)&&F$(r);)r=L$(r,t);return r&&zB(r)&&F$(r)&&!UB(r)?n:r||function(e){let t=WB(e);for(;DB(t)&&!zB(t);){if(UB(t))return t;if(BB(t))return null;t=WB(t)}return null}(e)||n}const U$={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=CB(r),s=!!t&&P$(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=QR(1);const c=QR(0),d=DB(r);if((d||!d&&!i)&&(("body"!==xB(r)||PB(a))&&(l=VB(r)),DB(r))){const e=A$(r);u=S$(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}},getDocumentElement:CB,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?P$(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=GB(e,[],!1).filter(e=>TB(e)&&"body"!==xB(e)),o=null;const i="fixed"===HB(e).position;let a=i?WB(e):e;for(;TB(a)&&!zB(a);){const t=HB(a),n=UB(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||PB(a)&&!n&&R$(e,a))?r=r.filter(e=>e!==a):o=t,a=WB(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce((e,n)=>{const r=N$(t,n,o);return e.top=YR(r.top,e.top),e.right=KR(r.right,e.right),e.bottom=KR(r.bottom,e.bottom),e.left=YR(r.left,e.left),e},N$(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:M$,getElementRects:async function(e){const t=this.getOffsetParent||M$,n=this.getDimensions,r=await n(e.floating);return{reference:B$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=k$(e);return{width:t,height:n}},getScale:S$,isElement:TB,isRTL:function(e){return"rtl"===HB(e).direction}};function j$(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=C$(e),c=o||i?[...u?GB(u):[],...GB(t)]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=u&&s?function(e,t){let n,r=null;const o=CB(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:u,top:c,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const f={rootMargin:-XR(c)+"px "+-XR(o.clientWidth-(u+d))+"px "+-XR(o.clientHeight-(c+p))+"px "+-XR(u)+"px",threshold:YR(0,KR(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return a();t?a(!1,t):n=setTimeout(()=>{a(!1,1e-7)},1e3)}h=!1}try{r=new IntersectionObserver(g,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),i}(u,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g=l?A$(e):null;return l&&function t(){const r=A$(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const $$=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=rB(n),s=oB(n),l="y"===lB(n),u=EB.has(a)?-1:1,c=i&&l?-1:1,d=nB(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*c,y:p*u}:{x:p*u,y:f*c}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},z$=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=nB(e,t),c={x:n,y:r},d=await i.detectOverflow(t,u),p=lB(rB(o)),f=iB(p);let h=c[f],g=c[p];if(a){const e="y"===f?"bottom":"right";h=tB(h+d["y"===f?"top":"left"],h,h-d[e])}if(s){const e="y"===p?"bottom":"right";g=tB(g+d["y"===p?"top":"left"],g,g-d[e])}const m=l.fn({...t,[f]:h,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:a,[p]:s}}}}}},H$=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=nB(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=rB(o),y=lB(s),b=rB(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(u.floating)),E=p||(b||!g?[mB(s)]:function(e){const t=mB(e);return[cB(e),t,cB(t)]}(s)),_="none"!==h;!p&&_&&E.push(...gB(s,g,h,w));const x=[s,...E],k=await l.detectOverflow(t,m),C=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&C.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=oB(e),o=uB(e),i=aB(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=mB(a)),[a,mB(a)]}(o,a,w);C.push(k[e[0]],k[e[1]])}if(S=[...S,{placement:o,overflows:C}],!C.every(e=>e<=0)){var T,D;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=x[e];if(t){if(!("alignment"===d&&y!==lB(t))||S.every(e=>lB(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:S},reset:{placement:t}}}let n=null==(D=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:D.placement;if(!n)switch(f){case"bestFit":{var A;const e=null==(A=S.filter(e=>{if(_){const t=lB(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:A[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},V$=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...u}=nB(e,t),c=await a.detectOverflow(t,u),d=rB(o),p=oB(o),f="y"===lB(o),{width:h,height:g}=i.floating;let m,v;"top"===d||"bottom"===d?(m=d,v=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,m="end"===p?"top":"bottom");const y=g-c.top-c.bottom,b=h-c.left-c.right,w=KR(g-c[m],y),E=KR(h-c[v],b),_=!t.middlewareData.shift;let x=w,k=E;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=y),_&&!p){const e=YR(c.left,0),t=YR(c.right,0),n=YR(c.top,0),r=YR(c.bottom,0);f?k=h-2*(0!==e||0!==t?e+t:YR(c.left,c.right)):x=g-2*(0!==n||0!==r?n+r:YR(c.top,c.bottom))}await l({...t,availableWidth:k,availableHeight:x});const C=await a.getDimensions(s.floating);return h!==C.width||g!==C.height?{reset:{rects:!0}}:{}}}},W$=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=nB(e,t)||{};if(null==u)return{};const d=vB(c),p={x:n,y:r},f=uB(o),h=aB(f),g=await a.getDimensions(u),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[f]-p[f]-i.floating[h],E=p[f]-i.reference[f],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let x=_?_[b]:0;x&&await(null==a.isElement?void 0:a.isElement(_))||(x=s.floating[b]||i.floating[h]);const k=w/2-E/2,C=x/2-g[h]/2-1,S=KR(d[v],C),T=KR(d[y],C),D=S,A=x-g[h]-T,O=x/2-g[h]/2+k,P=tB(D,O,A),I=!l.arrow&&null!=oB(o)&&O!==P&&i.reference[h]/2-(O<D?S:T)-g[h]/2<0,N=I?O<D?O-D:O-A:0;return{[f]:p[f]+N,data:{[f]:P,centerOffset:O-P-N,...I&&{alignmentOffset:N}},reset:I}}}),q$=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=nB(e,t),c={x:n,y:r},d=lB(o),p=iB(d);let f=c[p],h=c[d];const g=nB(s,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+m.mainAxis,n=i.reference[p]+i.reference[e]-m.mainAxis;f<t?f=t:f>n&&(f=n)}if(u){var v,y;const e="y"===p?"width":"height",t=EB.has(rB(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},G$=(e,t,n)=>{const r=new Map,o={platform:U$,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=bB(u,r,l),p=r,f={},h=0;for(let n=0;n<s.length;n++){var g;const{name:i,fn:m}=s[n],{x:v,y:y,data:b,reset:w}=await m({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:u,platform:{...a,detectOverflow:null!=(g=a.detectOverflow)?g:wB},elements:{reference:e,floating:t}});c=null!=v?v:c,d=null!=y?y:d,f={...f,[i]:{...f[i],...b}},w&&h<=50&&(h++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(u=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:c,y:d}=bB(u,p,l))),n=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};function K$(e=0,t=0,n=0,r=0){if("function"==typeof DOMRect)return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function Y$(e,t){return{contextElement:UU(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?function(e){if(!e)return K$();const{x:t,y:n,width:r,height:o}=e;return K$(t,n,r,o)}(r):n.getBoundingClientRect()}}}var Z$=e=>({variable:e,reference:`var(${e})`}),X$={arrowSize:Z$("--arrow-size"),arrowSizeHalf:Z$("--arrow-size-half"),arrowBg:Z$("--arrow-background"),transformOrigin:Z$("--transform-origin"),arrowOffset:Z$("--arrow-offset")},Q$={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){const{arrow:r}=n,o=(e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}))(r)[e],{floating:i}=t;return i.style.setProperty(X$.transformOrigin.variable,o),{data:{transformOrigin:o}}}},J$={name:"rects",fn:({rects:e})=>({data:e})},ez=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:null!=r?`${r}px`:"",top:null!=o?`${o}px`:"",[i]:`calc(100% + ${X$.arrowOffset.reference})`}),{}}}};var tz={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function nz(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function rz(e){return Ej(e.boundary)}function oz(e,t){if(e)return W$({element:e,padding:t.arrowPadding})}function iz(e,t){if(null!=(t.offset??t.gutter))return $$(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i="number"==typeof o?o+r:o??r,{hasAlign:a}=function(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:null!=n}}(n),s=a?void 0:t.shift;return Tj({crossAxis:t.offset?.crossAxis??s,mainAxis:i,alignmentAxis:t.shift})})}function az(e){if(e.flip)return H$({boundary:rz(e),padding:e.overflowPadding,fallbackPlacements:!0===e.flip?void 0:e.flip})}function sz(e){if(e.slide||e.overlap)return z$({boundary:rz(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:q$()})}function lz(e){return V$({padding:e.overflowPadding,apply({elements:e,rects:t,availableHeight:n,availableWidth:r}){const o=e.floating,i=Math.round(t.reference.width);r=Math.floor(r),n=Math.floor(n),o.style.setProperty("--reference-width",`${i}px`),o.style.setProperty("--available-width",`${r}px`),o.style.setProperty("--available-height",`${n}px`)}})}function uz(e,t,n={}){const{defer:r,...o}=n,i=r?cj:e=>e(),a=[];return a.push(i(()=>{const n="function"==typeof e?e():e,r="function"==typeof t?t():t;a.push(function(e,t,n={}){const r=Y$(e,n.getAnchorRect);if(!t||!r)return;const o=Object.assign({},tz,n),i=t.querySelector("[data-part=arrow]"),a=[iz(i,o),az(o),sz(o),oz(i,o),ez(i),Q$,lz(o),J$],{placement:s,strategy:l,onComplete:u,onPositioned:c}=o,d=async()=>{if(!r||!t)return;const e=await G$(r,t,{placement:s,middleware:a,strategy:l});u?.(e),c?.({placed:!0});const n=HU(t),o=nz(n,e.x),i=nz(n,e.y);t.style.setProperty("--x",`${o}px`),t.style.setProperty("--y",`${i}px`);const d=t.firstElementChild;if(d){const e=n.getComputedStyle(d).zIndex;t.style.setProperty("--z-index",e)}},p=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:d}),c?.({placed:!0})):await d()},f=function(e){return e?!0===e?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}(o.listeners),h=o.listeners?j$(r,t,p,f):_j;return p(),()=>{h?.(),c?.({placed:!1})}}(n,r,o))})),()=>{a.forEach(e=>e?.())}}var cz={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};var dz="pointerdown.outside",pz="focus.outside";function fz(e){for(const t of e)if(UU(t)&&rj(t))return!0;return!1}var hz=e=>"clientY"in e;function gz(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:a}=t;if(!e)return;const s=zU(e),l=function(e){const t={each(t){for(let n=0;n<e.frames?.length;n+=1){const r=e.frames[n];r&&t(r)}},addEventListener:(e,n,r)=>(t.each(t=>{try{t.document.addEventListener(e,n,r)}catch{}}),()=>{try{t.removeEventListener(e,n,r)}catch{}}),removeEventListener(e,n,r){t.each(t=>{try{t.document.removeEventListener(e,n,r)}catch{}})}};return t}(HU(e));function u(t){const r=GU(t);return!!UU(r)&&(!$U(e,r)&&(!function(e,t){if(!hz(t)||!e)return!1;const n=e.getBoundingClientRect();return 0!==n.width&&0!==n.height&&n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}(e,t)&&(!function(e){const t=GU(e);if(!t||!hz(e))return!1;const n=t.scrollHeight>t.clientHeight&&e.clientX>t.clientWidth,r=t.scrollWidth>t.clientWidth&&e.clientY>t.clientHeight;return n||r}(t)&&!n?.(r))))}let c;function d(t){function n(){const n=a?cj:e=>e(),r=t.composedPath?.()??[t.target];n(()=>{if(e&&u(t)){if(o||i){const t=xj(o,i);e.addEventListener(dz,t,{once:!0})}Rj(e,dz,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:Ij(t),focusable:fz(r)}})}})}"touch"===t.pointerType?(l.removeEventListener("click",n),s.removeEventListener("click",n),c=n,s.addEventListener("click",n,{once:!0}),l.addEventListener("click",n,{once:!0})):n()}const p=new Set,f=setTimeout(()=>{p.add(l.addEventListener("pointerdown",d,!0)),p.add(Oj(s,"pointerdown",d,!0))},0);function h(t){(a?cj:e=>e())(()=>{if(e&&u(t)){if(r||i){const t=xj(r,i);e.addEventListener(pz,t,{once:!0})}Rj(e,pz,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:!1,focusable:rj(GU(t))}})}})}return p.add(Oj(s,"focusin",h,!0)),p.add(l.addEventListener("focusin",h,!0)),()=>{clearTimeout(f),c&&(l.removeEventListener("click",c),s.removeEventListener("click",c)),p.forEach(e=>e())}}function mz(e,t){const{defer:n}=t,r=n?cj:e=>e(),o=[];return o.push(r(()=>{const n="function"==typeof e?e():e;o.push(gz(n,t))})),()=>{o.forEach(e=>e?.())}}function vz(e,t){return Oj(zU(e),"keydown",e=>{"Escape"===e.key&&(e.isComposing||t?.(e))},{capture:!0})}var yz,bz={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){return this.indexOf(e)<(this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1)},isTopMost(e){const t=this.layers[this.count()-1];return t?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(e=>$U(e.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>$U(t,e))},add(e){const t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(!(t<0)){if(t<this.count()-1){this.getNestedLayers(e).forEach(e=>e.dismiss())}this.layers.splice(t,1),e.style.removeProperty("--layer-index")}},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}};function wz(){bz.layers.forEach(({node:e})=>{e.style.pointerEvents=bz.isBelowPointerBlockingLayer(e)?"none":"auto"})}function Ez(e,t){const n=zU(e),r=[];if(bz.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(yz=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){const e=yj(t,e=>{r.push(mj(e,{pointerEvents:"auto"}))});r.push(e)}return()=>{bz.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=yz,n.body.removeAttribute("data-inert"),0===n.body.style.length&&n.body.removeAttribute("style")}),r.forEach(e=>e()))}}function _z(e,t){const{defer:n}=t,r=n?cj:e=>e(),o=[];return o.push(r(()=>{const n=Sj(e)?e():e;o.push(function(e,t){if(!e)return void Aj("[@zag-js/dismissable] node is `null` or `undefined`");const{onDismiss:n,pointerBlocking:r,exclude:o,debug:i}=t,a={dismiss:n,node:e,pointerBlocking:r};bz.add(a),wz();const s=[r?Ez(e,t.persistentElements):void 0,vz(e,function(r){bz.isTopMost(e)&&(t.onEscapeKeyDown?.(r),!r.defaultPrevented&&n&&(r.preventDefault(),n()))}),mz(e,{exclude:function(n){if(!e)return!1;const r="function"==typeof o?o():o,i=Array.isArray(r)?r:[r],a=t.persistentElements?.map(e=>e()).filter(UU);return a&&i.push(...a),i.some(e=>$U(e,n))||bz.isInNestedLayer(e,n)},onFocusOutside:function(e){const r=GU(e.detail.originalEvent);bz.isInBranch(r)||(t.onFocusOutside?.(e),t.onInteractOutside?.(e),e.defaultPrevented||(i&&console.log("onFocusOutside:",e.detail.originalEvent),n?.()))},onPointerDownOutside:function(r){const o=GU(r.detail.originalEvent);bz.isBelowPointerBlockingLayer(e)||bz.isInBranch(o)||(t.onPointerDownOutside?.(r),t.onInteractOutside?.(r),r.defaultPrevented||(i&&console.log("onPointerDownOutside:",r.detail.originalEvent),n?.()))},defer:t.defer})];return()=>{bz.remove(e),wz(),function(e){e.style.pointerEvents=""}(e),s.forEach(e=>e?.())}}(n,t))})),()=>{o.forEach(e=>e?.())}}function xz(e){return e?.animationName||"none"}EU()(["onExitComplete","present","immediate"]);var kz=new WeakMap,Cz=[];function Sz(e,t={}){const{defer:n}=t,r=n?cj:e=>e(),o=[];return o.push(r(()=>{const n="function"==typeof e?e():e;o.push(function(e,t={}){const{rootEl:n}=t,r=e.filter(Boolean);if(0===r.length)return;const o=r[0].ownerDocument||document,i=o.defaultView??window,a=new Set(r),s=new Set,l=n??o.body;let u=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-zag-top-layer]"))a.add(t);let t=e=>{if(a.has(e)||s.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of a)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=o.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),r=t(e);if(r===NodeFilter.FILTER_ACCEPT&&c(e),r!==NodeFilter.FILTER_REJECT){let e=n.nextNode();for(;null!=e;)c(e),e=n.nextNode()}},c=e=>{let t=kz.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),s.add(e),kz.set(e,t+1))};Cz.length&&Cz[Cz.length-1].disconnect(),u(l);const d=new i.MutationObserver(e=>{for(let t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...a,...s].some(e=>e.contains(t.target))){for(let e of t.removedNodes)e instanceof i.Element&&(a.delete(e),s.delete(e));for(let e of t.addedNodes)!(e instanceof i.HTMLElement||e instanceof i.SVGElement)||"true"!==e.dataset.liveAnnouncer&&"true"!==e.dataset.zagTopLayer?e instanceof i.Element&&u(e):a.add(e)}});d.observe(l,{childList:!0,subtree:!0});let p={observe(){d.observe(l,{childList:!0,subtree:!0})},disconnect(){d.disconnect()}};return Cz.push(p),()=>{d.disconnect();for(let e of s){let t=kz.get(e);1===t?(e.removeAttribute("aria-hidden"),kz.delete(e)):kz.set(e,t-1)}p===Cz[Cz.length-1]?(Cz.pop(),Cz.length&&Cz[Cz.length-1].observe()):Cz.splice(Cz.indexOf(p),1)}}(n,t))})),()=>{o.forEach(e=>e?.())}}var Tz=(e,t=[])=>({parts:(...n)=>{if(Az(t))return Tz(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Tz(e,[...t,...n]),rename:e=>Tz(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${Dz(e)}"][data-part="${Dz(n)}"]`,`& [data-scope="${Dz(e)}"][data-part="${Dz(n)}"]`].join(", "),attrs:{"data-scope":Dz(e),"data-part":Dz(n)}}}),{})}),Dz=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Az=e=>0===e.length,Oz="data-zag-scroll-lock";function Pz(e,t){if(!e)return;const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function Iz(e){const t=e??document,n=t.defaultView??window,{documentElement:r,body:o}=t;if(o.hasAttribute(Oz))return;o.setAttribute(Oz,"");const i=n.innerWidth-r.clientWidth,a=function(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}(r),s=[function(e,t,n){if(!e)return;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{r?e.style.setProperty(t,r):e.style.removeProperty(t)}}(r,"--scrollbar-width",`${i}px`),WU(/iP(hone|ad|od)|iOS/)?(()=>{const{scrollX:e,scrollY:t,visualViewport:r}=n,s=r?.offsetLeft??0,l=r?.offsetTop??0,u=Pz(o,{position:"fixed",overflow:"hidden",top:-(t-Math.floor(l))+"px",left:-(e-Math.floor(s))+"px",right:"0",[a]:`${i}px`});return()=>{u?.(),n.scrollTo({left:e,top:t,behavior:"instant"})}})():Pz(o,{overflow:"hidden",[a]:`${i}px`})];return()=>{s.forEach(e=>e?.()),o.removeAttribute(Oz)}}var Nz=Tz("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger").build(),Rz=fj({getPositionerId:e=>e.ids?.positioner??`dialog:${e.id}:positioner`,getBackdropId:e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,getContentId:e=>e.ids?.content??`dialog:${e.id}:content`,getTriggerId:e=>e.ids?.trigger??`dialog:${e.id}:trigger`,getTitleId:e=>e.ids?.title??`dialog:${e.id}:title`,getDescriptionId:e=>e.ids?.description??`dialog:${e.id}:description`,getCloseTriggerId:e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,getContentEl:e=>Rz.getById(e,Rz.getContentId(e)),getPositionerEl:e=>Rz.getById(e,Rz.getPositionerId(e)),getBackdropEl:e=>Rz.getById(e,Rz.getBackdropId(e)),getTriggerEl:e=>Rz.getById(e,Rz.getTriggerId(e)),getTitleEl:e=>Rz.getById(e,Rz.getTitleId(e)),getDescriptionEl:e=>Rz.getById(e,Rz.getDescriptionId(e)),getCloseTriggerEl:e=>Rz.getById(e,Rz.getCloseTriggerId(e))});function Bz(e){const t=Tj(e);return gU({id:"dialog",initial:t.open?"open":"closed",context:{role:"dialog",renderedElements:{title:!0,description:!0},modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!0,closeOnEscape:!0,restoreFocus:!0,...t},created:["checkInitialFocusEl"],watch:{open:["toggleVisibility"]},states:{open:{entry:["checkRenderedElements","syncZIndex"],activities:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}}},{guards:{isOpenControlled:e=>!!e["open.controlled"]},activities:{trackDismissableElement:(e,t,{send:n})=>_z(()=>Rz.getContentEl(e),{defer:!0,pointerBlocking:e.modal,exclude:[Rz.getTriggerEl(e)],onInteractOutside(t){e.onInteractOutside?.(t),e.closeOnInteractOutside&&"alertdialog"!==e.role||t.preventDefault()},persistentElements:e.persistentElements,onFocusOutside:e.onFocusOutside,onPointerDownOutside:e.onPointerDownOutside,onEscapeKeyDown(t){e.onEscapeKeyDown?.(t),e.closeOnEscape?n({type:"CLOSE",src:"escape-key"}):t.preventDefault()},onDismiss(){n({type:"CLOSE",src:"interact-outside"})}}),preventScroll(e){if(e.preventScroll)return Iz(Rz.getDoc(e))},trapFocus(e){if(!e.trapFocus||!e.modal)return;let t;const n=function(e){const t=new Set;function n(e){const n=globalThis.requestAnimationFrame(e);t.add(()=>globalThis.cancelAnimationFrame(n))}return n(()=>n(e)),function(){t.forEach(e=>e())}}(()=>{const n=Rz.getContentEl(e);if(n){t=b$(n,{document:Rz.getDoc(e),escapeDeactivates:!1,preventScroll:!0,returnFocusOnDeactivate:!1,fallbackFocus:n,allowOutsideClick:!0,initialFocus:aj({root:n,getInitialEl:e.initialFocusEl})});try{t.activate()}catch{}}});return()=>{t?.deactivate(),n()}},hideContentBelow(e){if(!e.modal)return;return Sz(()=>[Rz.getContentEl(e)],{defer:!0})}},actions:{checkInitialFocusEl(e){e.initialFocusEl||"alertdialog"!==e.role||(e.initialFocusEl=()=>Rz.getCloseTriggerEl(e))},checkRenderedElements(e){cj(()=>{e.renderedElements.title=!!Rz.getTitleEl(e),e.renderedElements.description=!!Rz.getDescriptionEl(e)})},syncZIndex(e){cj(()=>{const t=Rz.getContentEl(e);if(!t)return;const n=Rz.getWin(e).getComputedStyle(t);[Rz.getPositionerEl(e),Rz.getBackdropEl(e)].forEach(e=>{e?.style.setProperty("--z-index",n.zIndex)})})},invokeOnClose(e){e.onOpenChange?.({open:!1})},invokeOnOpen(e){e.onOpenChange?.({open:!0})},toggleVisibility(e,t,{send:n}){n({type:e.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})},setFinalFocus(e){e.restoreFocus&&queueMicrotask(()=>{const t=e.finalFocusEl?.()??Rz.getTriggerEl(e);t?.focus({preventScroll:!0})})}}})}EU()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);var Fz=(e,t=[])=>({parts:(...n)=>{if(Mz(t))return Fz(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Fz(e,[...t,...n]),rename:e=>Fz(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${Lz(e)}"][data-part="${Lz(n)}"]`,`& [data-scope="${Lz(e)}"][data-part="${Lz(n)}"]`].join(", "),attrs:{"data-scope":Lz(e),"data-part":Lz(n)}}}),{})}),Lz=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Mz=e=>0===e.length,Uz=(e,t)=>({x:e,y:t});function jz(e,t){const n=function(e){const{x:t,y:n,width:r,height:o}=e,i=t+r/2,a=n+o/2;return{x:t,y:n,width:r,height:o,minX:t,minY:n,maxX:t+r,maxY:n+o,midX:i,midY:a,center:Uz(i,a)}}(e),{top:r,right:o,left:i,bottom:a}={top:Uz((s=n).minX,s.minY),right:Uz(s.maxX,s.minY),bottom:Uz(s.maxX,s.maxY),left:Uz(s.minX,s.maxY)};var s;const[l]=t.split("-");return{top:[i,r,o,a],right:[r,o,a,i],bottom:[r,i,a,o],left:[o,r,i,a]}[l]}var $z=Fz("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem").build(),zz=fj({getTriggerId:e=>e.ids?.trigger??`menu:${e.id}:trigger`,getContextTriggerId:e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,getContentId:e=>e.ids?.content??`menu:${e.id}:content`,getArrowId:e=>e.ids?.arrow??`menu:${e.id}:arrow`,getPositionerId:e=>e.ids?.positioner??`menu:${e.id}:popper`,getGroupId:(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,getGroupLabelId:(e,t)=>e.ids?.label?.(t)??`menu:${e.id}:label:${t}`,getContentEl:e=>zz.getById(e,zz.getContentId(e)),getPositionerEl:e=>zz.getById(e,zz.getPositionerId(e)),getTriggerEl:e=>zz.getById(e,zz.getTriggerId(e)),getHighlightedItemEl:e=>e.highlightedValue?zz.getById(e,e.highlightedValue):null,getArrowEl:e=>zz.getById(e,zz.getArrowId(e)),getElements:e=>{const t=`[role^="menuitem"][data-ownedby=${CSS.escape(zz.getContentId(e))}]:not([data-disabled])`;return pj(zz.getContentEl(e),t)},getFirstEl:e=>zz.getElements(e)[0],getLastEl:e=>{return(t=zz.getElements(e))[t.length-1];var t},getNextEl:(e,t)=>function(e,t,n=!0){let r=XU(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}(zz.getElements(e),e.highlightedValue,t??e.loopFocus),getPrevEl:(e,t)=>function(e,t,n=!0){let r=XU(e,t);return-1===r?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}(zz.getElements(e),e.highlightedValue,t??e.loopFocus),getElemByKey:(e,t)=>ej(zz.getElements(e),{state:e.typeaheadState,key:t,activeId:e.highlightedValue}),isTargetDisabled:e=>UU(e)&&(""===e.dataset.disabled||e.hasAttribute("disabled")),isTriggerItem:e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),getOptionFromItemEl:e=>({id:e.id,name:e.dataset.name,value:e.dataset.value,valueText:e.dataset.valueText,type:e.dataset.type})});function Hz(e,t,n){const r=e.context.isSubmenu,o=e.context.isTypingAhead,i=e.context.composite,a=e.hasTag("open"),s=function(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:X$.arrowSize.reference,height:X$.arrowSize.reference,[X$.arrowSizeHalf.variable]:`calc(${X$.arrowSize.reference} / 2)`,[X$.arrowOffset.variable]:`calc(${X$.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?cz[t.split("-")[0]]:void 0,background:X$.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}({...e.context.positioning,placement:e.context.anchorPoint?"bottom":e.context.currentPlacement});function l(t){return{disabled:!!t.disabled,highlighted:e.context.highlightedValue===t.value}}function u(e){const t=e.valueText??e.value;return{...e,id:e.value,valueText:t}}function c(e){return{...l(u(e)),checked:!!e.checked}}function d(r){const{value:o,closeOnSelect:i,valueText:a}=r,s=l(r);return n.element({...$z.item.attrs,id:o,role:"menuitem","aria-disabled":s.disabled,"data-disabled":MU(s.disabled),"data-ownedby":zz.getContentId(e.context),"data-highlighted":MU(s.highlighted),"data-valuetext":a,onDragStart(e){e.currentTarget.matches("a[href]")&&e.preventDefault()},onPointerMove(e){if(s.disabled)return;if("mouse"!==e.pointerType)return;const n=e.currentTarget;s.highlighted||t({type:"ITEM_POINTERMOVE",id:o,target:n,closeOnSelect:i})},onPointerLeave(n){if(s.disabled)return;if("mouse"!==n.pointerType)return;if(!e.previousEvent.type.includes("POINTER"))return;const r=n.currentTarget;t({type:"ITEM_POINTERLEAVE",id:o,target:r,closeOnSelect:i})},onPointerDown(e){if(s.disabled)return;const n=e.currentTarget;t({type:"ITEM_POINTERDOWN",target:n,id:o,closeOnSelect:i})},onPointerUp(e){if(YU(e))return;if(KU(e))return;if(s.disabled)return;if(!Pj(e))return;const n=e.currentTarget;t({type:"ITEM_CLICK",src:"pointerup",target:n,id:o,closeOnSelect:i}),"touch"===e.pointerType&&Nj(n)},onTouchEnd(e){e.preventDefault(),e.stopPropagation()}})}return{highlightedValue:e.context.highlightedValue,open:a,setOpen(e){e!==a&&t(e?"OPEN":"CLOSE")},setHighlightedValue(e){t({type:"HIGHLIGHTED.SET",id:e})},setParent(e){t({type:"PARENT.SET",value:e,id:e.state.context.id})},setChild(e){t({type:"CHILD.SET",value:e,id:e.state.context.id})},reposition(e={}){t({type:"POSITIONING.SET",options:e})},getContextTriggerProps:()=>n.element({...$z.contextTrigger.attrs,dir:e.context.dir,id:zz.getContextTriggerId(e.context),onPointerDown(e){if("mouse"===e.pointerType)return;const n=Mj(e);t({type:"CONTEXT_MENU_START",point:n})},onPointerCancel(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onPointerMove(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onPointerUp(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onContextMenu(e){const n=Mj(e);t({type:"CONTEXT_MENU",point:n}),e.preventDefault()},style:{WebkitTouchCallout:"none",userSelect:"none"}}),getTriggerItemProps:e=>wU(d({value:e.getTriggerProps().id}),e.getTriggerProps()),getTriggerProps:()=>n.button({...r?$z.triggerItem.attrs:$z.trigger.attrs,"data-placement":e.context.currentPlacement,type:"button",dir:e.context.dir,id:zz.getTriggerId(e.context),"data-uid":e.context.id,"aria-haspopup":i?"menu":"dialog","aria-controls":zz.getContentId(e.context),"aria-expanded":a||void 0,"data-state":a?"open":"closed",onPointerMove(e){if("mouse"!==e.pointerType)return;!zz.isTargetDisabled(e.currentTarget)&&r&&t({type:"TRIGGER_POINTERMOVE",target:e.currentTarget})},onPointerLeave(e){if("mouse"!==e.pointerType)return;if(zz.isTargetDisabled(e.currentTarget)||!r)return;const n=Mj(e);t({type:"TRIGGER_POINTERLEAVE",target:e.currentTarget,point:n})},onClick(e){zz.isTriggerItem(e.currentTarget)&&t({type:"TRIGGER_CLICK",target:e.currentTarget})},onPointerDown(e){const n=zz.isTargetDisabled(e.currentTarget);!Pj(e)||n||Ij(e)||(e.preventDefault(),zz.isTriggerItem(e.currentTarget)||t({type:"TRIGGER_CLICK",target:e.currentTarget}))},onBlur(){t("TRIGGER_BLUR")},onFocus(){t("TRIGGER_FOCUS")},onKeyDown(n){if(n.defaultPrevented)return;const r={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},Enter(){t({type:"ARROW_DOWN",src:"enter"})},Space(){t({type:"ARROW_DOWN",src:"space"})}}[Lj(n,e.context)];r&&(n.preventDefault(),r(n))}}),getIndicatorProps:()=>n.element({...$z.indicator.attrs,dir:e.context.dir,"data-state":a?"open":"closed"}),getPositionerProps:()=>n.element({...$z.positioner.attrs,dir:e.context.dir,id:zz.getPositionerId(e.context),style:s.floating}),getArrowProps:()=>n.element({id:zz.getArrowId(e.context),...$z.arrow.attrs,dir:e.context.dir,style:s.arrow}),getArrowTipProps:()=>n.element({...$z.arrowTip.attrs,dir:e.context.dir,style:s.arrowTip}),getContentProps:()=>n.element({...$z.content.attrs,id:zz.getContentId(e.context),"aria-label":e.context["aria-label"],hidden:!a,"data-state":a?"open":"closed",role:i?"menu":"dialog",tabIndex:0,dir:e.context.dir,"aria-activedescendant":e.context.highlightedValue??void 0,"aria-labelledby":zz.getTriggerId(e.context),"data-placement":e.context.currentPlacement,onPointerEnter(e){"mouse"===e.pointerType&&t("MENU_POINTERENTER")},onKeyDown(n){if(n.defaultPrevented)return;if(!(e=>$U(e.currentTarget,GU(e)))(n))return;const r=GU(n);if(!(r?.closest("[role=menu]")===n.currentTarget||r===n.currentTarget))return;if("Tab"===n.key){if(!sj(n))return void n.preventDefault()}const i=zz.getHighlightedItemEl(e.context),a={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},ArrowLeft(){t("ARROW_LEFT")},ArrowRight(){t("ARROW_RIGHT")},Enter(){t("ENTER"),Nj(i)},Space(e){o?t({type:"TYPEAHEAD",key:e.key}):a.Enter?.(e)},Home(){t("HOME")},End(){t("END")}},s=Lj(n,{dir:e.context.dir}),l=a[s];if(l)return l(n),n.stopPropagation(),void n.preventDefault();e.context.typeahead&&function(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}(n)&&((e=>e.ctrlKey||e.altKey||e.metaKey)(n)||lj(r)||(t({type:"TYPEAHEAD",key:n.key}),n.preventDefault()))}}),getSeparatorProps:()=>n.element({...$z.separator.attrs,role:"separator",dir:e.context.dir,"aria-orientation":"horizontal"}),getItemState:l,getItemProps:d,getOptionItemState:c,getOptionItemProps(r){const{type:o,disabled:i,onCheckedChange:a,closeOnSelect:s}=r,l=u(r),p=c(r);return{...d(l),...n.element({"data-type":o,...$z.item.attrs,dir:e.context.dir,"data-value":l.value,role:`menuitem${o}`,"aria-checked":!!p.checked,"data-state":p.checked?"checked":"unchecked",onPointerUp(e){if(!Pj(e)||i)return;if(YU(e))return;if(KU(e))return;const n=e.currentTarget;t({type:"ITEM_CLICK",src:"pointerup",target:n,option:l,closeOnSelect:s}),a?.(!p.checked)}})}},getItemIndicatorProps(t){const r=c(t);return n.element({...$z.itemIndicator.attrs,dir:e.context.dir,"data-disabled":MU(r.disabled),"data-highlighted":MU(r.highlighted),"data-state":r.checked?"checked":"unchecked",hidden:!r.checked})},getItemTextProps(t){const r=c(t);return n.element({...$z.itemText.attrs,dir:e.context.dir,"data-disabled":MU(r.disabled),"data-highlighted":MU(r.highlighted),"data-state":r.checked?"checked":"unchecked"})},getItemGroupLabelProps:t=>n.element({id:zz.getGroupLabelId(e.context,t.htmlFor),dir:e.context.dir,...$z.itemGroupLabel.attrs}),getItemGroupProps:t=>n.element({id:zz.getGroupId(e.context,t.id),...$z.itemGroup.attrs,dir:e.context.dir,"aria-labelledby":zz.getGroupLabelId(e.context,t.id),role:"group"})}}var{not:Vz,and:Wz,or:qz}=uU;function Gz(e){let t=e.parent;for(;t&&t.state.context.isSubmenu;)t=t.state.context.parent;t?.send("CLOSE")}var Kz={highlighted(e,t){wj(e.highlightedValue,t)||(e.highlightedValue=t,e.onHighlightChange?.({highlightedValue:t}))}};EU()(["anchorPoint","aria-label","closeOnSelect","dir","getRootNode","highlightedValue","id","ids","loopFocus","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onEscapeKeyDown","onSelect","onHighlightChange","open","open.controlled","positioning","typeahead","composite"]),EU()(["closeOnSelect","disabled","value","valueText"]),EU()(["htmlFor"]),EU()(["id"]),EU()(["disabled","valueText","closeOnSelect","type","value","checked","onCheckedChange"]);var Yz=(e,t=[])=>({parts:(...n)=>{if(Xz(t))return Yz(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Yz(e,[...t,...n]),rename:e=>Yz(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${Zz(e)}"][data-part="${Zz(n)}"]`,`& [data-scope="${Zz(e)}"][data-part="${Zz(n)}"]`].join(", "),attrs:{"data-scope":Zz(e),"data-part":Zz(n)}}}),{})}),Zz=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Xz=e=>0===e.length,Qz=Yz("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange").build(),Jz=fj({getRootId:e=>e.ids?.root??`progress-${e.id}`,getTrackId:e=>e.ids?.track??`progress-${e.id}-track`,getLabelId:e=>e.ids?.label??`progress-${e.id}-label`,getCircleId:e=>e.ids?.circle??`progress-${e.id}-circle`});function eH(e,t){return e+(t-e)/2}function tH(e){const t=Tj(e);return gU({id:"progress",initial:"idle",context:{max:t.max??100,min:t.min??0,value:eH(t.min??0,t.max??100),orientation:"horizontal",translations:{value:({percent:e})=>-1===e?"loading...":`${e} percent`,...t.translations},...t},created:["validateContext"],computed:{isIndeterminate:e=>null===e.value,percent:e=>Cj(e.value)?Math.round((e.value-e.min)/(e.max-e.min)*100):-1,isAtMax:e=>e.value===e.max,isHorizontal:e=>"horizontal"===e.orientation,isRtl:e=>"rtl"===e.dir},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}}},{actions:{setValue:(e,t)=>{e.value=null===t.value?null:Math.max(0,Math.min(t.value,e.max))},validateContext:e=>{if(null!=e.value){if(!nH(e.max))throw new Error(`[progress] The max value passed \`${e.max}\` is not a valid number`);if(!function(e,t){return nH(e)&&e<=t}(e.value,e.max))throw new Error(`[progress] The value passed \`${e.value}\` exceeds the max value \`${e.max}\``);if(!function(e,t){return nH(e)&&e>=t}(e.value,e.min))throw new Error(`[progress] The value passed \`${e.value}\` exceeds the min value \`${e.min}\``)}}}})}function nH(e){return Cj(e)&&!isNaN(e)}EU()(["dir","getRootNode","id","ids","max","min","orientation","translations","value"]);var rH=(e,t=[])=>({parts:(...n)=>{if(iH(t))return rH(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>rH(e,[...t,...n]),rename:e=>rH(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${oH(e)}"][data-part="${oH(n)}"]`,`& [data-scope="${oH(e)}"][data-part="${oH(n)}"]`].join(", "),attrs:{"data-scope":oH(e),"data-part":oH(n)}}}),{})}),oH=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),iH=e=>0===e.length,aH=rH("toast").parts("group","root","title","description","actionTrigger","closeTrigger").build(),sH=fj({getRegionId:e=>`toast-group:${e}`,getRegionEl:(e,t)=>sH.getById(e,`toast-group:${t}`),getRootId:e=>`toast:${e.id}`,getRootEl:e=>sH.getById(e,sH.getRootId(e)),getTitleId:e=>`toast:${e.id}:title`,getDescriptionId:e=>`toast:${e.id}:description`,getCloseTriggerId:e=>`toast${e.id}:close`});function lH(e,t){return e.filter(e=>e.state.context.placement===t)}var uH={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function cH(e,t){return e??uH[t]??uH.DEFAULT}function dH(e,t){const n=e.offsets,r="string"==typeof n?{left:n,right:n,bottom:n,top:n}:n,o="rtl"===e.dir,i=t.replace("-start",o?"-right":"-left").replace("-end",o?"-left":"-right"),a=i.includes("right"),s=i.includes("left"),l={position:"fixed",pointerEvents:e.count>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${e.gap}px`,"--first-height":`${e.heights[0]?.height||0}px`,zIndex:2147483647};let u="center";if(a&&(u="flex-end"),s&&(u="flex-start"),l.alignItems=u,i.includes("top")){const e=r.top;l.top=`max(env(safe-area-inset-top, 0px), ${e})`}if(i.includes("bottom")){const e=r.bottom;l.bottom=`max(env(safe-area-inset-bottom, 0px), ${e})`}if(!i.includes("left")){const e=r.right;l.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${e})`}if(!i.includes("right")){const e=r.left;l.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${e})`}return l}function pH(e,t){const[n]=e.placement.split("-"),r=!e.frontmost,o=!e.stacked,i={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${e.removeDelay}ms`,"--duration":`${"loading"===e.type?Number.MAX_SAFE_INTEGER:e.duration}ms`,"--initial-height":`${e.height}px`,"--offset":`${e.offset}px`,"--index":e.index,"--z-index":e.zIndex,"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},a=e=>Object.assign(i,e);return"top"===n?a({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):"bottom"===n&&a({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),e.mounted&&(a({"--y":"0","--opacity":"1"}),e.stacked&&a({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||a({"--opacity":"0",pointerEvents:"none"}),r&&o&&(a({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||a({"--y":"calc(var(--sign) * 40%)"})),r&&e.stacked&&!t&&a({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),e.frontmost&&!t&&a({"--y":"calc(var(--lift) * -100%)"}),i}function fH(e,t){const n={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"};var r;return e.frontmost&&!t&&(r={height:"calc(var(--initial-height) + 80%)"},Object.assign(n,r)),n}var{not:hH,and:gH,or:mH}=uU;function vH(e,t){lH(e.toasts,e.placement).forEach(t)}var yH={connect:function(e,t,n){function r(){var t;return(t=e)instanceof hU||"machine"===t?.type?e.getState():e}function o(e){return lH(r().context.toasts,e)}function i(e){const t=r().context.toasts;return!!t.length&&!!t.find(t=>t.id==e)}function a(e){const n=`toast:${kj()}`,r=e.id?e.id:n;return i(r)||t({type:"ADD_TOAST",toast:{...e,id:r}}),r}function s(e,n){return i(e)?(t({type:"UPDATE_TOAST",id:e,toast:n}),e):e}function l(e){const{id:t}=e;return!!t&&i(t)&&null!=t?s(t,e):a(e)}function u(e){null==e?t("DISMISS_ALL"):i(e)&&t({type:"DISMISS_TOAST",id:e})}return{getCount:()=>r().context.count,getPlacements(){const e=r().context.toasts.map(e=>e.state.context.placement);return Array.from(new Set(e))},getToastsByPlacement:o,isVisible:i,create:a,update:s,upsert:l,dismiss:u,remove(e){null==e?t("REMOVE_ALL"):i(e)&&t({type:"REMOVE_TOAST",id:e})},dismissByPlacement(e){o(e).forEach(e=>u(e.id))},loading:e=>l({...e,type:"loading"}),success:e=>l({...e,type:"success"}),error:e=>l({...e,type:"error"}),promise(e,t,n={}){const r=l({...n,...t.loading,type:"loading"});return Ej(e).then(e=>{const o=Ej(t.success,e);l({...n,...o,id:r,type:"success"})}).catch(e=>{const o=Ej(t.error,e);l({...n,...o,id:r,type:"error"})}).finally(()=>{t.finally?.()}),r},pause(e){null==e?t("PAUSE_ALL"):i(e)&&t({type:"PAUSE_TOAST",id:e})},resume(e){null==e?t("RESUME_ALL"):i(e)&&t({type:"RESUME_TOAST",id:e})},getGroupProps(e){const{placement:o,label:i="Notifications"}=e,a=r(),s=a.context.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),[l,u="center"]=o.split("-");return n.element({...aH.group.attrs,dir:a.context.dir,tabIndex:-1,"aria-label":`${o} ${i} ${s}`,id:sH.getRegionId(o),"data-placement":o,"data-side":l,"data-align":u,"aria-live":"polite",role:"region",style:dH(a.context,o),onMouseMove(){t({type:"REGION.POINTER_ENTER",placement:o})},onMouseLeave(){t({type:"REGION.POINTER_LEAVE",placement:o})},onFocus(e){t({type:"REGION.FOCUS",target:e.relatedTarget})},onBlur(e){a.context.isFocusWithin&&!$U(e.currentTarget,e.relatedTarget)&&t({type:"REGION.BLUR"})}})},subscribe(e){const t=r();return FM(t.context.toasts,()=>{const n=o(t.context.placement).map(e=>e.getState().context);e(n)})}}},machine:function(e){const t=Tj(e);return gU({id:"toaster",initial:t.overlap?"overlap":"stack",context:{dir:"ltr",max:Number.MAX_SAFE_INTEGER,gap:16,pauseOnPageIdle:!1,hotkey:["altKey","KeyT"],offsets:"1rem",placement:"bottom",removeDelay:200,...t,toasts:[],lastFocusedEl:null,isFocusWithin:!1,heights:[]},computed:{count:e=>e.toasts.length},activities:["trackDocumentVisibility","trackHotKeyPress"],watch:{toasts:["collapsedIfEmpty","setDismissableBranch"]},exit:["removeToasts","clearDismissableBranch","clearLastFocusedEl"],on:{PAUSE_TOAST:{actions:["pauseToast"]},PAUSE_ALL:{actions:["pauseToasts"]},RESUME_TOAST:{actions:["resumeToast"]},RESUME_ALL:{actions:["resumeToasts"]},ADD_TOAST:{guard:"isWithinRange",actions:["createToast","syncToastIndex"]},UPDATE_TOAST:{actions:["updateToast"]},DISMISS_TOAST:{actions:["dismissToast"]},DISMISS_ALL:{actions:["dismissToasts"]},REMOVE_TOAST:{actions:["removeToast","syncToastIndex","syncToastOffset"]},REMOVE_ALL:{actions:["removeToasts"]},UPDATE_HEIGHT:{actions:["syncHeights","syncToastOffset"]},"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","restoreLastFocusedEl"]},{actions:["resumeToasts","restoreLastFocusedEl"]}]},states:{stack:{entry:["expandToasts"],on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap"},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{entry:["collapseToasts"],on:{"REGION.STACK":{target:"stack"},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts"]}}}}},{guards:{isWithinRange:e=>e.toasts.length<e.max,isOverlapping:e=>!!e.overlap},activities:{trackHotKeyPress:(e,t,{send:n})=>Oj(document,"keydown",t=>{e.hotkey.every(e=>t[e]||t.code===e)&&n({type:"DOC.HOTKEY"})},{capture:!0}),trackDocumentVisibility(e,t,{send:n}){if(!e.pauseOnPageIdle)return;const r=sH.getDoc(e);return Oj(r,"visibilitychange",()=>{n("hidden"===r.visibilityState?"PAUSE_ALL":"RESUME_ALL")})}},actions:{setDismissableBranch(e){const t=lH(e.toasts,e.placement).length>0;if(!t)return void e._cleanup?.();if(t&&e._cleanup)return;e._cleanup=function(e,t={}){const{defer:n}=t,r=n?cj:e=>e(),o=[];return o.push(r(()=>{const t=Sj(e)?e():e;t?(bz.addBranch(t),o.push(()=>{bz.removeBranch(t)})):Aj("[@zag-js/dismissable] branch node is `null` or `undefined`")})),()=>{o.forEach(e=>e?.())}}(()=>sH.getRegionEl(e,e.placement),{defer:!0})},clearDismissableBranch(e){e._cleanup?.()},focusRegionEl(e){queueMicrotask(()=>{sH.getRegionEl(e,e.placement)?.focus()})},expandToasts(e){vH(e,e=>{e.state.context.stacked=!0})},collapseToasts(e){vH(e,e=>{e.state.context.stacked=!1})},collapsedIfEmpty(e,t,{send:n}){!e.overlap||e.toasts.length>1||n("REGION.OVERLAP")},pauseToast(e,t,{self:n}){n.sendChild("PAUSE",t.id)},pauseToasts(e){e.toasts.forEach(e=>e.send("PAUSE"))},resumeToast(e,t,{self:n}){n.sendChild("RESUME",t.id)},resumeToasts(e){e.toasts.forEach(e=>e.send("RESUME"))},measureToasts(e){e.toasts.forEach(e=>e.send("MEASURE"))},createToast(e,t,{self:n,getState:r}){const o=function(e){const{type:t="info",duration:n,id:r="1",placement:o="bottom",removeDelay:i=200,...a}=e,s=Tj(a),l=cH(n,t);return gU({id:r,context:{id:r,type:t,remaining:l,duration:l,removeDelay:i,createdAt:Date.now(),placement:o,...s,height:0,offset:0,frontmost:!1,mounted:!1,index:-1,zIndex:0},initial:"loading"===t?"visible:persist":"visible",on:{UPDATE:[{guard:gH("hasTypeChanged","isChangingToLoading"),target:"visible:persist",actions:["setContext"]},{guard:mH("hasDurationChanged","hasTypeChanged"),target:"visible:updating",actions:["setContext"]},{actions:["setContext"]}],MEASURE:{actions:["measureHeight"]}},entry:["invokeOnVisible"],activities:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],after:{0:"visible"}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:hH("isLoadingType"),target:"visible",actions:["setCreatedAt"]},DISMISS:"dismissing"}},visible:{tags:["visible"],after:{VISIBLE_DURATION:"dismissing"},on:{DISMISS:"dismissing",PAUSE:{target:"visible:persist",actions:"setRemainingDuration"}}},dismissing:{entry:"invokeOnDismiss",after:{REMOVE_DELAY:{target:"unmounted",actions:"notifyParentToRemove"}}},unmounted:{entry:"invokeOnUnmount",type:"final"}}},{activities:{trackHeight(e,t,{self:n}){let r;return cj(()=>{const t=sH.getRootEl(e);if(!t)return;e.mounted=!0,Aj(2!==pj(t,"[data-ghost]").length,"[toast] No ghost element found in toast. Render the `ghostBefore` and `ghostAfter` elements");const o=()=>{const r=t.style.height;t.style.height="auto";const o=t.getBoundingClientRect().height;t.style.height=r,e.height=o,n.sendParent({type:"UPDATE_HEIGHT",id:n.id,height:o,placement:e.placement})};o();const i=new(sH.getWin(e).MutationObserver)(o);i.observe(t,{childList:!0,subtree:!0,characterData:!0}),r=()=>i.disconnect()}),()=>r?.()}},guards:{isChangingToLoading:(e,t)=>"loading"===t.toast?.type,isLoadingType:e=>"loading"===e.type,hasTypeChanged:(e,t)=>null!=t.toast?.type&&t.toast.type!==e.type,hasDurationChanged:(e,t)=>null!=t.toast?.duration&&t.toast.duration!==e.duration},delays:{VISIBLE_DURATION:e=>e.remaining,REMOVE_DELAY:e=>e.removeDelay},actions:{measureHeight(e,t,{self:n}){cj(()=>{const t=sH.getRootEl(e);if(!t)return;e.mounted=!0;const r=t.style.height;t.style.height="auto";const o=t.getBoundingClientRect().height;t.style.height=r,e.height=o,n.sendParent({type:"UPDATE_HEIGHT",id:n.id,height:o,placement:e.placement})})},setRemainingDuration(e){e.remaining-=Date.now()-e.createdAt},setCreatedAt(e){e.createdAt=Date.now()},notifyParentToRemove(e,t,{self:n}){n.sendParent({type:"REMOVE_TOAST",id:n.id})},invokeOnDismiss(e){e.onStatusChange?.({status:"dismissing"})},invokeOnUnmount(e){e.onStatusChange?.({status:"unmounted"})},invokeOnVisible(e){e.onStatusChange?.({status:"visible"})},setContext(e,t){const n=t.toast?.duration,r=cH(n,t.toast?.type??e.type);Object.assign(e,{...t.toast,duration:r,remaining:r})}}})}({placement:e.placement,duration:e.duration,removeDelay:e.removeDelay,...t.toast,dir:e.dir,getRootNode:e.getRootNode,stacked:r().matches("stack")}),i=n.spawn(o);e.toasts=[i,...e.toasts]},updateToast(e,t,{self:n}){n.sendChild({type:"UPDATE",toast:t.toast},t.id)},dismissToast(e,t,{self:n}){n.sendChild("DISMISS",t.id)},dismissToasts(e){e.toasts.forEach(e=>e.send("DISMISS"))},removeToast(e,t,{self:n}){n.stopChild(t.id),e.toasts=e.toasts.filter(e=>e.id!==t.id),e.heights=e.heights.filter(e=>e.id!==t.id)},removeToasts(e,t,{self:n}){e.toasts.forEach(e=>n.stopChild(e.id)),e.toasts=[],e.heights=[]},syncHeights(e,t){const n=e.heights.find(e=>e.id===t.id);if(n)n.height=t.height,n.placement=t.placement;else{const n={id:t.id,height:t.height,placement:t.placement};e.heights=[n,...e.heights]}},syncToastIndex(e){vH(e,(e,t,n)=>{e.state.context.index=t,e.state.context.frontmost=0===t,e.state.context.zIndex=n.length-t})},syncToastOffset(e,t){const n=t.placement??e.placement;vH({...e,placement:n},t=>{const n=Math.max(e.heights.findIndex(e=>e.id===t.id),0),r=e.heights.reduce((e,t,r)=>r>=n?e:e+t.height,0);t.state.context.offset=n*e.gap+r})},setLastFocusedEl(e,t){!e.isFocusWithin&&t.target&&(e.isFocusWithin=!0,e.lastFocusedEl=MM(t.target))},restoreLastFocusedEl(e){e.isFocusWithin=!1,e.lastFocusedEl&&(e.lastFocusedEl.focus({preventScroll:!0}),e.lastFocusedEl=null)},clearLastFocusedEl(e){e.lastFocusedEl&&(e.lastFocusedEl.focus({preventScroll:!0}),e.lastFocusedEl=null,e.isFocusWithin=!1)}}})}};function bH(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,a=U(i);return[a.Provider,function e(){const i=j(a);if(!i&&t){const t=new Error(o??`${n} returned \`undefined\`. Seems you forgot to wrap component within ${r}`);throw t.name="ContextError",Error.captureStackTrace?.(t,e),t}return i},a]}bH({hookName:"useAccordionContext",providerName:"<AccordionProvider />"});const wH=()=>(e,t)=>de(e,t),[EH,_H]=bH({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),xH=e=>wH()(e,["lazyMount","unmountOnExit"]),kH=e=>t=>{const[n,r]=de(t,["asChild"]);if(n.asChild){const e=e=>{const[,t]=de(r,["ref"]);return _U(t,e)};return n.asChild(e)}return ie(We,ce({component:e},r))};const CH=function(){const e=new Map;return new Proxy(kH,{apply:(e,t,n)=>kH(n[0]),get(t,n){const r=n;return e.has(r)||e.set(r,kH(r)),e.get(r)}})}();bH({hookName:"useCollapsibleContext",providerName:"<CollapsibleProvider />"});const[SH,TH]=bH({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})});var DH=De("<span hidden>");const AH=e=>{const[t,n]=O(),r=()=>((e,...t)=>"function"==typeof e?e(...t):e)(e.value)??t()?.ownerDocument??document,o=N(()=>({getRootNode:r,getDocument:()=>zU(r()),getWindow:()=>HU(r())}));return ie(SH,{value:o,get children(){return[N(()=>e.children),ie(ve,{get when(){return!e.value},get children(){var e=DH();return Re(n,e),e}})]}})},[OH,PH]=bH({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})});bH({hookName:"useAccordionItemContext",providerName:"<AccordionItemProvider />"}),bH({hookName:"useAccordionItemPropsContext",providerName:"<AccordionItemPropsProvider />"}),bH({hookName:"useAvatarContext",providerName:"<AvatarProvider />"}),bH({hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),bH({hookName:"useCheckboxContext",providerName:"<CheckboxProvider />"}),bH({hookName:"useCheckboxGroupContext",providerName:"<CheckboxGroupProvider />",strict:!1}),bH({hookName:"useClipboardContext",providerName:"<ClipboardProvider />"}),bH({hookName:"useColorPickerAreaContext",providerName:"<ColorPickerAreaProvider />"}),bH({hookName:"useColorPickerContext",providerName:"<ColorPickerProvider />"}),bH({hookName:"useColorPickerChannelSliderContext",providerName:"<ColorPickerChannelSliderProvider />"});const IH=e=>wH()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]),NH=e=>{const[t,n]=xH(e),[r,o]=O(!1),[i,a]=LU(gU({initial:(s=n).present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:!1,initial:!1,...s},exit:["clearInitial"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},"ANIMATION.END":{target:"unmounted",actions:["invokeOnExitComplete"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{actions:{setInitial(e){e.initial=!0},clearInitial(e){e.initial=!1},invokeOnExitComplete(e){e.onExitComplete?.()},setNode(e,t){e.node=MM(t.node)},setStyles(e,t){const n=t.node.ownerDocument.defaultView||window;e.styles=MM(n.getComputedStyle(t.node))},syncPresence(e,t,{send:n}){if(e.present)return void n({type:"MOUNT",src:"presence.changed"});const r=xz(e.styles);(e.immediate?queueMicrotask:requestAnimationFrame)(()=>{e.unmountAnimationName=r,"none"===r||r===e.prevAnimationName||"none"===e.styles?.display?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName(e){(e.immediate?queueMicrotask:requestAnimationFrame)(()=>{e.prevAnimationName=xz(e.styles)})},clearPrevAnimationName(e){e.prevAnimationName=null}},activities:{trackAnimationEvents(e,t,{send:n}){const r=e.node;if(!r)return;const o=t=>{t.target===r&&(e.prevAnimationName=xz(e.styles))},i=t=>{const o=xz(e.styles);t.target===r&&o===e.unmountAnimationName&&n({type:"UNMOUNT",src:"animationend"})};return r.addEventListener("animationstart",o),r.addEventListener("animationcancel",i),r.addEventListener("animationend",i),()=>{r.removeEventListener("animationstart",o),r.removeEventListener("animationcancel",i),r.removeEventListener("animationend",i)}}}}),{context:n});var s;const l=N(()=>function(e,t){const n=e.matches("mounted","unmountSuspended");return{skip:!e.context.initial&&n,present:n,setNode(e){e&&t({type:"NODE.SET",node:e})},unmount(){t({type:"UNMOUNT"})}}}(i,a));return I(()=>{l().present&&o(!0)}),N(()=>({unmounted:!l().present&&!r()&&t.lazyMount||t.unmountOnExit&&!l().present&&r(),present:l().present,presenceProps:{ref:l().setNode,hidden:!l().present,"data-state":n.present?"open":"closed"}}))},[RH,BH]=bH({hookName:"usePresenceContext",providerName:"<PresenceProvider />"});bH({hookName:"useColorPickerSwatchContext",providerName:"<ColorPickerSwatchProvider />"}),bH({hookName:"useComboboxContext",providerName:"<ComboboxProvider />"}),bH({hookName:"useComboboxItemContext",providerName:"<ComboboxItemProvider />"}),bH({hookName:"useComboboxItemPropsContext",providerName:"<ComboboxItemPropsProvider />"}),bH({hookName:"useComboboxItemGroupPropsContext",providerName:"<ComboboxItemGroupPropsProvider />"}),bH({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),bH({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),bH({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),bH({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"});const[FH,LH]=bH({hookName:"useDialogContext",providerName:"<DialogProvider />"}),MH=e=>{const t=PH(),n=TH(),r=fe(),o=N(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":void 0!==e.open,...e})),[i,a]=LU(Bz(o()),{context:o});return N(()=>function(e,t,n){const r=e.context["aria-label"],o=e.matches("open"),i=e.context.renderedElements;return{open:o,setOpen(e){e!==o&&t(e?"OPEN":"CLOSE")},getTriggerProps:()=>n.button({...Nz.trigger.attrs,dir:e.context.dir,id:Rz.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":o,"data-state":o?"open":"closed","aria-controls":Rz.getContentId(e.context),onClick(e){e.defaultPrevented||t("TOGGLE")}}),getBackdropProps:()=>n.element({...Nz.backdrop.attrs,dir:e.context.dir,hidden:!o,id:Rz.getBackdropId(e.context),"data-state":o?"open":"closed"}),getPositionerProps:()=>n.element({...Nz.positioner.attrs,dir:e.context.dir,id:Rz.getPositionerId(e.context),style:{pointerEvents:o?void 0:"none"}}),getContentProps:()=>n.element({...Nz.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!o,id:Rz.getContentId(e.context),tabIndex:-1,"data-state":o?"open":"closed","aria-modal":!0,"aria-label":r||void 0,"aria-labelledby":r||!i.title?void 0:Rz.getTitleId(e.context),"aria-describedby":i.description?Rz.getDescriptionId(e.context):void 0}),getTitleProps:()=>n.element({...Nz.title.attrs,dir:e.context.dir,id:Rz.getTitleId(e.context)}),getDescriptionProps:()=>n.element({...Nz.description.attrs,dir:e.context.dir,id:Rz.getDescriptionId(e.context)}),getCloseTriggerProps:()=>n.button({...Nz.closeTrigger.attrs,dir:e.context.dir,id:Rz.getCloseTriggerId(e.context),type:"button",onClick(e){e.defaultPrevented||(e.stopPropagation(),t("CLOSE"))}})}}(i,a,OU))};var UH=Object.freeze({__proto__:null,Backdrop:e=>{const t=LH(),n=_H(),r=NH(_U(n,()=>({present:t().open}))),o=_U(()=>t().getBackdropProps(),()=>r().presenceProps,e);return ie(ve,{get when(){return!r().unmounted},get children(){return ie(CH.div,o)}})},CloseTrigger:e=>{const t=LH(),n=_U(()=>t().getCloseTriggerProps(),e);return ie(CH.button,n)},Content:e=>{const t=LH(),n=BH(),r=_U(()=>t().getContentProps(),()=>n().presenceProps,e);return ie(ve,{get when(){return!n().unmounted},get children(){return ie(CH.div,r)}})},Context:e=>e.children(LH()),Description:e=>{const t=LH(),n=_U(()=>t().getDescriptionProps(),e);return ie(CH.div,n)},Positioner:e=>{const t=LH(),n=BH(),r=_U(()=>t().getPositionerProps(),e);return ie(ve,{get when(){return!n().unmounted},get children(){return ie(CH.div,r)}})},Root:e=>{const[t,n]=IH(e),[r]=xH(t),[o,i]=wH()(n,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),a=MH(o),s=NH(_U(t,()=>({present:a().open})));return ie(FH,{value:a,get children(){return ie(EH,{value:r,get children(){return ie(RH,{value:s,get children(){return i.children}})}})}})},RootProvider:e=>{const[t,n]=IH(e),[r]=xH(t),o=NH(_U(t,()=>({present:n.value().open})));return ie(FH,{get value(){return n.value},get children(){return ie(EH,{value:r,get children(){return ie(RH,{value:o,get children(){return n.children}})}})}})},Title:e=>{const t=LH(),n=_U(()=>t().getTitleProps(),e);return ie(CH.h2,n)},Trigger:e=>{const t=LH(),n=BH(),r=_U(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return ie(CH.button,r)}});bH({hookName:"useEditableContext",providerName:"<EditableProvider />"}),bH({hookName:"useFileUploadContext",providerName:"<FileUploadProvider />"}),bH({hookName:"useFileUploadItemPropsContext",providerName:"<FileUploadItemPropsProvider />"}),bH({hookName:"useHoverCardContext",providerName:"<HoverCardProvider />"});const[jH,$H]=bH({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:!1}),[zH,HH]=bH({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[VH,WH]=bH({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),[qH,GH]=bH({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),KH=e=>{const t=PH(),n=TH(),r=fe(),o=N(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":void 0!==e.open,...e})),[i,a,s]=LU(function(e){const t=Tj(e);return gU({id:"menu",initial:t.open?"open":"idle",context:{highlightedValue:null,loopFocus:!1,anchorPoint:null,closeOnSelect:!0,typeahead:!0,composite:!0,...t,positioning:{placement:"bottom-start",gutter:8,...t.positioning},intentPolygon:null,parent:null,lastHighlightedValue:null,children:MM({}),suspendPointer:!1,restoreFocus:!0,typeaheadState:ej.defaultOptions},computed:{isSubmenu:e=>null!==e.parent,isRtl:e=>"rtl"===e.dir,isTypingAhead:e=>""!==e.typeaheadState.keysSoFar},watch:{isSubmenu:"setSubmenuPlacement",anchorPoint:"reposition",open:"toggleVisibility"},on:{"PARENT.SET":{actions:"setParentMenu"},"CHILD.SET":{actions:"setChildMenu"},OPEN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{internal:!0,target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],"HIGHLIGHTED.RESTORE":{actions:"restoreHighlightedItem"},"HIGHLIGHTED.SET":{actions:"setHighlightedItem"}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_FOCUS:{guard:Vz("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],after:{LONG_PRESS_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},opening:{tags:["closed"],after:{SUBMENU_OPEN_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",BLUR:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},closing:{tags:["open"],activities:["trackPointerMove","trackInteractOutside"],after:{SUBMENU_CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem","invokeOnClose"]}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]},MENU_POINTERENTER:{target:"open",actions:"clearIntentPolygon"},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","clearAnchorPoint","resumePointer"],on:{"CONTROLLED.OPEN":[{guard:qz("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:"highlightFirstItem"},{guard:"isArrowUpEvent",target:"open",actions:"highlightLastItem"},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:"idle",ARROW_DOWN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],activities:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:Wz(Vz("isTriggerItem"),"isOpenControlled"),actions:"invokeOnClose"},{guard:Vz("isTriggerItem"),target:"closed",actions:"invokeOnClose"}],ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:Wz("isSubmenu","isOpenControlled"),actions:"invokeOnClose"},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},ENTER:[{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},{guard:Wz("closeOnSelect","isOpenControlled"),actions:["clickHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"closed",actions:"clickHighlightedItem"},{actions:"clickHighlightedItem"}],ITEM_POINTERMOVE:[{guard:Vz("suspendPointer"),actions:["setHighlightedItem","focusMenu"]},{actions:"setLastHighlightedItem"}],ITEM_POINTERLEAVE:{guard:Wz(Vz("suspendPointer"),Vz("isTriggerItem")),actions:"clearHighlightedItem"},ITEM_CLICK:[{guard:Wz(Vz("isTriggerItemHighlighted"),Vz("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Wz(Vz("isTriggerItemHighlighted"),Vz("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:Wz(Vz("isTriggerItemHighlighted"),Vz("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:"setHighlightedItem"}],TRIGGER_POINTERLEAVE:{target:"closing",actions:"setIntentPolygon"},ITEM_POINTERDOWN:{actions:"setHighlightedItem"},TYPEAHEAD:{actions:"highlightMatchedItem"},FOCUS_MENU:{actions:"focusMenu"},"POSITIONING.SET":{actions:"reposition"}}}}},{delays:{LONG_PRESS_DELAY:700,SUBMENU_OPEN_DELAY:100,SUBMENU_CLOSE_DELAY:100},guards:{closeOnSelect:(e,t)=>!!(t?.closeOnSelect??e.closeOnSelect),isTriggerItem:(e,t)=>zz.isTriggerItem(t.target),isTriggerItemHighlighted:(e,t)=>{const n=t.target??zz.getHighlightedItemEl(e);return!!n?.hasAttribute("aria-controls")},isSubmenu:e=>e.isSubmenu,suspendPointer:e=>e.suspendPointer,isHighlightedItemEditable:e=>lj(zz.getHighlightedItemEl(e)),isWithinPolygon:(e,t)=>!!e.intentPolygon&&function(e,t){const{x:n,y:r}=t;let o=!1;for(let t=0,i=e.length-1;t<e.length;i=t++){const a=e[t].x,s=e[t].y,l=e[i].x,u=e[i].y;s>r!=u>r&&n<(l-a)*(r-s)/(u-s)+a&&(o=!o)}return o}(e.intentPolygon,t.point),isOpenControlled:e=>!!e["open.controlled"],isArrowLeftEvent:(e,t)=>"ARROW_LEFT"===t.previousEvent?.type,isArrowUpEvent:(e,t)=>"ARROW_UP"===t.previousEvent?.type,isArrowDownEvent:(e,t)=>"ARROW_DOWN"===t.previousEvent?.type,isOpenAutoFocusEvent:(e,t)=>"OPEN_AUTOFOCUS"===t.previousEvent?.type},activities:{trackPositioning(e){if(!e.anchorPoint)return e.currentPlacement=e.positioning.placement,uz(zz.getTriggerEl(e),()=>zz.getPositionerEl(e),{...e.positioning,defer:!0,onComplete(t){e.currentPlacement=t.placement}})},trackInteractOutside:(e,t,{send:n})=>_z(()=>zz.getContentEl(e),{defer:!0,exclude:[zz.getTriggerEl(e)],onInteractOutside:e.onInteractOutside,onFocusOutside:e.onFocusOutside,onEscapeKeyDown(t){e.onEscapeKeyDown?.(t),e.isSubmenu&&t.preventDefault(),Gz(e)},onPointerDownOutside(t){e.restoreFocus=!t.detail.focusable,e.onPointerDownOutside?.(t)},onDismiss(){n({type:"CLOSE",src:"interact-outside"})}}),trackPointerMove(e,t,{guards:n,send:r}){const{isWithinPolygon:o}=n;e.parent.state.context.suspendPointer=!0;const i=zz.getDoc(e);return Oj(i,"pointermove",t=>{const n={x:t.clientX,y:t.clientY};o(e,{point:n})||(r("POINTER_MOVED_AWAY_FROM_SUBMENU"),e.parent.state.context.suspendPointer=!1)})},scrollToHighlightedItem(e,t,{getState:n}){const r=()=>{n().event.type.startsWith("ITEM_POINTER")||hj(zz.getHighlightedItemEl(e),{rootEl:zz.getContentEl(e),block:"nearest"})};return cj(()=>r()),dj(()=>zz.getContentEl(e),{attributes:["aria-activedescendant"],callback:r})}},actions:{setAnchorPoint(e,t){e.anchorPoint=t.point},clearAnchorPoint(e){e.anchorPoint=null},setSubmenuPlacement(e){e.isSubmenu&&(e.positioning.placement=e.isRtl?"left-start":"right-start",e.positioning.gutter=0)},reposition(e,t){const n=e.anchorPoint?()=>({width:0,height:0,...e.anchorPoint}):void 0;uz(zz.getTriggerEl(e),()=>zz.getPositionerEl(e),{...e.positioning,getAnchorRect:n,...t.options??{},listeners:!1,onComplete(t){e.currentPlacement=t.placement}})},setOptionState(e,t){if(!t.option)return;const{checked:n,onCheckedChange:r,type:o}=t.option;"radio"===o?r?.(!0):"checkbox"===o&&r?.(!n)},clickHighlightedItem(e,t,{send:n}){const r=zz.getHighlightedItemEl(e);if(!r||r.dataset.disabled)return;const o=zz.getOptionFromItemEl(r);n({type:"ITEM_CLICK",src:"enter",target:r,id:o.id,option:o,closeOnSelect:e.closeOnSelect})},setIntentPolygon(e,t){const n=zz.getContentEl(e),r=e.currentPlacement;if(!n||!r)return;const o=jz(n.getBoundingClientRect(),r);if(!o)return;const i="right"===function(e){return e.split("-")[0]}(r),a=i?-5:5;e.intentPolygon=[{...t.point,x:t.point.x+a},...o]},clearIntentPolygon(e){e.intentPolygon=null},resumePointer(e){e.parent&&(e.parent.state.context.suspendPointer=!1)},setHighlightedItem(e,t){Kz.highlighted(e,t.id)},clearHighlightedItem(e){Kz.highlighted(e,null)},focusMenu(e){cj(()=>{const t=zz.getContentEl(e),n=aj({root:t,enabled:!$U(t,zz.getActiveElement(e)),filter:e=>!e.role?.startsWith("menuitem")});n?.focus({preventScroll:!0})})},highlightFirstItem(e){const t=zz.getFirstEl(e);t&&Kz.highlighted(e,t.id)},highlightLastItem(e){const t=zz.getLastEl(e);t&&Kz.highlighted(e,t.id)},highlightNextItem(e,t){const n=zz.getNextEl(e,t.loop);Kz.highlighted(e,n?.id??null)},highlightPrevItem(e,t){const n=zz.getPrevEl(e,t.loop);Kz.highlighted(e,n?.id??null)},invokeOnSelect(e){e.highlightedValue&&e.onSelect?.({value:e.highlightedValue})},focusTrigger(e){e.isSubmenu||e.anchorPoint||!e.restoreFocus||cj(()=>zz.getTriggerEl(e)?.focus({preventScroll:!0}))},highlightMatchedItem(e,t){const n=zz.getElemByKey(e,t.key);n&&Kz.highlighted(e,n.id)},setParentMenu(e,t){e.parent=MM(t.value)},setChildMenu(e,t){e.children[t.id]=MM(t.value)},closeRootMenu(e){Gz(e)},openSubmenu(e){const t=zz.getHighlightedItemEl(e),n=t?.getAttribute("data-uid"),r=n?e.children[n]:null;r?.send("OPEN_AUTOFOCUS")},focusParentMenu(e){e.parent?.send("FOCUS_MENU")},setLastHighlightedItem(e,t){e.lastHighlightedValue=t.id},restoreHighlightedItem(e){e.lastHighlightedValue&&(Kz.highlighted(e,e.lastHighlightedValue),e.lastHighlightedValue=null)},restoreParentHiglightedItem(e){e.parent?.send("HIGHLIGHTED.RESTORE")},invokeOnOpen(e){e.onOpenChange?.({open:!0})},invokeOnClose(e){e.onOpenChange?.({open:!1})},toggleVisibility(e,t,{send:n}){n({type:e.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}})}(o()),{context:o});return{api:N(()=>Hz(i,a,OU)),machine:s}},[YH,ZH]=bH({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),[XH,QH]=bH({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1});var JH=Object.freeze({__proto__:null,Arrow:e=>{const t=$H(),n=_U(()=>t().getArrowProps(),e);return ie(CH.div,n)},ArrowTip:e=>{const t=$H(),n=_U(()=>t().getArrowTipProps(),e);return ie(CH.div,n)},CheckboxItem:e=>{const[t,n]=wH()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),r=_U(t,{type:"checkbox"}),o=$H(),i=_U(()=>o().getOptionItemProps(r),n),a=N(()=>o().getItemState(r));return ie(VH,{value:r,get children(){return ie(zH,{value:a,get children(){return ie(CH.div,i)}})}})},Content:e=>{const t=$H(),n=BH(),r=_U(()=>t().getContentProps(),()=>n().presenceProps,e);return ie(ve,{get when(){return!n().unmounted},get children(){return ie(CH.div,r)}})},Context:e=>e.children($H()),ContextTrigger:e=>{const t=$H(),n=_U(()=>t().getContextTriggerProps(),e);return ie(CH.button,n)},Indicator:e=>{const t=$H(),n=_U(()=>t().getIndicatorProps(),e);return ie(CH.div,n)},Item:e=>{const[t,n]=wH()(e,["closeOnSelect","disabled","value","valueText"]),r=$H(),o=_U(()=>r().getItemProps(t),n),i=N(()=>r().getItemState(t));return ie(zH,{value:i,get children(){return ie(CH.div,o)}})},ItemContext:e=>e.children(HH()),ItemGroup:e=>{const[t,n]=wH()(e,["id"]),r=_U({id:fe()},t),o=$H(),i=_U(()=>o().getItemGroupProps(r),n);return ie(qH,{value:r,get children(){return ie(CH.div,i)}})},ItemGroupLabel:e=>{const t=$H(),n=GH(),r=_U(t().getItemGroupLabelProps({htmlFor:n.id}),e);return ie(CH.div,r)},ItemIndicator:e=>{const t=$H(),n=WH(),r=_U(()=>t().getItemIndicatorProps(n),e);return ie(CH.div,r)},ItemText:e=>{const t=$H(),n=WH(),r=_U(()=>t().getItemTextProps(n),e);return ie(CH.div,r)},Positioner:e=>{const t=$H(),n=BH(),r=_U(()=>t().getPositionerProps(),e);return ie(ve,{get when(){return!n().unmounted},get children(){return ie(CH.div,r)}})},RadioItem:e=>{const[t,n]=wH()(e,["closeOnSelect","disabled","value","valueText"]),r=$H(),o=GH(),i=_U(t,()=>({type:"radio",checked:o.value===t.value,onCheckedChange:()=>o.onValueChange?.({value:t.value})})),a=_U(()=>r().getOptionItemProps(i),n),s=N(()=>r().getItemState(i));return ie(VH,{value:i,get children(){return ie(zH,{value:s,get children(){return ie(CH.div,a)}})}})},RadioItemGroup:e=>{const[t,n]=wH()(e,["id","onValueChange","value"]),r=$H(),o=_U({id:fe()},t),i=_U(()=>r().getItemGroupProps(o),n);return ie(qH,{value:o,get children(){return ie(CH.div,i)}})},Root:e=>{const[t,n]=IH(e),[r,o]=wH()(n,["anchorPoint","aria-label","closeOnSelect","composite","defaultOpen","highlightedValue","id","ids","loopFocus","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=$H(),a=ZH(),s=KH(r),l=NH(_U(t,()=>({present:s.api().open})));I(()=>{a&&(i?.().setChild(s.machine),s.api().setParent(a))});return ie(XH,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return ie(YH,{get value(){return s.machine},get children(){return ie(jH,{get value(){return s.api},get children(){return ie(RH,{value:l,get children(){return o.children}})}})}})}})},RootProvider:e=>{const t=$H(),n=ZH(),[r,o]=IH(e),i=NH(_U(r,()=>({present:o.value.api().open})));I(()=>{n&&(t?.().setChild(o.value.machine),o.value.api().setParent(n))});return ie(XH,{value:()=>t?.().getTriggerItemProps(o.value.api()),get children(){return ie(YH,{get value(){return o.value.machine},get children(){return ie(jH,{get value(){return o.value.api},get children(){return ie(RH,{value:i,get children(){return o.children}})}})}})}})},Separator:e=>{const t=$H(),n=_U(()=>t().getSeparatorProps(),e);return ie(CH.hr,n)},Trigger:e=>{const t=$H(),n=BH(),r=_U(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return ie(CH.button,r)},TriggerItem:e=>{const t=QH(),n=_U(()=>t?.(),e);return ie(CH.div,n)}});bH({hookName:"useNumberInputContext",providerName:"<NumberInputProvider />"}),bH({hookName:"usePaginationContext",providerName:"<PaginationProvider />"}),bH({hookName:"usePinInputContext",providerName:"<PinInputProvider />"}),bH({hookName:"usePopoverContext",providerName:"<PopoverProvider />"});const[eV,tV]=bH({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),nV=e=>{const t=PH(),n=TH(),r=fe(),o=N(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,...e})),[i,a]=LU(tH(o()),{context:o});return N(()=>function(e,t,n){const r=e.context.percent,o=e.context.max,i=e.context.min,a=e.context.orientation,s=e.context.translations,l=e.context.isIndeterminate,u=e.context.value,c=s.value({value:u,max:o,percent:r,min:i}),d=function(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}(u,o),p={role:"progressbar","aria-label":c,"data-max":o,"aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":u??void 0,"data-orientation":a,"data-state":d},f=function(e){const t={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}};return{root:{viewBox:"0 0 var(--size) var(--size)",style:{width:"var(--size)",height:"var(--size)"}},track:t,range:{opacity:0===e.value?0:void 0,style:{...t.style,"--percent":e.percent,"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100}))",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:e.isIndeterminate?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}(e.context);return{value:u,valueAsString:c,setValue(e){t({type:"VALUE.SET",value:e})},setToMax(){t({type:"VALUE.SET",value:o})},getRootProps:()=>n.element({dir:e.context.dir,...Qz.root.attrs,id:Jz.getRootId(e.context),"data-max":o,"data-value":u??void 0,"data-state":d,"data-orientation":a,style:{"--percent":l?void 0:r}}),getLabelProps:()=>n.element({dir:e.context.dir,id:Jz.getLabelId(e.context),...Qz.label.attrs,"data-orientation":a}),getValueTextProps:()=>n.element({dir:e.context.dir,"aria-live":"polite",...Qz.valueText.attrs}),getTrackProps:()=>n.element({dir:e.context.dir,id:Jz.getTrackId(e.context),...Qz.track.attrs,...p}),getRangeProps:()=>n.element({dir:e.context.dir,...Qz.range.attrs,"data-orientation":a,"data-state":d,style:{[e.context.isHorizontal?"width":"height"]:l?void 0:`${r}%`}}),getCircleProps:()=>n.element({dir:e.context.dir,id:Jz.getCircleId(e.context),...Qz.circle.attrs,...p,...f.root}),getCircleTrackProps:()=>n.element({dir:e.context.dir,"data-orientation":a,...Qz.circleTrack.attrs,...f.track}),getCircleRangeProps:()=>n.element({dir:e.context.dir,...Qz.circleRange.attrs,...f.range,"data-state":d}),getViewProps:t=>n.element({dir:e.context.dir,...Qz.view.attrs,"data-state":t.state,hidden:t.state!==d})}}(i,a,OU))};var rV=Object.freeze({__proto__:null,Circle:e=>{const t=tV(),n=_U(()=>t().getCircleProps(),e);return ie(CH.svg,n)},CircleRange:e=>{const t=tV(),n=_U(()=>t().getCircleRangeProps(),e);return ie(CH.circle,n)},CircleTrack:e=>{const t=tV(),n=_U(()=>t().getCircleTrackProps(),e);return ie(CH.circle,n)},Context:e=>e.children(tV()),Label:e=>{const t=tV(),n=_U(()=>t().getLabelProps(),e);return ie(CH.label,n)},Range:e=>{const t=tV(),n=_U(()=>t().getRangeProps(),e);return ie(CH.div,n)},Root:e=>{const[t,n]=wH()(e,["id","ids","max","min","orientation","translations","value"]),r=nV(t),o=_U(()=>r().getRootProps(),n);return ie(eV,{value:r,get children(){return ie(CH.div,o)}})},RootProvider:e=>{const[{value:t},n]=wH()(e,["value"]),r=_U(()=>t().getRootProps(),n);return ie(eV,{value:t,get children(){return ie(CH.div,r)}})},Track:e=>{const t=tV(),n=_U(()=>t().getTrackProps(),e);return ie(CH.div,n)},ValueText:e=>{const t=tV(),n=_U(()=>t().getValueTextProps(),e);return ie(CH.span,ce(n,{get children(){return e.children||t().valueAsString}}))},View:e=>{const[t,n]=wH()(e,["state"]),r=tV(),o=_U(()=>r().getViewProps(t),n);return ie(CH.span,o)}});bH({hookName:"useQrCodeContext",providerName:"<QrCodeProvider />"}),bH({hookName:"useRadioGroupContext",providerName:"<RadioGroupProvider />"}),bH({hookName:"useRadioGroupItemContext",providerName:"<RadioGroupItemProvider />"}),bH({hookName:"useRadioGroupItemPropsContext",providerName:"<RadioGroupItemPropsProvider />"}),bH({hookName:"useRatingGroupContext",providerName:"<RatingGroupProvider />"}),bH({hookName:"useRatingGroupItemContext",providerName:"<RatingGroupItemProvider />"}),bH({hookName:"useSegmentGroupContext",providerName:"<SegmentGroupProvider />"}),bH({hookName:"useSegmentGroupItemContext",providerName:"<SegmentGroupItemProvider />"}),bH({hookName:"useSegmentGroupItemPropsContext",providerName:"<SegmentGroupItemPropsProvider />"}),bH({hookName:"useSelectContext",providerName:"<SelectProvider />"}),bH({hookName:"useSelectItemContext",providerName:"<SelectItemProvider />"}),bH({hookName:"useSelectItemPropsContext",providerName:"<SelectItemPropsProvider />"}),bH({hookName:"useSelectItemGroupPropsContext",providerName:"<SelectItemGroupPropsProvider />"}),bH({hookName:"useSignaturePadContext",providerName:"<SignaturePadProvider />"});var oV=(e,t=[])=>({parts:(...n)=>{if(aV(t))return oV(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>oV(e,[...t,...n]),rename:e=>oV(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${iV(e)}"][data-part="${iV(n)}"]`,`& [data-scope="${iV(e)}"][data-part="${iV(n)}"]`].join(", "),attrs:{"data-scope":iV(e),"data-part":iV(n)}}}),{})}),iV=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),aV=e=>0===e.length;function sV(e,t){const n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;return n?(n[e]||(n[e]=t()),n[e]):t()}sV("__zag__proxyStateMap",()=>new WeakMap),sV("__zag__refSet",()=>new WeakSet),oV("signature-pad").parts("root","control","segment","segmentPath","guide","clearTrigger","label").build();var lV=fj({getRootId:e=>e.ids?.root??`signature-${e.id}`,getControlId:e=>e.ids?.control??`signature-control-${e.id}`,getHiddenInputId:e=>e.ids?.hiddenInput??`signature-input-${e.id}`,getControlEl:e=>lV.getById(e,lV.getControlId(e)),getSegmentEl:e=>function(e,t){return e?.querySelector(t)??null}(lV.getControlEl(e),"[data-part=segment]"),getHiddenInputEl:e=>lV.getById(e,lV.getHiddenInputId(e)),getDataUrl:(e,t)=>e.isEmpty?Promise.resolve(""):function(e,t){const{type:n,quality:r=.92}=t;if(!e)throw new Error("[get-data-url]: could not find the svg element");const o=HU(e),i=o.document,a='<?xml version="1.0" standalone="no"?>\r\n'+(new o.XMLSerializer).serializeToString(e),s="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(a);if("image/svg+xml"===n)return Promise.resolve(s);const l=e.getBoundingClientRect(),u=o.devicePixelRatio||1,c=i.createElement("canvas"),d=new o.Image;d.src=s,c.width=l.width*u,c.height=l.height*u;const p=c.getContext("2d");return p.scale(u,u),new Promise(e=>{d.onload=()=>{p.drawImage(d,0,0),e(c.toDataURL(n,r))}})}(lV.getSegmentEl(e),t)});EU()(["dir","disabled","getRootNode","id","ids","onDraw","onDrawEnd","readOnly","drawing","name"]),bH({hookName:"useSliderContext",providerName:"<SliderProvider />"}),bH({hookName:"useSliderThumbPropsContext",providerName:"<SliderThumbPropsProvider />"}),bH({hookName:"useSplitterContext",providerName:"<SplitterProvider />"}),bH({hookName:"useSwitchContext",providerName:"<SwitchProvider />"}),bH({hookName:"useTabsContext",providerName:"<TabsProvider />"}),bH({hookName:"useTagsInputContext",providerName:"<TagsInputProvider />"}),bH({hookName:"useTagsInputItemContext",providerName:"<TagsInputItemProvider />"}),bH({hookName:"useTagsInputItemPropsContext",providerName:"<TagsInputItemPropsProvider />"});const[uV,cV]=bH({hookName:"useToastContext",providerName:"<ToastProvider />"});var dV=De("<div><div></div><div>");const pV=e=>{const[t,n]=de(e,["toaster","children"]),[r,o]=LU(t.toaster.machine),i=r.context.placement,a=N(()=>yH.connect(r,o,OU)),s=N(()=>a().getToastsByPlacement(i)),l=_U(a().getGroupProps({placement:i}),n);return ie(CH.div,ce(l,{get children(){return ie(ge,{get each(){return s()},children:e=>ie(fV,{value:e,children:e=>t.children(e)})})}}))},fV=e=>{const[t,n]=[FU(r=e.value),r.send];var r;const o=N(()=>function(e,t,n){const r=e.hasTag("visible"),o=e.hasTag("paused"),i=e.context.placement,a=e.context.type,[s,l="center"]=i.split("-");return{type:a,title:e.context.title,description:e.context.description,placement:i,visible:r,paused:o,pause(){t("PAUSE")},resume(){t("RESUME")},dismiss(){t("DISMISS")},getRootProps:()=>n.element({...aH.root.attrs,dir:e.context.dir,id:sH.getRootId(e.context),"data-state":r?"open":"closed","data-type":a,"data-placement":i,"data-align":l,"data-side":s,"data-mounted":MU(e.context.mounted),"data-paused":MU(o),"data-first":MU(e.context.frontmost),"data-sibling":MU(!e.context.frontmost),"data-stack":MU(e.context.stacked),"data-overlap":MU(!e.context.stacked),role:"status","aria-atomic":"true",tabIndex:0,style:pH(e.context,r),onKeyDown(e){e.defaultPrevented||"Escape"==e.key&&(t("DISMISS"),e.preventDefault())}}),getGhostBeforeProps:()=>n.element({"data-ghost":"before",style:fH(e.context,r)}),getGhostAfterProps:()=>n.element({"data-ghost":"after",style:(e.context,{position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"})}),getTitleProps:()=>n.element({...aH.title.attrs,id:sH.getTitleId(e.context)}),getDescriptionProps:()=>n.element({...aH.description.attrs,id:sH.getDescriptionId(e.context)}),getActionTriggerProps:()=>n.button({...aH.actionTrigger.attrs,type:"button",onClick(e){e.defaultPrevented||t("DISMISS")}}),getCloseTriggerProps:()=>n.button({id:sH.getCloseTriggerId(e.context),...aH.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(e){e.defaultPrevented||t("DISMISS")}})}}(t,n,OU)),i=N(()=>t.context);return ie(uV,{value:o,get children(){return e.children(i)}})};var hV=Object.freeze({__proto__:null,ActionTrigger:e=>{const t=cV(),n=_U(()=>t().getActionTriggerProps(),e);return ie(CH.button,n)},CloseTrigger:e=>{const t=cV(),n=_U(()=>t().getCloseTriggerProps(),e);return ie(CH.button,n)},Context:e=>e.children(cV()),Description:e=>{const t=cV(),n=_U(()=>t().getDescriptionProps(),e);return ie(CH.div,n)},Root:e=>{const t=cV(),n=_U(()=>t().getRootProps(),e);return r=dV(),o=r.firstChild,i=o.nextSibling,Ne(r,n,!1,!0),Ne(o,ce(()=>t().getGhostBeforeProps()),!1,!1),Be(r,()=>e.children,i),Ne(i,ce(()=>t().getGhostAfterProps()),!1,!1),r;var r,o,i},Title:e=>{const t=cV(),n=_U(()=>t().getTitleProps(),e);return ie(CH.div,n)}});bH({hookName:"useToggleGroupContext",providerName:"<ToggleGroupProvider />"}),bH({hookName:"useTooltipContext",providerName:"<TooltipProvider />"}),bH({hookName:"useTreeViewBranchContext",providerName:"<TreeViewBranchProvider />"}),bH({hookName:"useTreeViewContext",providerName:"<TreeViewProvider />"}),bH({hookName:"useTreeViewDepthContext",providerName:"<TreeViewDepthProvider />"}),bH({hookName:"useTreeViewItemContext",providerName:"<TreeViewItemProvider />"}),bH({hookName:"useTreeViewItemPropsContext",providerName:"<TreeViewItemProvider />"});const gV=e=>ie(UH.Root,{get open(){return e.isOpen},lazyMount:!0,unmountOnExit:!0,onOpenChange:t=>t.open?void 0:e.onClose?.(),get children(){return[ie(UH.Backdrop,{class:"fixed inset-0 bg-[rgba(0,0,0,0.5)] h-screen z-50"}),ie(UH.Positioner,{class:"fixed inset-0 z-50 flex items-center justify-center px-2",get children(){return[ie(UH.Content,{get children(){return e.children}}),ie(UH.CloseTrigger,{class:"fixed top-2 right-2 z-50 rounded-md bg-white p-2 text-black",get children(){return ie(vt,{class:"w-4"})}})]}})]}}),mV=De('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4">'),vV=e=>(()=>{const t=mV();return Ne(t,e,!0,!0),t})(),yV=De('<div class="flex items-center gap-4 border bg-white border-gray-200 rounded-md p-2 text-gray-900 min-w-[250px]"><div></div><div class="flex flex-col"><span class="text-md font-normal text-sm"></span><span class="text-gray-500 text-xs">'),bV=e=>{const t=EV(e.file);return(()=>{const n=yV(),r=n.firstChild,o=r.nextSibling.firstChild,i=o.nextSibling;return Be(r,ie(vV,{class:"w-6 h-6"})),Be(o,()=>e.file.name),Be(i,()=>wV(e.file)),P(()=>Pe(r,it("rounded-md text-white p-2 flex items-center","pink"===t&&"bg-pink-400","blue"===t&&"bg-blue-400","green"===t&&"bg-green-400","gray"===t&&"bg-gray-400","orange"===t&&"bg-orange-400"))),n})()},wV=e=>{switch(e.name.split(".").pop()){case"pdf":return"PDF";case"doc":case"docx":return"Word";case"xls":case"xlsx":case"csv":return"Sheet";case"json":return"JSON";case"md":return"Markdown";default:return"DOCUMENT"}},EV=e=>{const t=e.name.split(".").pop();if(!t)return"gray";switch(t){case"pdf":return"pink";case"doc":case"docx":return"blue";case"xls":case"xlsx":case"csv":return"green";case"json":return"orange";default:return"gray"}},_V=De('<div class="flex justify-end items-end animate-fade-in gap-2">'),xV=De("<div>"),kV=De("<span>"),CV=De('<img alt="Attachment">'),SV=De('<div class="flex flex-col gap-1 items-end w-full"><div class="bubble bubble--guest whitespace-pre-wrap flex flex-col" data-testid="guest-bubble">'),TV=De("<img>"),DV=De('<div class="flex flex-col gap-1 items-end"><div class="bubble bubble--guest w-full w-whitespace-pre-wrap flex flex-col" data-testid="guest-bubble"><audio controls>'),AV=e=>(()=>{const t=_V();return Be(t,ie(ye,{get children(){return[ie(be,{get when(){return"text"===e.answer?.type},get children(){return ie(OV,{get answer(){return e.answer}})}}),ie(be,{get when(){return"recording"===e.answer?.type},get children(){return ie(PV,{get answer(){return e.answer}})}})]}}),null),Be(t,ie(ve,{get when(){return e.showAvatar},get children(){return ie(AM,{get initialAvatarSrc(){return e.avatarSrc}})}}),null),P(()=>null!=(e.hasHostAvatar?zi()?"28px":"50px":void 0)?t.style.setProperty("margin-left",e.hasHostAvatar?zi()?"28px":"50px":void 0):t.style.removeProperty("margin-left")),t})(),OV=e=>{const[t,n]=O();return(()=>{const r=SV(),o=r.firstChild;return Be(r,ie(ve,{get when(){return(e.answer.attachments??[]).length>0},get children(){return[(()=>{const t=xV();return Be(t,ie(ge,{get each(){return e.answer.attachments?.filter(e=>e.type.startsWith("image"))},children:(t,r)=>(()=>{const o=TV();return o.$$click=()=>n(t.url),P(n=>{const i=t.url,a=`Attached image ${r()+1}`,s=it("bubble bubble--guest cursor-pointer",e.answer.attachments.filter(e=>e.type.startsWith("image")).length>1&&"max-w-[90%]");return i!==n._v$&&Oe(o,"src",n._v$=i),a!==n._v$2&&Oe(o,"alt",n._v$2=a),s!==n._v$3&&Pe(o,n._v$3=s),n},{_v$:void 0,_v$2:void 0,_v$3:void 0}),o})()})),P(()=>Pe(t,it("flex gap-1 overflow-auto max-w-[350px]",zi()?"flex-wrap justify-end":"items-center"))),t})(),(()=>{const t=xV();return Be(t,ie(ge,{get each(){return e.answer.attachments?.filter(e=>!e.type.startsWith("image"))},children:e=>ie(bV,{get file(){return{name:e.url.split("/").at(-1)}}})})),P(()=>Pe(t,it("flex gap-1 overflow-auto max-w-[350px]",zi()?"flex-wrap justify-end":"items-center"))),t})()]}}),o),Be(o,ie(ve,{get when(){return nt(e.answer.label??e.answer.value)},get children(){const t=kV();return t.style.setProperty("overflow-wrap","break-word"),Be(t,()=>e.answer.label??e.answer.value),t}})),Be(r,ie(gV,{get isOpen(){return void 0!==t()},onClose:()=>n(void 0),get children(){const e=CV();return e.style.setProperty("border-radius","6px"),P(()=>Oe(e,"src",t())),e}}),null),r})()},PV=e=>(()=>{const t=DV(),n=t.firstChild.firstChild;return P(()=>Oe(n,"src",e.answer.url)),t})();Ae(["click"]);let IV=function(e){return e.COLOR="Color",e.IMAGE="Image",e.NONE="None",e}({});[{label:"Top",value:"top"},{label:"Bottom",value:"bottom"}].map(e=>e.value),[{label:"Fixed",value:"fixed"},{label:"Absolute",value:"absolute"}].map(e=>e.value);[{label:"None",value:"none"},{label:"M",value:"medium"},{label:"L",value:"large"},{label:"10",value:"custom"}].map(e=>e.value);const NV="Open Sans",RV="absolute",BV="large",FV="transparent",LV="#01a952",MV=!0,UV=!1,jV=e=>{const{chatChunks:t}=$i(),n=()=>t()[e.chunkIndex]?.input?.answer;return ie(ve,{get when(){return n()&&!e.hasError},get children(){return ie(AV,{get answer(){return n()},get showAvatar(){return e.guestAvatar?.isEnabled??UV},get avatarSrc(){return e.guestAvatar?.url&&e.guestAvatar.url},get hasHostAvatar(){return e.hasHostAvatar}})}})},$V=De("<div><div>"),zV=e=>{let t;const[n,r]=O(0),o=new ResizeObserver(e=>r(e[0].target.clientHeight-(zi()?24:40)));return B(()=>{t&&o.observe(t)}),F(()=>{t&&o.unobserve(t)}),(()=>{const r=$V(),o=r.firstChild;return"function"==typeof t?Re(t,r):t=r,Be(o,ie(AM,{get initialAvatarSrc(){return e.hostAvatarSrc}})),P(t=>{const i="flex flex-shrink-0 items-center relative bot-avatar-container "+(zi()?"w-6":"w-10"),a="absolute flex items-center top-0"+(zi()?" w-6 h-6":" w-10 h-10")+(e.hideAvatar?" opacity-0":" opacity-100"),s=`${n()}px`,l=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return i!==t._v$&&Pe(r,t._v$=i),a!==t._v$2&&Pe(o,t._v$2=a),s!==t._v$3&&(null!=(t._v$3=s)?o.style.setProperty("top",s):o.style.removeProperty("top")),l!==t._v$4&&(null!=(t._v$4=l)?o.style.setProperty("transition",l):o.style.removeProperty("transition")),t},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),r})()},HV=De('<div class="flex flex-col animate-fade-in"><div class="flex w-full items-center"><div class="flex relative items-start max-w-full"><div class="bubble bubble--host flex items-center absolute" data-testid="host-bubble"></div><div class="bubble flex flex-col overflow-hidden relative text-ellipsis h-full gap-6">'),VV=De("<span>"),WV=e=>{const[t,n]=Tn(O([]),{key:`bot-streaming-message-${e.streamingMessageId}`,storage:e.context.storage});return I(()=>{if(Li()?.id!==e.streamingMessageId)return[];n(Li()?.content.split("```").map((e,t)=>t%2==0?e.split("\n\n").map(e=>yL(e.replace(/【.+】/g,""),{format:"html",enableCodeBlocksMode:!1})):[yL("```"+e+"```",{format:"html",enableCodeBlocksMode:!1})]).flat().filter(nt)??[])}),(()=>{const e=HV(),n=e.firstChild.firstChild.firstChild,r=n.nextSibling;return n.style.setProperty("width","100%"),n.style.setProperty("height","100%"),Be(r,ie(ge,{get each(){return t()},children:e=>(()=>{const t=VV();return t.innerHTML=e,t})()})),e})()},qV=De('<div class="flex flex-col w-full min-w-0 gap-2"><div><div class="flex flex-col flex-1 gap-2 w-10">'),GV=De("<div>"),KV=e=>{let t;const{getDisplayedMessageIndex:n,setDisplayedMessageIndex:r}=$i(),[o,i]=O(),[a,s]=O(!1);I(()=>{e.isTransitionDisabled?(r(e.index,e.messages.length),s(!0)):a()||(r(e.index,0),s(!0))});const l=()=>n(e.index);B(()=>{e.streamingMessageId||(0===e.messages.length&&e.onAllBubblesDisplayed(),e.onScrollToBottom(t,50))});const u=async t=>{(e.settings.typingEmulation?.delayBetweenBubbles??un.delayBetweenBubbles)>0&&l()<e.messages.length-1&&await new Promise(t=>setTimeout(t,1e3*(e.settings.typingEmulation?.delayBetweenBubbles??un.delayBetweenBubbles)));const n=e.messages[l()].id;await e.onNewBubbleDisplayed(n),r(e.index,l()===e.messages.length?l():l()+1),e.onScrollToBottom(t),l()===e.messages.length&&(i(t),e.onAllBubblesDisplayed())};return(()=>{const n=qV(),r=n.firstChild,i=r.firstChild;return Be(r,ie(ve,{get when(){return(e.theme.chat?.hostAvatar?.isEnabled??MV)&&(e.messages.length>0||e.streamingMessageId)},get children(){return ie(zV,{get hostAvatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled}})}}),i),Be(i,ie(ve,{get when(){return e.messages.length>0},get children(){return ie(ge,{get each(){return e.messages.slice(0,l()+1)},children:(t,n)=>ie(kM,{message:t,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return N(()=>!(!(e.settings.typingEmulation?.isDisabledOnFirstMessage??un.isDisabledOnFirstMessage)||0!==e.index))()&&0===n()},get onTransitionEnd(){return e.isTransitionDisabled?void 0:u},get onCompleted(){return e.onSubmit}})})}}),null),Be(i,ie(ve,{get when(){return e.streamingMessageId},keyed:!0,children:t=>(()=>{const n=GV(),r=e.blockRef;return"function"==typeof r?Re(r,n):e.blockRef=n,Be(n,ie(WV,{streamingMessageId:t,get context(){return e.context}})),P(()=>null!=(e.theme.chat?.guestAvatar?.isEnabled?zi()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%")?n.style.setProperty("max-width",e.theme.chat?.guestAvatar?.isEnabled?zi()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%"):n.style.removeProperty("max-width")),n})()}),null),Be(n,ie(ve,{get when(){return l()===e.messages.length&&e.input},children:n=>ie(jV,{ref(e){"function"==typeof t?t(e):t=e},get block(){return n()},get chunkIndex(){return e.index},get hasHostAvatar(){return e.theme.chat?.hostAvatar?.isEnabled??MV},get guestAvatar(){return e.theme.chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??ln.isInputPrefillEnabled},get hasError(){return e.hasError},onTransitionEnd:()=>e.onScrollToBottom(o()),get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})}),null),P(()=>Pe(r,it("flex",zi()?"gap-1":"gap-2"))),n})()},YV=De('<div class="w-full max-w-xs p-4 bg-white shadow-lg rounded-lg flex flex-col gap-3 toast--popup-blocked border border-gray-200" role="alert"><div class="flex items-start gap-2"><div class="flex flex-col gap-1 flex-1"><div class="flex-shrink-0 mt-0.5"><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-orange-500" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg></div><span class="text-sm font-semibold text-gray-900">Popup blocked</span><div class="text-sm font-normal text-gray-600 leading-relaxed">The bot wants to open a new tab but it was blocked by your browser. It needs a manual approval.</div></div></div><a target="_blank" class="button justify-center text-sm font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 rounded-lg hover:opacity-90 active:scale-[0.98]" rel="noreferrer"><span>Continue in new tab</span><svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor"><path d="M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"></path><path d="M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z">'),ZV=e=>(()=>{const t=YV(),n=t.firstChild.nextSibling;return n.$$click=()=>e.onLinkClick(),P(()=>Oe(n,"href",e.url)),t})();Ae(["click"]);const XV=De('<div class="conversation-container__body flex flex-col overflow-y-auto w-full px-5 py-10 relative scroll-smooth gap-2 flex-[9]">'),QV=De('<div class="flex justify-end">'),JV=e=>{const{chatChunks:t,theme:n,hasError:r,blockRef:o,blockedPopupUrl:i,setBlockedPopupUrl:a,isSending:s,sendMessage:l,processClientSideActions:u,onBubblesDisplayed:c}=$i();let d,p;B(()=>{(async()=>{const e=t()[0];if(!e.clientSideActions)return;const n=e.clientSideActions.filter(e=>et(e.lastBubbleBlockId));await u(n)})()}),F(()=>{p&&clearTimeout(p)});const f=async()=>{const n=[...t()].pop();n&&(p&&clearTimeout(p),p=setTimeout(()=>{c(),p=void 0},300),et(n.input)&&e.onEnd?.())},h=async n=>{const r=[...t()].pop();if(!r)return;const o=r.messages.find(e=>e.id===n);if(o){if(e.onNewBlock&&e.onNewBlock({id:o.id,type:o.type}),r.clientSideActions){const e=r.clientSideActions.filter(e=>e.lastBubbleBlockId===n);await u(e)}}else console.warn(`Block with id "${n}" not found in messages`,{blockId:n,availableMessageIds:r.messages.map(e=>e.id),chunkIndex:t().length-1})},g=()=>l(void 0);return(()=>{const u=XV();return"function"==typeof d?Re(d,u):d=u,Be(u,ie(me,{get each(){return t()},children:(i,a)=>ie(KV,{blockRef:o,index:a,get messages(){return i().messages},get input(){return i().input},get theme(){return n()},get settings(){return e.initialChatReply.bot.settings},get streamingMessageId(){return i().streamingMessageId},get context(){return e.context},get hideAvatar(){return N(()=>!i().input)()&&((t()[a+1]?.messages??0).length>0||void 0!==t()[a+1]?.streamingMessageId||i().messages.length>0&&s())},get hasError(){return N(()=>!!r())()&&a===t().length-1},get isTransitionDisabled(){return a!==t().length-1},onNewBubbleDisplayed:h,onAllBubblesDisplayed:f,onSubmit:l,onScrollToBottom:(e,t)=>sn(d,e,t),onSkip:g})}),null),Be(u,ie(ve,{get when(){return i()},keyed:!0,children:e=>(()=>{const t=QV();return Be(t,ie(ZV,{url:e,onLinkClick:()=>a(void 0)})),t})()}),null),u})()},eW=De('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_7660_13477)"><path d="M24 0H0V24H24V0Z" fill="#5DDE8A"></path><path d="M0 0L7.00328 7.00328L8.30164 6.25574L10.9377 5.23279H12.8262L15.8951 5.98033L17.5475 8.18361L18.0984 9.83607L18.3738 12.3541L18.4918 13.6525L17.0754 16.6426H16.6426L24 24V0H0Z" fill="#5BCB82"></path><path d="M14.0853 18.2951H5.27222V9.67872C5.27222 7.12134 7.35746 5.07544 9.87549 5.07544H14.046C16.6034 5.07544 18.6493 7.16069 18.6493 9.67872V13.6918C18.6886 16.2099 16.6427 18.2951 14.0853 18.2951ZM6.49189 17.1148H14.1247C16.0132 17.1148 17.5476 15.5804 17.5476 13.6918V9.67872C17.5476 7.79019 16.0132 6.25577 14.1247 6.25577H9.91484C8.02631 6.25577 6.49189 7.79019 6.49189 9.67872V17.1148Z" fill="white"></path><path d="M11.9609 12.6295C12.4824 12.6295 12.9051 12.2067 12.9051 11.6852C12.9051 11.1637 12.4824 10.741 11.9609 10.741C11.4394 10.741 11.0166 11.1637 11.0166 11.6852C11.0166 12.2067 11.4394 12.6295 11.9609 12.6295Z" fill="white"></path><path d="M8.97063 12.6295C9.49213 12.6295 9.91489 12.2067 9.91489 11.6852C9.91489 11.1637 9.49213 10.741 8.97063 10.741C8.44913 10.741 8.02637 11.1637 8.02637 11.6852C8.02637 12.2067 8.44913 12.6295 8.97063 12.6295Z" fill="white"></path><path d="M15.0297 12.6295C15.5512 12.6295 15.974 12.2067 15.974 11.6852C15.974 11.1637 15.5512 10.741 15.0297 10.741C14.5082 10.741 14.0854 11.1637 14.0854 11.6852C14.0854 12.2067 14.5082 12.6295 15.0297 12.6295Z" fill="white"></path></g><defs><clipPath id="clip0_7660_13477"><path d="M0 1.62712C0 0.728487 0.728486 0 1.62712 0H22.3729C23.2715 0 24 0.728486 24 1.62712V22.3729C24 23.2715 23.2715 24 22.3729 24H1.62712C0.728487 24 0 23.2715 0 22.3729V1.62712Z" fill="white">'),tW=()=>eW(),nW=De('<a href="https://quick.bot/?utm_source=litebadge" target="_blank" rel="noopener noreferrer" class="!p-3 !bg-black/[0.04] !z-50 !border-t !border-black/[0.08] !text-black/60 !gap-2 !text-xs !leading-3 !h-10 !font-normal !opacity-100 !visible !flex !items-center !justify-center !no-underline hover:!bg-[#f7f8ff] [&amp;_svg]:!w-4 [&amp;_svg]:!h-4" id="lite-badge"><span>Powered by quick.bot'),rW=e=>{let t,n;const r=n=>{n.forEach(n=>{n.removedNodes.forEach(n=>{"id"in n&&t&&"lite-badge"==n.id&&(console.log("Sorry, you can't remove the brand 😅"),e.botContainer?.append(t))})})};return B(()=>{document&&e.botContainer&&(n=new MutationObserver(r),n.observe(e.botContainer,{subtree:!1,childList:!0}))}),F(()=>{n&&n.disconnect()}),(()=>{const e=nW(),n=e.firstChild;return"function"==typeof t?Re(t,e):t=e,Be(e,ie(tW,{}),n),e})()},oW=De('<div class="!p-3 !z-50 !text-black/60 !gap-2 !leading-3 !h-10 !font-normal !opacity-100 !visible !flex !items-center !justify-center !no-underline hover:!opacity-80"><span>The conversation has ended.'),iW=()=>oW(),aW=De('<textarea id="user-input" class="focus:outline-none bg-transparent flex-1 w-full resize-none overflow-hidden h-[25px]" data-testid="textarea" required>'),sW=e=>{const[t,n]=de(e,["ref","onInput","containerRef"]),r=e=>{const n=e.currentTarget;n.style.height="25px";const r=Math.max(25,Math.min(n.scrollHeight,150));n.style.height=`${r}px`,n.style.overflow=n.scrollHeight>150?"auto":"hidden",t.onInput(n.value)};return(()=>{const e=aW();e.$$input=r;const o=t.ref;return"function"==typeof o?Re(o,e):t.ref=e,Ne(e,ce({get autofocus(){return!zi()}},n),!1,!1),e})()};Ae(["input"]);const lW=De('<img class="rounded-md object-cover w-[58px] h-[58px]">'),uW=De('<div class="relative group flex-shrink-0"><button class="absolute -right-2 p-0.5 -top-2 rounded-full bg-gray-200 text-black border border-gray-400 opacity-1 sm:opacity-0 group-hover:opacity-100 transition-opacity" aria-label="Remove attachment">'),cW=De('<div class="absolute w-full h-full inset-0 bg-black/20 rounded-md">'),dW=e=>(()=>{const t=uW(),n=t.firstChild;return Be(t,ie(ye,{get children(){return[ie(be,{get when(){return e.file.type.startsWith("image")},get children(){const t=lW();return P(n=>{const r=URL.createObjectURL(e.file),o=e.file.name;return r!==n._v$&&Oe(t,"src",n._v$=r),o!==n._v$2&&Oe(t,"alt",n._v$2=o),n},{_v$:void 0,_v$2:void 0}),t}}),ie(be,{when:!0,get children(){return ie(bV,{get file(){return e.file}})}})]}}),n),n.addEventListener("click",e.onRemoveClick),Be(n,ie(vt,{class:"w-4"})),Be(t,ie(ve,{get when(){return Je(e.uploadProgressPercent)&&100!==e.uploadProgressPercent},get children(){return ie(pW,{get progressPercent(){return e.uploadProgressPercent}})}}),null),t})(),pW=e=>{const[t,n]=O(e.progressPercent??0);let r;return I(()=>{if(20===e.progressPercent){r=setInterval(()=>{t()<100&&n(e=>e+(Math.floor(10*Math.random())+1))},1e3)}}),F(()=>{clearInterval(r)}),(()=>{const e=cW();return Be(e,ie(rV.Root,{get value(){return t()},class:"flex items-center justify-center",get children(){return ie(rV.Circle,{get children(){return[ie(rV.CircleTrack,{}),ie(rV.CircleRange,{})]}})}})),e})()},fW=De('<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M8.99992 16V6.41407L5.70696 9.70704C5.31643 10.0976 4.68342 10.0976 4.29289 9.70704C3.90237 9.31652 3.90237 8.6835 4.29289 8.29298L9.29289 3.29298L9.36907 3.22462C9.76184 2.90427 10.3408 2.92686 10.707 3.29298L15.707 8.29298L15.7753 8.36915C16.0957 8.76192 16.0731 9.34092 15.707 9.70704C15.3408 10.0732 14.7618 10.0958 14.3691 9.7754L14.2929 9.70704L10.9999 6.41407V16C10.9999 16.5523 10.5522 17 9.99992 17C9.44764 17 8.99992 16.5523 8.99992 16Z">'),hW=e=>(()=>{const t=fW();return Ne(t,e,!0,!0),t})(),gW=De('<svg><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),mW=e=>(()=>{const t=gW();return Ne(t,ce(e,{get class(){return it("animate-spin h-6 w-6",e.class)},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t})(),vW=De("<button>"),yW=e=>{const t=$(()=>e.children),[n,r]=de(e,["disabled","class"]),o=e.isDisabled||e.isLoading;return(()=>{const i=vW();return Ne(i,ce(r,{disabled:o,get class(){return it("button focus:outline-none filter hover:brightness-90 active:brightness-75 disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 flex justify-center transition-all duration-300 w-auto",n.class)}}),!1,!0),Be(i,ie(ve,{get when(){return!e.isLoading},get fallback(){return ie(mW,{})},get children(){return t()}})),i})()},bW=e=>{const t=aM.NEXT_PUBLIC_BETA_ENV&&!!e?.children;return ie(yW,ce({type:"submit","aria-label":t?void 0:"Send",get class(){return it(t?"px-4":void 0,e.class)}},e,{get children(){return ie(ye,{get children(){return[ie(be,{when:!t,get children(){return ie(hW,{})}}),ie(be,{when:t,get children(){return e.children}})]}})}}))},wW=De('<form><div class="flex w-full h-full transition-all duration-100"></div><div class="flex-shrink-0">'),EW=e=>{const{children:t,onSubmit:n,buttonLabel:r,isDisabled:o=!1,class:i,customButton:a,isInputDisabled:s,hasError:l}=e;return(()=>{const e=wW(),u=e.firstChild,c=u.nextSibling;return e.addEventListener("submit",e=>{e.preventDefault(),n()}),Be(u,t),Be(c,ie(ve,{when:a,get fallback(){return ie(bW,{isDisabled:o,children:r})},children:a})),P(()=>Pe(e,it("input__field w-full flex gap-2 items-center border rounded-full px-5 py-2 pr-2 overflow-hidden",s?.()&&!l&&"opacity-50 pointer-events-none",i))),e})()},_W=e=>{const t=t=>{const{data:n}=t;n.isFromBot&&e(t)};B(()=>{window.addEventListener("message",t)}),F(()=>{window.removeEventListener("message",t)})},xW="Send";let kW=function(e){return e.TEXT="text input",e.NUMBER="number input",e.EMAIL="email input",e.URL="url input",e.DATE="date input",e.PHONE="phone number input",e.CHOICE="buttons input",e.RATING="rating input",e.FILE="file input",e}({});const CW={placeholder:"Type your answer..."},SW={isEnabled:!1},TW=De('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><circle cx="10" cy="12" r="2"></circle><path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22">'),DW=e=>(()=>{const t=TW();return Ne(t,e,!0,!0),t})(),AW=De('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'),OW=e=>(()=>{const t=AW();return Ne(t,e,!0,!0),t})(),PW=De('<input type="file" id="document-upload" multiple class="hidden">'),IW=De('<input type="file" id="photos-upload" accept="image/*, video/*" multiple class="hidden">'),NW=De('<label aria-label="Add attachments" for="document-upload">'),RW=De("<label> Document"),BW=De("<label> Photos & videos"),FW=e=>[(()=>{const t=PW();return t.addEventListener("change",t=>{t.currentTarget.files&&e.onNewFiles(t.currentTarget.files)}),t})(),(()=>{const t=IW();return t.addEventListener("change",t=>{t.currentTarget.files&&e.onNewFiles(t.currentTarget.files)}),t})(),ie(ye,{get children(){return[ie(be,{get when(){return zi()},get children(){const t=NW();return Be(t,ie(OW,{class:"w-5"})),P(()=>Pe(t,it("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class))),t}}),ie(be,{when:!0,get children(){return ie(JH.Root,{get children(){return[ie(JH.Trigger,{get class(){return it("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class)},"aria-label":"Add attachments",get children(){return ie(OW,{class:"w-5"})}}),ie(JH.Positioner,{get children(){return ie(JH.Content,{class:"p-3 gap-2 focus:outline-none",get children(){return[ie(JH.Item,{value:"document",asChild:e=>(()=>{const t=RW(),n=t.firstChild;return Ne(t,ce(e,{for:"document-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),Be(t,ie(vV,{class:"w-4"}),n),t})()}),ie(JH.Item,{value:"photos",asChild:e=>(()=>{const t=BW(),n=t.firstChild;return Ne(t,ce(e,{for:"photos-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),Be(t,ie(DW,{class:"w-4"}),n),t})()})]}})}})]}})}})]}})],LW=({newFile:e,existingFiles:t,onError:n})=>{const r=Ct("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE");if(r&&e.size>1024*r*1024)return void n({title:"File too large",description:`${e.name} is larger than ${r}MB`});if(0===t.length)return e;let o=e.name,i=1;for(;t.some(e=>e.name===o);){const t=e.name.lastIndexOf("."),n=-1!==t?e.name.slice(t):"";o=`${e.name.slice(0,t)}(${i})${n}`,i++}return new File([e],o,{type:e.type})},MW=(e=>{const t=yH.machine({id:"1",...e});return{...yH.connect(t,t.send,OU),machine:t}})({placement:"bottom-end",gap:24}),UW=async({apiHost:e,files:t,onUploadProgress:n})=>{const r=[];let o=0;for(const{input:i,file:a}of t){n&&n({progress:o/t.length*100,fileIndex:o}),o+=1;const{data:s}=await Qe({method:"POST",url:`${e}/api/v2/generate-upload-url`,body:{fileName:i.fileName,sessionId:i.sessionId,fileType:a.type}});if(s?.presignedUrl){const e=new FormData;Object.entries(s.formData).forEach(([t,n])=>{e.append(t,n)}),e.append("file",a);if(!(await fetch(s.presignedUrl,{method:"POST",body:e})).ok)continue;r.push({url:s.fileUrl,type:a.type})}}return r},jW=e=>{e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(e,t,n,r)=>t+t+n+n+r+r);const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:[0,0,0]},$W=e=>{if(!e)return[0,0,0];if(e.startsWith("#"))return jW(e);if(e.startsWith("rgba")||e.startsWith("rgb")){const t=e.match(/\d+(\.\d+)?/g);if(t&&t.length>=3)return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)]}return jW(e)},zW=e=>{if(!e)return 1;if(e.startsWith("rgba")){const t=e.match(/\d+(\.\d+)?/g);if(t&&t.length>=4)return parseFloat(t[3])}return 1},HW=e=>({rgb:$W(e),alpha:zW(e)}),VW=De('<div><button class="p-0.5 rounded-full" aria-label="Stop recording"></button><div class="relative flex w-full"><canvas class="w-full h-[56px]"></canvas><div class="absolute w-2 left-0 h-[56px] recorder__left-gradient"></div><div class="absolute w-3 right-0 h-[56px] recorder__right-gradient"></div></div><span class="flex-none w-[35px] font-bold text-sm">'),WW=e=>{const[t,n]=O(0);let r,o,i,a,s,l,u,c,d,p=[],f=0;const h=jW(e.buttonsTheme?.backgroundColor??LV).join(", "),g=()=>{if(!i||!r||!d)return;const e=performance.now(),t=e-d;d=e,i.clearRect(0,0,r.width,r.height),i.fillStyle=`rgba(${h}, 0.2)`;for(let e=0;e<(r.width+3)/6;e++){const t=6*e-f,n=.1*r.height,o=(r.height-n)/2;i.beginPath(),i.roundRect(t,o,3,n,5),i.fill()}i.fillStyle=`rgba(${h}, 1)`;for(let e=0;e<p.length;e++){const t=r.width+6*(e+1)-f,n=r.height*(p[e]/100),o=(r.height-n)/2;i.beginPath(),i.roundRect(t,o,3,n,5),i.fill()}f+=t/1e3*60,o=requestAnimationFrame(g)},m=()=>{i&&r&&i.clearRect(0,0,r.width,r.height),f=0,s?.disconnect(),s=void 0,l?.disconnect(),l=void 0,a?.close(),a=void 0,u?.getTracks().forEach(e=>e.stop()),u=void 0,p=[],clearTimeout(c),n(0),cancelAnimationFrame(o),e.onAbortRecording()};return I(()=>{"asking"===e.recordingStatus?(async()=>{r&&(u=await navigator.mediaDevices.getUserMedia({audio:!0}),e.onRecordingConfirmed(u),i||(i=r.getContext("2d")??void 0),c=setInterval(()=>{n(e=>e+1)},1e3),a=new AudioContext,s=await qW(a),l=a.createMediaStreamSource(u),l.connect(s),s.connect(a.destination),s.port.onmessage=e=>{6*((r.width+3)/6+p.length)<r.width+f&&p.push(Math.min(Math.max(e.data,5),90))},d=performance.now(),o=requestAnimationFrame(g))})():"stopped"===e.recordingStatus&&m()}),F(()=>{m()}),(()=>{const n=VW(),o=n.firstChild,i=o.nextSibling,a=i.firstChild,s=i.nextSibling;o.addEventListener("click",m),Be(o,ie(vt,{class:"w-4"}));return"function"==typeof r?Re(r,a):r=a,Be(s,()=>GW(t())),P(()=>Pe(n,it("w-full gap-2 items-center transition-opacity px-2 recorder","started"===e.recordingStatus?"opacity-1 flex":"opacity-0 hidden"))),n})()},qW=async e=>{const t=new Blob(['\nconst gainFactor = 3;\n\nclass VolumeProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n }\n\n process(inputs) {\n const input = inputs[0];\n if (input.length > 0) {\n const channelData = input[0];\n let sum = 0;\n for (let i = 0; i < channelData.length; i++) {\n sum += channelData[i] * channelData[i];\n }\n const rms = Math.sqrt(sum / channelData.length);\n this.port.postMessage(rms * 100 * gainFactor)\n }\n return true;\n }\n}\n\nregisterProcessor("volume-processor", VolumeProcessor);\n\n'],{type:"application/javascript"}),n=URL.createObjectURL(t);return await e.audioWorklet.addModule(n),new AudioWorkletNode(e,"volume-processor")},GW=e=>`${Math.floor(e/60)}:${(e%60).toString().padStart(2,"0")}`,KW=De('<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M15.7806 10.1963C16.1326 10.3011 16.3336 10.6714 16.2288 11.0234L16.1487 11.2725C15.3429 13.6262 13.2236 15.3697 10.6644 15.6299L10.6653 16.835H12.0833L12.2171 16.8486C12.5202 16.9106 12.7484 17.1786 12.7484 17.5C12.7484 17.8214 12.5202 18.0894 12.2171 18.1514L12.0833 18.165H7.91632C7.5492 18.1649 7.25128 17.8672 7.25128 17.5C7.25128 17.1328 7.5492 16.8351 7.91632 16.835H9.33527L9.33429 15.6299C6.775 15.3697 4.6558 13.6262 3.84992 11.2725L3.76984 11.0234L3.74445 10.8906C3.71751 10.5825 3.91011 10.2879 4.21808 10.1963C4.52615 10.1047 4.84769 10.2466 4.99347 10.5195L5.04523 10.6436L5.10871 10.8418C5.8047 12.8745 7.73211 14.335 9.99933 14.335C12.3396 14.3349 14.3179 12.7789 14.9534 10.6436L15.0052 10.5195C15.151 10.2466 15.4725 10.1046 15.7806 10.1963ZM12.2513 5.41699C12.2513 4.17354 11.2437 3.16521 10.0003 3.16504C8.75675 3.16504 7.74835 4.17343 7.74835 5.41699V9.16699C7.74853 10.4104 8.75685 11.418 10.0003 11.418C11.2436 11.4178 12.2511 10.4103 12.2513 9.16699V5.41699ZM13.5814 9.16699C13.5812 11.1448 11.9781 12.7479 10.0003 12.748C8.02232 12.748 6.41845 11.1449 6.41828 9.16699V5.41699C6.41828 3.43889 8.02221 1.83496 10.0003 1.83496C11.9783 1.83514 13.5814 3.439 13.5814 5.41699V9.16699Z">'),YW=e=>(()=>{const t=KW();return Ne(t,e,!0,!0),t})();var ZW={},XW=function(e,t){return XW=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},XW(e,t)};function QW(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}XW(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var JW=function(){return JW=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},JW.apply(this,arguments)};function eq(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function tq(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function nq(e,t){return function(n,r){t(n,r,e)}}function rq(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function oq(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function iq(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var aq=Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function sq(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||aq(t,e,n)}function lq(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function uq(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function cq(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(uq(arguments[t]));return e}function dq(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}function pq(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function fq(e){return this instanceof fq?(this.v=e,this):new fq(e)}function hq(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||s(e,t)})})}function s(e,t){try{!function(e){e.value instanceof fq?Promise.resolve(e.value.v).then(l,u):c(i[0][2],e)}(o[e](t))}catch(e){c(i[0][3],e)}}function l(e){s("next",e)}function u(e){s("throw",e)}function c(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function gq(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:fq(e[r](t)),done:!1}:o?o(t):t}:o}}function mq(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=lq(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,o){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,o,(t=e[n](t)).done,t.value)})}}}function vq(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var yq=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function bq(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&aq(t,e,n);return yq(t,e),t}function wq(e){return e&&e.__esModule?e:{default:e}}function Eq(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function _q(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function xq(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function kq(e,t,n){if(null!=t){if("object"!=typeof t)throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var Cq="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function Sq(e){function t(t){e.error=e.hasError?new Cq(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var r=e.stack.pop();try{var o=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(o).then(n,function(e){return t(e),n()})}catch(e){t(e)}}if(e.hasError)throw e.error}()}var Tq,Dq={__extends:QW,__assign:JW,__rest:eq,__decorate:tq,__param:nq,__metadata:rq,__awaiter:oq,__generator:iq,__createBinding:aq,__exportStar:sq,__values:lq,__read:uq,__spread:cq,__spreadArrays:dq,__spreadArray:pq,__await:fq,__asyncGenerator:hq,__asyncDelegator:gq,__asyncValues:mq,__makeTemplateObject:vq,__importStar:bq,__importDefault:wq,__classPrivateFieldGet:Eq,__classPrivateFieldSet:_q,__classPrivateFieldIn:xq,__addDisposableResource:kq,__disposeResources:Sq},Aq=Object.freeze({__proto__:null,__addDisposableResource:kq,get __assign(){return JW},__asyncDelegator:gq,__asyncGenerator:hq,__asyncValues:mq,__await:fq,__awaiter:oq,__classPrivateFieldGet:Eq,__classPrivateFieldIn:xq,__classPrivateFieldSet:_q,__createBinding:aq,__decorate:tq,__disposeResources:Sq,__esDecorate:function(e,t,n,r,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,u="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),p=!1,f=n.length-1;f>=0;f--){var h={};for(var g in r)h[g]="access"===g?{}:r[g];for(var g in r.access)h.access[g]=r.access[g];h.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var m=(0,n[f])("accessor"===l?{get:d.get,set:d.set}:d[u],h);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=a(m.get))&&(d.get=s),(s=a(m.set))&&(d.set=s),(s=a(m.init))&&o.unshift(s)}else(s=a(m))&&("field"===l?o.unshift(s):d[u]=s)}c&&Object.defineProperty(c,r.name,d),p=!0},__exportStar:sq,__extends:QW,__generator:iq,__importDefault:wq,__importStar:bq,__makeTemplateObject:vq,__metadata:rq,__param:nq,__propKey:function(e){return"symbol"==typeof e?e:"".concat(e)},__read:uq,__rest:eq,__runInitializers:function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0},__setFunctionName:function(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},__spread:cq,__spreadArray:pq,__spreadArrays:dq,__values:lq,default:Dq}),Oq=Fn(Aq),Pq={},Iq={},Nq={};function Rq(){if(Tq)return Nq;Tq=1,Object.defineProperty(Nq,"__esModule",{value:!0}),Nq.WebmBase=void 0;return Nq.WebmBase=class{constructor(e="Unknown",t=0){this.name=e,this.start=t}getType(){return"Unknown"}updateBySource(){}setSource(e){this.source=e,this.updateBySource()}updateByData(){}setData(e){this.data=e,this.updateByData()}getValue(){return this.data}setValue(e){this.setData(e)}},Nq}var Bq,Fq,Lq={},Mq={},Uq={};function jq(){return Bq||(Bq=1,Object.defineProperty(Uq,"__esModule",{value:!0}),Uq.SectionType=void 0,function(e){e.Container="Container",e.Uint="Uint",e.Int="Int",e.Float="Float",e.String="String",e.Date="Date",e.Binary="Binary"}(e||(Uq.SectionType=e={}))),Uq;var e}function $q(){if(Fq)return Mq;Fq=1,Object.defineProperty(Mq,"__esModule",{value:!0}),Mq.sections=void 0;const e=jq();return Mq.sections={172351395:{name:"EBML",type:e.SectionType.Container},646:{name:"EBMLVersion",type:e.SectionType.Uint},759:{name:"EBMLReadVersion",type:e.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:e.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:e.SectionType.Uint},642:{name:"DocType",type:e.SectionType.String},647:{name:"DocTypeVersion",type:e.SectionType.Uint},645:{name:"DocTypeReadVersion",type:e.SectionType.Uint},108:{name:"Void",type:e.SectionType.Binary},63:{name:"CRC-32",type:e.SectionType.Binary},190023271:{name:"SignatureSlot",type:e.SectionType.Container},16010:{name:"SignatureAlgo",type:e.SectionType.Uint},16026:{name:"SignatureHash",type:e.SectionType.Uint},16037:{name:"SignaturePublicKey",type:e.SectionType.Binary},16053:{name:"Signature",type:e.SectionType.Binary},15963:{name:"SignatureElements",type:e.SectionType.Container},15995:{name:"SignatureElementList",type:e.SectionType.Container},9522:{name:"SignedElement",type:e.SectionType.Binary},139690087:{name:"Segment",type:e.SectionType.Container},21863284:{name:"SeekHead",type:e.SectionType.Container},3515:{name:"Seek",type:e.SectionType.Container},5035:{name:"SeekID",type:e.SectionType.Binary},5036:{name:"SeekPosition",type:e.SectionType.Uint},88713574:{name:"Info",type:e.SectionType.Container},13220:{name:"SegmentUID",type:e.SectionType.Binary},13188:{name:"SegmentFilename",type:e.SectionType.String},1882403:{name:"PrevUID",type:e.SectionType.Binary},1868715:{name:"PrevFilename",type:e.SectionType.String},2013475:{name:"NextUID",type:e.SectionType.Binary},1999803:{name:"NextFilename",type:e.SectionType.String},1092:{name:"SegmentFamily",type:e.SectionType.Binary},10532:{name:"ChapterTranslate",type:e.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:e.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:e.SectionType.Uint},10661:{name:"ChapterTranslateID",type:e.SectionType.Binary},710577:{name:"TimecodeScale",type:e.SectionType.Uint},1161:{name:"Duration",type:e.SectionType.Float},1121:{name:"DateUTC",type:e.SectionType.Date},15273:{name:"Title",type:e.SectionType.String},3456:{name:"MuxingApp",type:e.SectionType.String},5953:{name:"WritingApp",type:e.SectionType.String},103:{name:"Timecode",type:e.SectionType.Uint},6228:{name:"SilentTracks",type:e.SectionType.Container},6359:{name:"SilentTrackNumber",type:e.SectionType.Uint},39:{name:"Position",type:e.SectionType.Uint},43:{name:"PrevSize",type:e.SectionType.Uint},35:{name:"SimpleBlock",type:e.SectionType.Binary},32:{name:"BlockGroup",type:e.SectionType.Container},33:{name:"Block",type:e.SectionType.Binary},34:{name:"BlockVirtual",type:e.SectionType.Binary},13729:{name:"BlockAdditions",type:e.SectionType.Container},38:{name:"BlockMore",type:e.SectionType.Container},110:{name:"BlockAddID",type:e.SectionType.Uint},37:{name:"BlockAdditional",type:e.SectionType.Binary},27:{name:"BlockDuration",type:e.SectionType.Uint},122:{name:"ReferencePriority",type:e.SectionType.Uint},123:{name:"ReferenceBlock",type:e.SectionType.Int},125:{name:"ReferenceVirtual",type:e.SectionType.Int},36:{name:"CodecState",type:e.SectionType.Binary},13730:{name:"DiscardPadding",type:e.SectionType.Int},14:{name:"Slices",type:e.SectionType.Container},104:{name:"TimeSlice",type:e.SectionType.Container},76:{name:"LaceNumber",type:e.SectionType.Uint},77:{name:"FrameNumber",type:e.SectionType.Uint},75:{name:"BlockAdditionID",type:e.SectionType.Uint},78:{name:"Delay",type:e.SectionType.Uint},79:{name:"SliceDuration",type:e.SectionType.Uint},72:{name:"ReferenceFrame",type:e.SectionType.Container},73:{name:"ReferenceOffset",type:e.SectionType.Uint},74:{name:"ReferenceTimeCode",type:e.SectionType.Uint},47:{name:"EncryptedBlock",type:e.SectionType.Binary},106212971:{name:"Tracks",type:e.SectionType.Container},46:{name:"TrackEntry",type:e.SectionType.Container},87:{name:"TrackNumber",type:e.SectionType.Uint},13253:{name:"TrackUID",type:e.SectionType.Uint},3:{name:"TrackType",type:e.SectionType.Uint},57:{name:"FlagEnabled",type:e.SectionType.Uint},8:{name:"FlagDefault",type:e.SectionType.Uint},5546:{name:"FlagForced",type:e.SectionType.Uint},28:{name:"FlagLacing",type:e.SectionType.Uint},11751:{name:"MinCache",type:e.SectionType.Uint},11768:{name:"MaxCache",type:e.SectionType.Uint},254851:{name:"DefaultDuration",type:e.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:e.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:e.SectionType.Float},4991:{name:"TrackOffset",type:e.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:e.SectionType.Uint},4974:{name:"Name",type:e.SectionType.String},177564:{name:"Language",type:e.SectionType.String},6:{name:"CodecID",type:e.SectionType.String},9122:{name:"CodecPrivate",type:e.SectionType.Binary},362120:{name:"CodecName",type:e.SectionType.String},13382:{name:"AttachmentLink",type:e.SectionType.Uint},1742487:{name:"CodecSettings",type:e.SectionType.String},1785920:{name:"CodecInfoURL",type:e.SectionType.String},438848:{name:"CodecDownloadURL",type:e.SectionType.String},42:{name:"CodecDecodeAll",type:e.SectionType.Uint},12203:{name:"TrackOverlay",type:e.SectionType.Uint},5802:{name:"CodecDelay",type:e.SectionType.Uint},5819:{name:"SeekPreRoll",type:e.SectionType.Uint},9764:{name:"TrackTranslate",type:e.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:e.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:e.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:e.SectionType.Binary},96:{name:"Video",type:e.SectionType.Container},26:{name:"FlagInterlaced",type:e.SectionType.Uint},5048:{name:"StereoMode",type:e.SectionType.Uint},5056:{name:"AlphaMode",type:e.SectionType.Uint},5049:{name:"OldStereoMode",type:e.SectionType.Uint},48:{name:"PixelWidth",type:e.SectionType.Uint},58:{name:"PixelHeight",type:e.SectionType.Uint},5290:{name:"PixelCropBottom",type:e.SectionType.Uint},5307:{name:"PixelCropTop",type:e.SectionType.Uint},5324:{name:"PixelCropLeft",type:e.SectionType.Uint},5341:{name:"PixelCropRight",type:e.SectionType.Uint},5296:{name:"DisplayWidth",type:e.SectionType.Uint},5306:{name:"DisplayHeight",type:e.SectionType.Uint},5298:{name:"DisplayUnit",type:e.SectionType.Uint},5299:{name:"AspectRatioType",type:e.SectionType.Uint},963876:{name:"ColourSpace",type:e.SectionType.Binary},1029411:{name:"GammaValue",type:e.SectionType.Float},230371:{name:"FrameRate",type:e.SectionType.Float},97:{name:"Audio",type:e.SectionType.Container},53:{name:"SamplingFrequency",type:e.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:e.SectionType.Float},31:{name:"Channels",type:e.SectionType.Uint},15739:{name:"ChannelPositions",type:e.SectionType.Binary},8804:{name:"BitDepth",type:e.SectionType.Uint},98:{name:"TrackOperation",type:e.SectionType.Container},99:{name:"TrackCombinePlanes",type:e.SectionType.Container},100:{name:"TrackPlane",type:e.SectionType.Container},101:{name:"TrackPlaneUID",type:e.SectionType.Uint},102:{name:"TrackPlaneType",type:e.SectionType.Uint},105:{name:"TrackJoinBlocks",type:e.SectionType.Container},109:{name:"TrackJoinUID",type:e.SectionType.Uint},64:{name:"TrickTrackUID",type:e.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:e.SectionType.Binary},70:{name:"TrickTrackFlag",type:e.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:e.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:e.SectionType.Binary},11648:{name:"ContentEncodings",type:e.SectionType.Container},8768:{name:"ContentEncoding",type:e.SectionType.Container},4145:{name:"ContentEncodingOrder",type:e.SectionType.Uint},4146:{name:"ContentEncodingScope",type:e.SectionType.Uint},4147:{name:"ContentEncodingType",type:e.SectionType.Uint},4148:{name:"ContentCompression",type:e.SectionType.Container},596:{name:"ContentCompAlgo",type:e.SectionType.Uint},597:{name:"ContentCompSettings",type:e.SectionType.Binary},4149:{name:"ContentEncryption",type:e.SectionType.Container},2017:{name:"ContentEncAlgo",type:e.SectionType.Uint},2018:{name:"ContentEncKeyID",type:e.SectionType.Binary},2019:{name:"ContentSignature",type:e.SectionType.Binary},2020:{name:"ContentSigKeyID",type:e.SectionType.Binary},2021:{name:"ContentSigAlgo",type:e.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:e.SectionType.Uint},206814059:{name:"Cues",type:e.SectionType.Container},59:{name:"CuePoint",type:e.SectionType.Container},51:{name:"CueTime",type:e.SectionType.Uint},55:{name:"CueTrackPositions",type:e.SectionType.Container},119:{name:"CueTrack",type:e.SectionType.Uint},113:{name:"CueClusterPosition",type:e.SectionType.Uint},112:{name:"CueRelativePosition",type:e.SectionType.Uint},50:{name:"CueDuration",type:e.SectionType.Uint},4984:{name:"CueBlockNumber",type:e.SectionType.Uint},106:{name:"CueCodecState",type:e.SectionType.Uint},91:{name:"CueReference",type:e.SectionType.Container},22:{name:"CueRefTime",type:e.SectionType.Uint},23:{name:"CueRefCluster",type:e.SectionType.Uint},4959:{name:"CueRefNumber",type:e.SectionType.Uint},107:{name:"CueRefCodecState",type:e.SectionType.Uint},155296873:{name:"Attachments",type:e.SectionType.Container},8615:{name:"AttachedFile",type:e.SectionType.Container},1662:{name:"FileDescription",type:e.SectionType.String},1646:{name:"FileName",type:e.SectionType.String},1632:{name:"FileMimeType",type:e.SectionType.String},1628:{name:"FileData",type:e.SectionType.Binary},1710:{name:"FileUID",type:e.SectionType.Uint},1653:{name:"FileReferral",type:e.SectionType.Binary},1633:{name:"FileUsedStartTime",type:e.SectionType.Uint},1634:{name:"FileUsedEndTime",type:e.SectionType.Uint},4433776:{name:"Chapters",type:e.SectionType.Container},1465:{name:"EditionEntry",type:e.SectionType.Container},1468:{name:"EditionUID",type:e.SectionType.Uint},1469:{name:"EditionFlagHidden",type:e.SectionType.Uint},1499:{name:"EditionFlagDefault",type:e.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:e.SectionType.Uint},54:{name:"ChapterAtom",type:e.SectionType.Container},13252:{name:"ChapterUID",type:e.SectionType.Uint},5716:{name:"ChapterStringUID",type:e.SectionType.String},17:{name:"ChapterTimeStart",type:e.SectionType.Uint},18:{name:"ChapterTimeEnd",type:e.SectionType.Uint},24:{name:"ChapterFlagHidden",type:e.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:e.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:e.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:e.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:e.SectionType.Uint},15:{name:"ChapterTrack",type:e.SectionType.Container},9:{name:"ChapterTrackNumber",type:e.SectionType.Uint},0:{name:"ChapterDisplay",type:e.SectionType.Container},5:{name:"ChapString",type:e.SectionType.String},892:{name:"ChapLanguage",type:e.SectionType.String},894:{name:"ChapCountry",type:e.SectionType.String},10564:{name:"ChapProcess",type:e.SectionType.Container},10581:{name:"ChapProcessCodecID",type:e.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:e.SectionType.Binary},10513:{name:"ChapProcessCommand",type:e.SectionType.Container},10530:{name:"ChapProcessTime",type:e.SectionType.Uint},10547:{name:"ChapProcessData",type:e.SectionType.Binary},39109479:{name:"Tags",type:e.SectionType.Container},13171:{name:"Tag",type:e.SectionType.Container},9152:{name:"Targets",type:e.SectionType.Container},10442:{name:"TargetTypeValue",type:e.SectionType.Uint},9162:{name:"TargetType",type:e.SectionType.String},9157:{name:"TagTrackUID",type:e.SectionType.Uint},9161:{name:"TagEditionUID",type:e.SectionType.Uint},9156:{name:"TagChapterUID",type:e.SectionType.Uint},9158:{name:"TagAttachmentUID",type:e.SectionType.Uint},10184:{name:"SimpleTag",type:e.SectionType.Container},1443:{name:"TagName",type:e.SectionType.String},1146:{name:"TagLanguage",type:e.SectionType.String},1156:{name:"TagDefault",type:e.SectionType.Uint},1159:{name:"TagString",type:e.SectionType.String},1157:{name:"TagBinary",type:e.SectionType.Binary},5552:{name:"Colour",type:e.SectionType.Container},5553:{name:"MatrixCoefficients",type:e.SectionType.Uint},5554:{name:"BitsPerChannel",type:e.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:e.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:e.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:e.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:e.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:e.SectionType.Uint},5560:{name:"ChromaSitingVert",type:e.SectionType.Uint},5561:{name:"Range",type:e.SectionType.Uint},5562:{name:"TransferCharacteristics",type:e.SectionType.Uint},5563:{name:"Primaries",type:e.SectionType.Uint},5564:{name:"MaxCLL",type:e.SectionType.Uint},5565:{name:"MaxFALL",type:e.SectionType.Uint}},Mq}var zq,Hq={};function Vq(){if(zq)return Hq;zq=1,Object.defineProperty(Hq,"__esModule",{value:!0}),Hq.WebmUint=void 0;const e=Rq();function t(e){return e.length%2==1?"0"+e:e}let n=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"Uint"}updateBySource(){this.data="";for(let e=0;e<this.source.length;e++){const n=this.source[e].toString(16);this.data+=t(n)}}updateByData(){const e=this.data.length/2;this.source=new Uint8Array(e);for(let t=0;t<e;t++){const e=this.data.substring(2*t,2*t+2);this.source[t]=parseInt(e,16)}}getValue(){return parseInt(this.data,16)}setValue(e){this.setData(t(e.toString(16)))}};return Hq.WebmUint=n,Hq}var Wq,qq={};function Gq(){if(Wq)return qq;Wq=1,Object.defineProperty(qq,"__esModule",{value:!0}),qq.WebmFloat=void 0;const e=Rq();let t=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"Float"}getFloatArrayType(){return this.source&&4===this.source.length?Float32Array:Float64Array}updateBySource(){const e=this.source.reverse(),t=new(this.getFloatArrayType())(e.buffer);this.data=t[0]}updateByData(){const e=new(this.getFloatArrayType())([this.data]),t=new Uint8Array(e.buffer);this.source=t.reverse()}};return qq.WebmFloat=t,qq}var Kq,Yq,Zq={};function Xq(){if(Kq)return Zq;Kq=1,Object.defineProperty(Zq,"__esModule",{value:!0}),Zq.WebmString=void 0;const e=Rq();let t=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"String"}updateBySource(){this.data=this.source}updateByData(){this.source=this.data}getValue(){let e="";return this.source.forEach(t=>{e+=String.fromCharCode(t)}),e}};return Zq.WebmString=t,Zq}function Qq(){if(Yq)return Lq;Yq=1,Object.defineProperty(Lq,"__esModule",{value:!0}),Lq.WebmContainer=void 0;const e=Rq(),t=$q(),n=jq(),r=Vq(),o=Gq(),i=Xq();let a=class a extends e.WebmBase{constructor(e,t=!1,n=0){super(e,n),this.isInfinite=t,this.offset=0}getType(){return"Container"}readByte(){return this.source[this.offset++]}readUint(){const e=this.readByte(),t=8-e.toString(2).length;let n=e-(1<<7-t);for(let e=0;e<t;e++)n<<=8,n|=this.readByte();return n}updateBySource(){var s;let l;for(this.data=[],this.offset=0;this.offset<this.source.length;this.offset=l){const u=this.offset,c=this.readUint(),{name:d,type:p}=null!==(s=t.sections[c])&&void 0!==s?s:{},f=this.readUint();l=this.source.length,f>=0&&(l=Math.min(this.offset+f,l));const h=this.source.slice(this.offset,l);let g;switch(p){case n.SectionType.Container:g=new a(d,f<0,u);break;case n.SectionType.Uint:g=new r.WebmUint(d,u);break;case n.SectionType.Float:g=new o.WebmFloat(d,u);break;case n.SectionType.String:g=new i.WebmString(d,u);break;default:g=new e.WebmBase(d,u)}g.setSource(h),this.data.push({id:c,idHex:c.toString(16),data:g})}}writeUint(e,t=!1){let n;for(n=1;(e<0||e>=1<<7*n)&&n<8;n++);if(!t){for(let t=0;t<n;t++)this.source[this.offset+t]=e>>8*(n-1-t)&255;this.source[this.offset]&=(1<<8-n)-1,this.source[this.offset]|=1<<8-n}this.offset+=n}writeSections(e=!1){this.offset=0;for(let t=0;t<this.data.length;t++){const n=this.data[t],r=n.data.source,o=r.length;this.writeUint(n.id,e),this.writeUint(n.data instanceof a&&n.data.isInfinite?-1:o,e),e||this.source.set(r,this.offset),this.offset+=o}return this.offset}updateByData(){const e=this.writeSections(!0);this.source=new Uint8Array(e),this.writeSections()}getSectionById(e){for(let t=0;t<this.data.length;t++){const n=this.data[t];if(n.id===e)return n.data}return null}};return Lq.WebmContainer=a,Lq}var Jq,eG={};var tG,nG,rG={};function oG(){return nG||(nG=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Oq;t.__exportStar(Rq(),e),t.__exportStar(Qq(),e),t.__exportStar(function(){if(Jq)return eG;Jq=1,Object.defineProperty(eG,"__esModule",{value:!0}),eG.WebmFile=void 0;const e=Oq,t=Qq();let n=class n extends t.WebmContainer{constructor(e){super("File"),this.setSource(e)}getType(){return"File"}toBlob(e="video/webm"){return new Blob([this.source.buffer],{type:e})}static blobToArray(e){return new Promise((t,n)=>{try{const r=new FileReader;r.onloadend=()=>{try{t(new Uint8Array(r.result))}catch(e){n(e)}},r.readAsArrayBuffer(e)}catch(e){n(e)}})}static fromBlob(t){return e.__awaiter(this,void 0,void 0,function*(){const e=yield n.blobToArray(t);return new n(e)})}};return eG.WebmFile=n,eG}(),e),t.__exportStar(Gq(),e),t.__exportStar(Xq(),e),t.__exportStar(Vq(),e),t.__exportStar(jq(),e),t.__exportStar((tG||(tG=1,Object.defineProperty(rG,"__esModule",{value:!0})),rG),e),t.__exportStar($q(),e)}(Iq)),Iq}var iG,aG,sG={};function lG(){if(iG)return sG;iG=1,Object.defineProperty(sG,"__esModule",{value:!0}),sG.fixParsedWebmDuration=void 0;const e=oG();return sG.fixParsedWebmDuration=(t,n,r={})=>{let o=r.logger;void 0===o?o=e=>console.debug(e):o||(o=()=>{});const i=t.getSectionById(139690087);if(!i)return o("[fix-webm-duration] Segment section is missing"),!1;const a=i.getSectionById(88713574);if(!a)return o("[fix-webm-duration] Info section is missing"),!1;const s=a.getSectionById(710577);if(!s)return o("[fix-webm-duration] TimecodeScale section is missing"),!1;let l=a.getSectionById(1161);if(l){if(!(l.getValue()<=0))return o(`[fix-webm-duration] Duration section is present, and the value is ${l.getValue()}`),!1;o(`[fix-webm-duration] Duration section is present, but the value is ${l.getValue()}`),l.setValue(n)}else o("[fix-webm-duration] Duration section is missing"),l=new e.WebmFloat("Duration"),l.setValue(n),a.data.push({id:1161,data:l});return s.setValue(1e6),a.updateByData(),i.updateByData(),t.updateByData(),!0},sG}!function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Oq;t.__exportStar(function(){if(aG)return Pq;aG=1,Object.defineProperty(Pq,"__esModule",{value:!0}),Pq.fixWebmDuration=void 0;const e=Oq,t=oG(),n=lG();return Pq.fixWebmDuration=(r,o,i)=>e.__awaiter(void 0,void 0,void 0,function*(){try{const e=yield t.WebmFile.fromBlob(r);if((0,n.fixParsedWebmDuration)(e,o,i))return e.toBlob(r.type)}catch(e){}return r}),Pq}(),e),t.__exportStar(lG(),e)}(ZW);const uG=De('<div class="p-2 flex gap-2 border-gray-100 overflow-auto">'),cG=De('<div class="flex justify-between h-full max-h-[150px] items-center">'),dG=De("<div>"),pG=e=>{const[t,n]=O(e.defaultValue??""),[r,o]=O([]),[i,a]=O(void 0),[s,l]=O(!1),[u,c]=O("stopped");let d,p,f,h=[];const g=e=>n(e),m=async()=>{if("started"===u()&&f)f.stop();else if(""!==d?.value&&d?.reportValidity()){let n;if(r().length>0){a(void 0);const t=await UW({apiHost:e.context.apiHost??St({ignoreChatApiUrl:!0}),files:r().map(t=>({file:t,input:{sessionId:e.context.sessionId,fileName:t.name}})),onUploadProgress:a});n=t?.filter(Je)}e.onSubmit({type:"text",value:d?.value??t(),attachments:n})}else d?.focus()},v=e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),m())};B(()=>{!zi()&&d&&d.focus({preventScroll:!0})}),_W(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)});const y=e=>{e.preventDefault(),l(!0)},b=()=>l(!1),w=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer?.files&&E(e.dataTransfer.files)},E=e=>{const t=Array.from(e).map(e=>LW({existingFiles:r(),newFile:e,onError:({description:e,title:t})=>{MW.create({description:e,title:t})}})).filter(Je);0!==t.length&&o(e=>[...t,...e])},_=()=>{c("asking")},x=t=>{let n;const r=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";f=new MediaRecorder(t,{mimeType:r}),f.ondataavailable=e=>{0!==e.data.size&&h.push(e.data)},f.onstart=()=>{n=Date.now()},f.onstop=async()=>{if("started"!==u()||0===h.length)return;const t=Date.now()-n,o=await ZW.fixWebmDuration(new Blob(h,{type:r}),t),i=new File([o],`rec-${e.block.id}-${Date.now()}.${"audio/webm"===r?"webm":"mp4"}`,{type:r});a(void 0);const s=(await UW({apiHost:e.context.apiHost??St({ignoreChatApiUrl:!0}),files:[{file:i,input:{sessionId:e.context.sessionId,fileName:i.name}}],onUploadProgress:a})).filter(Je).map(e=>e.url);e.onSubmit({type:"recording",url:s[0]})},f.start(),c("started")},k=()=>{f?.stop(),c("stopped"),f=void 0,h=[]},C=Boolean(i()),S=ie(ye,{get children(){return[ie(be,{get when(){return!t()&&"started"!==u()&&e.block.options?.audioClip?.isEnabled},get children(){return ie(yW,{"on:click":_,"aria-label":"Record voice",get children(){return ie(YW,{})}})}}),ie(be,{when:!0,get children(){return ie(bW,{isDisabled:C,get children(){return e.block.options?.labels?.button}})}})]}});return ie(EW,{onSubmit:m,customButton:S,class:"items-end",get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){const n=dG();return n.addEventListener("dragleave",b),n.addEventListener("dragover",y),n.addEventListener("drop",w),Be(n,ie(WW,{get recordingStatus(){return u()},get buttonsTheme(){return e.context.bot.theme.chat?.buttons},onRecordingConfirmed:x,onAbortRecording:k}),null),Be(n,ie(ve,{get when(){return"started"!==u()},get children(){return[ie(ve,{get when(){return r().length},get children(){const e=uG();return e.style.setProperty("border-bottom-width","1px"),Be(e,ie(ge,{get each(){return r()},children:(e,t)=>ie(dW,{file:e,get uploadProgressPercent(){return N(()=>!!i())()?N(()=>i()?.fileIndex===t())()?20:t()<(i()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>(e=>{o(t=>t.filter((t,n)=>n!==e))})(t())})})),e}}),(()=>{const n=cG();return"function"==typeof p?Re(p,n):p=n,Be(n,ie(sW,{containerRef:p,ref(e){"function"==typeof d?d(e):d=e},onInput:g,onKeyDown:v,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??CW.placeholder}}),null),Be(n,ie(ve,{get when(){return(e.block.options?.attachments?.isEnabled??SW.isEnabled)&&e.block.options?.attachments?.saveVariableId},get children(){return ie(FW,{onNewFiles:E,class:"ml-2"})}}),null),n})()]}}),null),P(()=>Pe(n,it("flex-col w-full relative",s()&&"filter brightness-95"))),n}})},fG={placeholder:"Type a number..."},hG=De('<input class="focus:outline-none bg-transparent flex-1 w-full" type="number">'),gG=e=>{const[t,n]=O(e.defaultValue??""),[r,o,i]=[R(a=()=>t()),function(e){I(function(){const t=a();if(null==t)return void(e.value=t);const n=e.value;(0===t&&""===n||t!=n)&&(e.value=t+"")})},function(e){return e.validity.badInput?a():""!=e.value?e.valueAsNumber:void 0}];var a;let s;const l=()=>{""!==s?.value&&s?.reportValidity()?e.onSubmit({type:"text",value:s?.value??t().toString()}):s?.focus()},u=e=>{"Enter"===e.key&&(e.preventDefault(),l())};return _W(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)}),B(()=>{!zi()&&s&&s.focus({preventScroll:!0})}),ie(EW,{onSubmit:l,get buttonLabel(){return e.block.options?.labels?.button},get children(){const t=hG();t.$$keydown=u,t.$$input=e=>{n(i(e.currentTarget))},Re(o,t,()=>!0);return"function"==typeof s?Re(s,t):s=t,t.style.setProperty("font-size","16px"),t.style.setProperty("appearance","auto"),t.value=r,P(n=>{const r=e.block.options?.labels?.placeholder??fG.placeholder,o=e.block.options?.min,i=e.block.options?.max,a=e.block.options?.step??"any";return r!==n._v$&&Oe(t,"placeholder",n._v$=r),o!==n._v$2&&Oe(t,"min",n._v$2=o),i!==n._v$3&&Oe(t,"max",n._v$3=i),a!==n._v$4&&Oe(t,"step",n._v$4=a),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t}})};Ae(["input","keydown"]);const mG=De('<input class="focus:outline-none bg-transparent flex-1 w-full" type="text">'),vG=e=>{const[t,n]=de(e,["ref","onInput"]);return(()=>{const r=mG();r.$$input=e=>t.onInput(e.currentTarget.value);const o=e.ref;return"function"==typeof o?Re(o,r):e.ref=r,r.style.setProperty("font-size","16px"),Ne(r,n,!1,!1),r})()};Ae(["input"]);const yG={placeholder:"Type your email..."},bG=e=>{const[t,n]=O(e.defaultValue??"");let r;const o=e=>n(e),i=()=>{""!==r?.value&&r?.reportValidity()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},a=e=>{"Enter"===e.key&&(e.preventDefault(),i())};return _W(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)}),B(()=>{!zi()&&r&&r.focus({preventScroll:!0})}),ie(EW,{onSubmit:i,get buttonLabel(){return e.block.options?.labels?.button},get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){return ie(vG,{ref(e){"function"==typeof r?r(e):r=e},type:"email",autocomplete:"email",get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??yG.placeholder},onInput:o,onKeyDown:a})}})},wG={placeholder:"Type a URL..."},EG=e=>{const[t,n]=O(e.defaultValue??"");let r;const o=e=>{n(e)},i=()=>{r&&!r?.value.startsWith("http")&&(r.value=`https://${r.value}`),""!==r?.value&&r?.reportValidity()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},a=e=>{"Enter"===e.key&&(e.preventDefault(),i())};return _W(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)}),B(()=>{!zi()&&r&&r.focus({preventScroll:!0})}),ie(EW,{onSubmit:i,get buttonLabel(){return e.block.options?.labels?.button},get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){return ie(vG,{ref(e){"function"==typeof r?r(e):r=e},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??wG.placeholder},onInput:o,onKeyDown:a,type:"url",autocomplete:"url"})}})},_G=De('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9">'),xG=e=>(()=>{const t=_G();return Ne(t,e,!0,!0),t})(),kG=[{name:"International",flag:"🌐",code:"INT",dial_code:null},{name:"Afghanistan",flag:"🇦🇫",code:"AF",dial_code:"+93"},{name:"Åland Islands",flag:"🇦🇽",code:"AX",dial_code:"+358"},{name:"Albania",flag:"🇦🇱",code:"AL",dial_code:"+355"},{name:"Algeria",flag:"🇩🇿",code:"DZ",dial_code:"+213"},{name:"American Samoa",flag:"🇦🇸",code:"AS",dial_code:"+1684"},{name:"Andorra",flag:"🇦🇩",code:"AD",dial_code:"+376"},{name:"Angola",flag:"🇦🇴",code:"AO",dial_code:"+244"},{name:"Anguilla",flag:"🇦🇮",code:"AI",dial_code:"+1264"},{name:"Antarctica",flag:"🇦🇶",code:"AQ",dial_code:"+672"},{name:"Antigua and Barbuda",flag:"🇦🇬",code:"AG",dial_code:"+1268"},{name:"Argentina",flag:"🇦🇷",code:"AR",dial_code:"+54"},{name:"Armenia",flag:"🇦🇲",code:"AM",dial_code:"+374"},{name:"Aruba",flag:"🇦🇼",code:"AW",dial_code:"+297"},{name:"Australia",flag:"🇦🇺",code:"AU",dial_code:"+61"},{name:"Austria",flag:"🇦🇹",code:"AT",dial_code:"+43"},{name:"Azerbaijan",flag:"🇦🇿",code:"AZ",dial_code:"+994"},{name:"Bahamas",flag:"🇧🇸",code:"BS",dial_code:"+1242"},{name:"Bahrain",flag:"🇧🇭",code:"BH",dial_code:"+973"},{name:"Bangladesh",flag:"🇧🇩",code:"BD",dial_code:"+880"},{name:"Barbados",flag:"🇧🇧",code:"BB",dial_code:"+1246"},{name:"Belarus",flag:"🇧🇾",code:"BY",dial_code:"+375"},{name:"Belgium",flag:"🇧🇪",code:"BE",dial_code:"+32"},{name:"Belize",flag:"🇧🇿",code:"BZ",dial_code:"+501"},{name:"Benin",flag:"🇧🇯",code:"BJ",dial_code:"+229"},{name:"Bermuda",flag:"🇧🇲",code:"BM",dial_code:"+1441"},{name:"Bhutan",flag:"🇧🇹",code:"BT",dial_code:"+975"},{name:"Bolivia, Plurinational State of bolivia",flag:"🇧🇴",code:"BO",dial_code:"+591"},{name:"Bosnia and Herzegovina",flag:"🇧🇦",code:"BA",dial_code:"+387"},{name:"Botswana",flag:"🇧🇼",code:"BW",dial_code:"+267"},{name:"Bouvet Island",flag:"🇧🇻",code:"BV",dial_code:"+47"},{name:"Brazil",flag:"🇧🇷",code:"BR",dial_code:"+55"},{name:"British Indian Ocean Territory",flag:"🇮🇴",code:"IO",dial_code:"+246"},{name:"Brunei Darussalam",flag:"🇧🇳",code:"BN",dial_code:"+673"},{name:"Bulgaria",flag:"🇧🇬",code:"BG",dial_code:"+359"},{name:"Burkina Faso",flag:"🇧🇫",code:"BF",dial_code:"+226"},{name:"Burundi",flag:"🇧🇮",code:"BI",dial_code:"+257"},{name:"Cambodia",flag:"🇰🇭",code:"KH",dial_code:"+855"},{name:"Cameroon",flag:"🇨🇲",code:"CM",dial_code:"+237"},{name:"Canada",flag:"🇨🇦",code:"CA",dial_code:"+1"},{name:"Cape Verde",flag:"🇨🇻",code:"CV",dial_code:"+238"},{name:"Cayman Islands",flag:"🇰🇾",code:"KY",dial_code:"+345"},{name:"Central African Republic",flag:"🇨🇫",code:"CF",dial_code:"+236"},{name:"Chad",flag:"🇹🇩",code:"TD",dial_code:"+235"},{name:"Chile",flag:"🇨🇱",code:"CL",dial_code:"+56"},{name:"China",flag:"🇨🇳",code:"CN",dial_code:"+86"},{name:"Christmas Island",flag:"🇨🇽",code:"CX",dial_code:"+61"},{name:"Cocos (Keeling) Islands",flag:"🇨🇨",code:"CC",dial_code:"+61"},{name:"Colombia",flag:"🇨🇴",code:"CO",dial_code:"+57"},{name:"Comoros",flag:"🇰🇲",code:"KM",dial_code:"+269"},{name:"Congo",flag:"🇨🇬",code:"CG",dial_code:"+242"},{name:"Congo, The Democratic Republic of the Congo",flag:"🇨🇩",code:"CD",dial_code:"+243"},{name:"Cook Islands",flag:"🇨🇰",code:"CK",dial_code:"+682"},{name:"Costa Rica",flag:"🇨🇷",code:"CR",dial_code:"+506"},{name:"Cote d'Ivoire",flag:"🇨🇮",code:"CI",dial_code:"+225"},{name:"Croatia",flag:"🇭🇷",code:"HR",dial_code:"+385"},{name:"Cuba",flag:"🇨🇺",code:"CU",dial_code:"+53"},{name:"Cyprus",flag:"🇨🇾",code:"CY",dial_code:"+357"},{name:"Czech Republic",flag:"🇨🇿",code:"CZ",dial_code:"+420"},{name:"Denmark",flag:"🇩🇰",code:"DK",dial_code:"+45"},{name:"Djibouti",flag:"🇩🇯",code:"DJ",dial_code:"+253"},{name:"Dominica",flag:"🇩🇲",code:"DM",dial_code:"+1767"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1849"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1829"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1809"},{name:"Ecuador",flag:"🇪🇨",code:"EC",dial_code:"+593"},{name:"Egypt",flag:"🇪🇬",code:"EG",dial_code:"+20"},{name:"El Salvador",flag:"🇸🇻",code:"SV",dial_code:"+503"},{name:"Equatorial Guinea",flag:"🇬🇶",code:"GQ",dial_code:"+240"},{name:"Eritrea",flag:"🇪🇷",code:"ER",dial_code:"+291"},{name:"Estonia",flag:"🇪🇪",code:"EE",dial_code:"+372"},{name:"Ethiopia",flag:"🇪🇹",code:"ET",dial_code:"+251"},{name:"Falkland Islands (Malvinas)",flag:"🇫🇰",code:"FK",dial_code:"+500"},{name:"Faroe Islands",flag:"🇫🇴",code:"FO",dial_code:"+298"},{name:"Fiji",flag:"🇫🇯",code:"FJ",dial_code:"+679"},{name:"Finland",flag:"🇫🇮",code:"FI",dial_code:"+358"},{name:"France",flag:"🇫🇷",code:"FR",dial_code:"+33"},{name:"French Guiana",flag:"🇬🇫",code:"GF",dial_code:"+594"},{name:"French Polynesia",flag:"🇵🇫",code:"PF",dial_code:"+689"},{name:"French Southern Territories",flag:"🇹🇫",code:"TF",dial_code:"+262"},{name:"Gabon",flag:"🇬🇦",code:"GA",dial_code:"+241"},{name:"Gambia",flag:"🇬🇲",code:"GM",dial_code:"+220"},{name:"Georgia",flag:"🇬🇪",code:"GE",dial_code:"+995"},{name:"Germany",flag:"🇩🇪",code:"DE",dial_code:"+49"},{name:"Ghana",flag:"🇬🇭",code:"GH",dial_code:"+233"},{name:"Gibraltar",flag:"🇬🇮",code:"GI",dial_code:"+350"},{name:"Greece",flag:"🇬🇷",code:"GR",dial_code:"+30"},{name:"Greenland",flag:"🇬🇱",code:"GL",dial_code:"+299"},{name:"Grenada",flag:"🇬🇩",code:"GD",dial_code:"+1473"},{name:"Guadeloupe",flag:"🇬🇵",code:"GP",dial_code:"+590"},{name:"Guam",flag:"🇬🇺",code:"GU",dial_code:"+1671"},{name:"Guatemala",flag:"🇬🇹",code:"GT",dial_code:"+502"},{name:"Guernsey",flag:"🇬🇬",code:"GG",dial_code:"+44"},{name:"Guinea",flag:"🇬🇳",code:"GN",dial_code:"+224"},{name:"Guinea-Bissau",flag:"🇬🇼",code:"GW",dial_code:"+245"},{name:"Guyana",flag:"🇬🇾",code:"GY",dial_code:"+592"},{name:"Haiti",flag:"🇭🇹",code:"HT",dial_code:"+509"},{name:"Heard Island and Mcdonald Islands",flag:"🇭🇲",code:"HM",dial_code:"+672"},{name:"Holy See (Vatican City State)",flag:"🇻🇦",code:"VA",dial_code:"+379"},{name:"Honduras",flag:"🇭🇳",code:"HN",dial_code:"+504"},{name:"Hong Kong",flag:"🇭🇰",code:"HK",dial_code:"+852"},{name:"Hungary",flag:"🇭🇺",code:"HU",dial_code:"+36"},{name:"Iceland",flag:"🇮🇸",code:"IS",dial_code:"+354"},{name:"India",flag:"🇮🇳",code:"IN",dial_code:"+91"},{name:"Indonesia",flag:"🇮🇩",code:"ID",dial_code:"+62"},{name:"Iran, Islamic Republic of Persian Gulf",flag:"🇮🇷",code:"IR",dial_code:"+98"},{name:"Iraq",flag:"🇮🇶",code:"IQ",dial_code:"+964"},{name:"Ireland",flag:"🇮🇪",code:"IE",dial_code:"+353"},{name:"Isle of Man",flag:"🇮🇲",code:"IM",dial_code:"+44"},{name:"Israel",flag:"🇮🇱",code:"IL",dial_code:"+972"},{name:"Italy",flag:"🇮🇹",code:"IT",dial_code:"+39"},{name:"Jamaica",flag:"🇯🇲",code:"JM",dial_code:"+1876"},{name:"Japan",flag:"🇯🇵",code:"JP",dial_code:"+81"},{name:"Jersey",flag:"🇯🇪",code:"JE",dial_code:"+44"},{name:"Jordan",flag:"🇯🇴",code:"JO",dial_code:"+962"},{name:"Kazakhstan",flag:"🇰🇿",code:"KZ",dial_code:"+7"},{name:"Kenya",flag:"🇰🇪",code:"KE",dial_code:"+254"},{name:"Kiribati",flag:"🇰🇮",code:"KI",dial_code:"+686"},{name:"Korea, Democratic People's Republic of Korea",flag:"🇰🇵",code:"KP",dial_code:"+850"},{name:"Korea, Republic of South Korea",flag:"🇰🇷",code:"KR",dial_code:"+82"},{name:"Kosovo",flag:"🇽🇰",code:"XK",dial_code:"+383"},{name:"Kuwait",flag:"🇰🇼",code:"KW",dial_code:"+965"},{name:"Kyrgyzstan",flag:"🇰🇬",code:"KG",dial_code:"+996"},{name:"Laos",flag:"🇱🇦",code:"LA",dial_code:"+856"},{name:"Latvia",flag:"🇱🇻",code:"LV",dial_code:"+371"},{name:"Lebanon",flag:"🇱🇧",code:"LB",dial_code:"+961"},{name:"Lesotho",flag:"🇱🇸",code:"LS",dial_code:"+266"},{name:"Liberia",flag:"🇱🇷",code:"LR",dial_code:"+231"},{name:"Libyan Arab Jamahiriya",flag:"🇱🇾",code:"LY",dial_code:"+218"},{name:"Liechtenstein",flag:"🇱🇮",code:"LI",dial_code:"+423"},{name:"Lithuania",flag:"🇱🇹",code:"LT",dial_code:"+370"},{name:"Luxembourg",flag:"🇱🇺",code:"LU",dial_code:"+352"},{name:"Macao",flag:"🇲🇴",code:"MO",dial_code:"+853"},{name:"Macedonia",flag:"🇲🇰",code:"MK",dial_code:"+389"},{name:"Madagascar",flag:"🇲🇬",code:"MG",dial_code:"+261"},{name:"Malawi",flag:"🇲🇼",code:"MW",dial_code:"+265"},{name:"Malaysia",flag:"🇲🇾",code:"MY",dial_code:"+60"},{name:"Maldives",flag:"🇲🇻",code:"MV",dial_code:"+960"},{name:"Mali",flag:"🇲🇱",code:"ML",dial_code:"+223"},{name:"Malta",flag:"🇲🇹",code:"MT",dial_code:"+356"},{name:"Marshall Islands",flag:"🇲🇭",code:"MH",dial_code:"+692"},{name:"Martinique",flag:"🇲🇶",code:"MQ",dial_code:"+596"},{name:"Mauritania",flag:"🇲🇷",code:"MR",dial_code:"+222"},{name:"Mauritius",flag:"🇲🇺",code:"MU",dial_code:"+230"},{name:"Mayotte",flag:"🇾🇹",code:"YT",dial_code:"+262"},{name:"Mexico",flag:"🇲🇽",code:"MX",dial_code:"+52"},{name:"Micronesia, Federated States of Micronesia",flag:"🇫🇲",code:"FM",dial_code:"+691"},{name:"Moldova",flag:"🇲🇩",code:"MD",dial_code:"+373"},{name:"Monaco",flag:"🇲🇨",code:"MC",dial_code:"+377"},{name:"Mongolia",flag:"🇲🇳",code:"MN",dial_code:"+976"},{name:"Montenegro",flag:"🇲🇪",code:"ME",dial_code:"+382"},{name:"Montserrat",flag:"🇲🇸",code:"MS",dial_code:"+1664"},{name:"Morocco",flag:"🇲🇦",code:"MA",dial_code:"+212"},{name:"Mozambique",flag:"🇲🇿",code:"MZ",dial_code:"+258"},{name:"Myanmar",flag:"🇲🇲",code:"MM",dial_code:"+95"},{name:"Namibia",flag:"🇳🇦",code:"NA",dial_code:"+264"},{name:"Nauru",flag:"🇳🇷",code:"NR",dial_code:"+674"},{name:"Nepal",flag:"🇳🇵",code:"NP",dial_code:"+977"},{name:"Netherlands",flag:"🇳🇱",code:"NL",dial_code:"+31"},{name:"Netherlands Antilles",flag:"",code:"AN",dial_code:"+599"},{name:"New Caledonia",flag:"🇳🇨",code:"NC",dial_code:"+687"},{name:"New Zealand",flag:"🇳🇿",code:"NZ",dial_code:"+64"},{name:"Nicaragua",flag:"🇳🇮",code:"NI",dial_code:"+505"},{name:"Niger",flag:"🇳🇪",code:"NE",dial_code:"+227"},{name:"Nigeria",flag:"🇳🇬",code:"NG",dial_code:"+234"},{name:"Niue",flag:"🇳🇺",code:"NU",dial_code:"+683"},{name:"Norfolk Island",flag:"🇳🇫",code:"NF",dial_code:"+672"},{name:"Northern Mariana Islands",flag:"🇲🇵",code:"MP",dial_code:"+1670"},{name:"Norway",flag:"🇳🇴",code:"NO",dial_code:"+47"},{name:"Oman",flag:"🇴🇲",code:"OM",dial_code:"+968"},{name:"Pakistan",flag:"🇵🇰",code:"PK",dial_code:"+92"},{name:"Palau",flag:"🇵🇼",code:"PW",dial_code:"+680"},{name:"Palestinian Territory, Occupied",flag:"🇵🇸",code:"PS",dial_code:"+970"},{name:"Panama",flag:"🇵🇦",code:"PA",dial_code:"+507"},{name:"Papua New Guinea",flag:"🇵🇬",code:"PG",dial_code:"+675"},{name:"Paraguay",flag:"🇵🇾",code:"PY",dial_code:"+595"},{name:"Peru",flag:"🇵🇪",code:"PE",dial_code:"+51"},{name:"Philippines",flag:"🇵🇭",code:"PH",dial_code:"+63"},{name:"Pitcairn",flag:"🇵🇳",code:"PN",dial_code:"+64"},{name:"Poland",flag:"🇵🇱",code:"PL",dial_code:"+48"},{name:"Portugal",flag:"🇵🇹",code:"PT",dial_code:"+351"},{name:"Puerto Rico",flag:"🇵🇷",code:"PR",dial_code:"+1939"},{name:"Qatar",flag:"🇶🇦",code:"QA",dial_code:"+974"},{name:"Romania",flag:"🇷🇴",code:"RO",dial_code:"+40"},{name:"Russia",flag:"🇷🇺",code:"RU",dial_code:"+7"},{name:"Rwanda",flag:"🇷🇼",code:"RW",dial_code:"+250"},{name:"Reunion",flag:"🇷🇪",code:"RE",dial_code:"+262"},{name:"Saint Barthelemy",flag:"🇧🇱",code:"BL",dial_code:"+590"},{name:"Saint Helena, Ascension and Tristan Da Cunha",flag:"🇸🇭",code:"SH",dial_code:"+290"},{name:"Saint Kitts and Nevis",flag:"🇰🇳",code:"KN",dial_code:"+1869"},{name:"Saint Lucia",flag:"🇱🇨",code:"LC",dial_code:"+1758"},{name:"Saint Martin",flag:"🇲🇫",code:"MF",dial_code:"+590"},{name:"Saint Pierre and Miquelon",flag:"🇵🇲",code:"PM",dial_code:"+508"},{name:"Saint Vincent and the Grenadines",flag:"🇻🇨",code:"VC",dial_code:"+1784"},{name:"Samoa",flag:"🇼🇸",code:"WS",dial_code:"+685"},{name:"San Marino",flag:"🇸🇲",code:"SM",dial_code:"+378"},{name:"Sao Tome and Principe",flag:"🇸🇹",code:"ST",dial_code:"+239"},{name:"Saudi Arabia",flag:"🇸🇦",code:"SA",dial_code:"+966"},{name:"Senegal",flag:"🇸🇳",code:"SN",dial_code:"+221"},{name:"Serbia",flag:"🇷🇸",code:"RS",dial_code:"+381"},{name:"Seychelles",flag:"🇸🇨",code:"SC",dial_code:"+248"},{name:"Sierra Leone",flag:"🇸🇱",code:"SL",dial_code:"+232"},{name:"Singapore",flag:"🇸🇬",code:"SG",dial_code:"+65"},{name:"Slovakia",flag:"🇸🇰",code:"SK",dial_code:"+421"},{name:"Slovenia",flag:"🇸🇮",code:"SI",dial_code:"+386"},{name:"Solomon Islands",flag:"🇸🇧",code:"SB",dial_code:"+677"},{name:"Somalia",flag:"🇸🇴",code:"SO",dial_code:"+252"},{name:"South Africa",flag:"🇿🇦",code:"ZA",dial_code:"+27"},{name:"South Sudan",flag:"🇸🇸",code:"SS",dial_code:"+211"},{name:"South Georgia and the South Sandwich Islands",flag:"🇬🇸",code:"GS",dial_code:"+500"},{name:"Spain",flag:"🇪🇸",code:"ES",dial_code:"+34"},{name:"Sri Lanka",flag:"🇱🇰",code:"LK",dial_code:"+94"},{name:"Sudan",flag:"🇸🇩",code:"SD",dial_code:"+249"},{name:"Suriname",flag:"🇸🇷",code:"SR",dial_code:"+597"},{name:"Svalbard and Jan Mayen",flag:"🇸🇯",code:"SJ",dial_code:"+47"},{name:"Swaziland",flag:"🇸🇿",code:"SZ",dial_code:"+268"},{name:"Sweden",flag:"🇸🇪",code:"SE",dial_code:"+46"},{name:"Switzerland",flag:"🇨🇭",code:"CH",dial_code:"+41"},{name:"Syrian Arab Republic",flag:"🇸🇾",code:"SY",dial_code:"+963"},{name:"Taiwan",flag:"🇹🇼",code:"TW",dial_code:"+886"},{name:"Tajikistan",flag:"🇹🇯",code:"TJ",dial_code:"+992"},{name:"Tanzania, United Republic of Tanzania",flag:"🇹🇿",code:"TZ",dial_code:"+255"},{name:"Thailand",flag:"🇹🇭",code:"TH",dial_code:"+66"},{name:"Timor-Leste",flag:"🇹🇱",code:"TL",dial_code:"+670"},{name:"Togo",flag:"🇹🇬",code:"TG",dial_code:"+228"},{name:"Tokelau",flag:"🇹🇰",code:"TK",dial_code:"+690"},{name:"Tonga",flag:"🇹🇴",code:"TO",dial_code:"+676"},{name:"Trinidad and Tobago",flag:"🇹🇹",code:"TT",dial_code:"+1868"},{name:"Tunisia",flag:"🇹🇳",code:"TN",dial_code:"+216"},{name:"Turkey",flag:"🇹🇷",code:"TR",dial_code:"+90"},{name:"Turkmenistan",flag:"🇹🇲",code:"TM",dial_code:"+993"},{name:"Turks and Caicos Islands",flag:"🇹🇨",code:"TC",dial_code:"+1649"},{name:"Tuvalu",flag:"🇹🇻",code:"TV",dial_code:"+688"},{name:"Uganda",flag:"🇺🇬",code:"UG",dial_code:"+256"},{name:"Ukraine",flag:"🇺🇦",code:"UA",dial_code:"+380"},{name:"United Arab Emirates",flag:"🇦🇪",code:"AE",dial_code:"+971"},{name:"United Kingdom",flag:"🇬🇧",code:"GB",dial_code:"+44"},{name:"United States",flag:"🇺🇸",code:"US",dial_code:"+1"},{name:"Uruguay",flag:"🇺🇾",code:"UY",dial_code:"+598"},{name:"Uzbekistan",flag:"🇺🇿",code:"UZ",dial_code:"+998"},{name:"Vanuatu",flag:"🇻🇺",code:"VU",dial_code:"+678"},{name:"Venezuela, Bolivarian Republic of Venezuela",flag:"🇻🇪",code:"VE",dial_code:"+58"},{name:"Vietnam",flag:"🇻🇳",code:"VN",dial_code:"+84"},{name:"Virgin Islands, British",flag:"🇻🇬",code:"VG",dial_code:"+1284"},{name:"Virgin Islands, U.S.",flag:"🇻🇮",code:"VI",dial_code:"+1340"},{name:"Wallis and Futuna",flag:"🇼🇫",code:"WF",dial_code:"+681"},{name:"Yemen",flag:"🇾🇪",code:"YE",dial_code:"+967"},{name:"Zambia",flag:"🇿🇲",code:"ZM",dial_code:"+260"},{name:"Zimbabwe",flag:"🇿🇼",code:"ZW",dial_code:"+263"}],CG={placeholder:"Type your phone number..."},SG=De('<div class="input__field--phone relative flex justify-center items-center"><div class="pl-2 pr-1 flex items-center gap-2"><span></span></div><select class="absolute top-0 left-0 w-full h-full cursor-pointer opacity-0">'),TG=De("<option> "),DG=e=>{const[t,n]=O(tt(e.defaultCountryCode)?"INT":e.defaultCountryCode),[r,o]=O(e.defaultValue??"");let i;const a=e=>{o(e),""!==e&&"+"!==e||"INT"===t()||n("INT");const r=e?.startsWith("+")&&e.length>2&&kG.reduce((t,n)=>!n?.dial_code||null!==t&&!t.dial_code?t:e?.startsWith(n.dial_code)&&n.dial_code.length>(t?.dial_code.length??0)?n:t,null);r&&n(r.code)},s=()=>{const n=kG.find(e=>e.code===t())?.dial_code;if(""!==i?.value&&i?.reportValidity()){const t=i?.value??r();e.onSubmit({type:"text",value:t.startsWith("+")?t:`${n??""}${t}`})}else i?.focus()},l=e=>{"Enter"===e.key&&(e.preventDefault(),s())},u=e=>{const t=e.currentTarget.value;n(t);const a=kG.find(e=>e.code===t)?.dial_code;""===r()&&a&&o(a),i?.focus()};return _W(e=>{const{data:t}=e;"setInputValue"===t.command&&o(t.value)}),B(()=>{!zi()&&i&&i.focus({preventScroll:!0})}),ie(EW,{onSubmit:s,get buttonLabel(){return e.labels?.button},get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){return[(()=>{const e=SG(),n=e.firstChild,r=n.firstChild,o=n.nextSibling;return Be(r,()=>kG.find(e=>t()===e.code)?.flag),Be(n,ie(xG,{class:"w-3"}),null),o.addEventListener("change",u),Be(o,ie(ge,{each:kG,children:e=>(()=>{const n=TG(),r=n.firstChild;return Be(n,()=>e.name,r),Be(n,()=>e.dial_code?`(${e.dial_code})`:"",null),P(()=>n.selected=e.code===t()),P(()=>n.value=e.code),n})()})),e})(),ie(vG,{ref(e){"function"==typeof i?i(e):i=e},type:"tel",get value(){return r()},onInput:a,onKeyDown:l,get placeholder(){return e.labels?.placeholder??CG.placeholder},get autofocus(){return!zi()}})]}})},AG={button:xW,from:"From:",to:"To:"},OG="dd/MM/yyyy",PG="dd/MM/yyyy HH:mm";function IG(e){return IG="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},IG(e)}function NG(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function RG(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function BG(e){RG(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===IG(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}var FG={};function LG(){return FG}function MG(e){if(RG(1,arguments),!function(e){return RG(1,arguments),e instanceof Date||"object"===IG(e)&&"[object Date]"===Object.prototype.toString.call(e)}(e)&&"number"!=typeof e)return!1;var t=BG(e);return!isNaN(Number(t))}function UG(e,t){return RG(2,arguments),function(e,t){RG(2,arguments);var n=BG(e).getTime(),r=NG(t);return new Date(n+r)}(e,-NG(t))}function jG(e){RG(1,arguments);var t=BG(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function $G(e){RG(1,arguments);var t=BG(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=jG(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=jG(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function zG(e){RG(1,arguments);var t=BG(e),n=jG(t).getTime()-function(e){RG(1,arguments);var t=$G(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),jG(n)}(t).getTime();return Math.round(n/6048e5)+1}function HG(e,t){var n,r,o,i,a,s,l,u;RG(1,arguments);var c=LG(),d=NG(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:c.weekStartsOn)&&void 0!==r?r:null===(l=c.locale)||void 0===l||null===(u=l.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=BG(e),f=p.getUTCDay(),h=(f<d?7:0)+f-d;return p.setUTCDate(p.getUTCDate()-h),p.setUTCHours(0,0,0,0),p}function VG(e,t){var n,r,o,i,a,s,l,u;RG(1,arguments);var c=BG(e),d=c.getUTCFullYear(),p=LG(),f=NG(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:p.firstWeekContainsDate)&&void 0!==r?r:null===(l=p.locale)||void 0===l||null===(u=l.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setUTCFullYear(d+1,0,f),h.setUTCHours(0,0,0,0);var g=HG(h,t),m=new Date(0);m.setUTCFullYear(d,0,f),m.setUTCHours(0,0,0,0);var v=HG(m,t);return c.getTime()>=g.getTime()?d+1:c.getTime()>=v.getTime()?d:d-1}function WG(e,t){RG(1,arguments);var n=BG(e),r=HG(n,t).getTime()-function(e,t){var n,r,o,i,a,s,l,u;RG(1,arguments);var c=LG(),d=NG(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:c.firstWeekContainsDate)&&void 0!==r?r:null===(l=c.locale)||void 0===l||null===(u=l.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1),p=VG(e,t),f=new Date(0);return f.setUTCFullYear(p,0,d),f.setUTCHours(0,0,0,0),HG(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function qG(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var GG=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return qG("yy"===t?r%100:r,t.length)},KG=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):qG(n+1,2)},YG=function(e,t){return qG(e.getUTCDate(),t.length)},ZG=function(e,t){return qG(e.getUTCHours()%12||12,t.length)},XG=function(e,t){return qG(e.getUTCHours(),t.length)},QG=function(e,t){return qG(e.getUTCMinutes(),t.length)},JG=function(e,t){return qG(e.getUTCSeconds(),t.length)},eK=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return qG(Math.floor(r*Math.pow(10,n-3)),t.length)},tK="midnight",nK="noon",rK="morning",oK="afternoon",iK="evening",aK="night",sK={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return GG(e,t)},Y:function(e,t,n,r){var o=VG(e,r),i=o>0?o:1-o;return"YY"===t?qG(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):qG(i,t.length)},R:function(e,t){return qG($G(e),t.length)},u:function(e,t){return qG(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return qG(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return qG(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return KG(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return qG(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=WG(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):qG(o,t.length)},I:function(e,t,n){var r=zG(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):qG(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):YG(e,t)},D:function(e,t,n){var r=function(e){RG(1,arguments);var t=BG(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):qG(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return qG(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return qG(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return qG(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?nK:0===o?tK:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?iK:o>=12?oK:o>=4?rK:aK,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ZG(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):XG(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):qG(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):qG(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):QG(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):JG(e,t)},S:function(e,t){return eK(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return uK(o);case"XXXX":case"XX":return cK(o);default:return cK(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return uK(o);case"xxxx":case"xx":return cK(o);default:return cK(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+lK(o,":");default:return"GMT"+cK(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+lK(o,":");default:return"GMT"+cK(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return qG(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return qG((r._originalDate||e).getTime(),t.length)}};function lK(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var a=t;return n+String(o)+a+qG(i,2)}function uK(e,t){return e%60==0?(e>0?"-":"+")+qG(Math.abs(e)/60,2):cK(e,t)}function cK(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+qG(Math.floor(o/60),2)+n+qG(o%60,2)}var dK=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},pK=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},fK={p:pK,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return dK(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",dK(o,t)).replace("{{time}}",pK(i,t))}},hK=["D","DD"],gK=["YY","YYYY"];function mK(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var vK={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function yK(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var bK={date:yK({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:yK({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:yK({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},wK={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function EK(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var a=e.defaultWidth,s=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[s]||e.values[a]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var _K={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:EK({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:EK({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:EK({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:EK({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:EK({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function xK(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,s=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,function(e){return e.test(s)}):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(l,function(e){return e.test(s)});return a=e.valueCallback?e.valueCallback(u):u,{value:a=n.valueCallback?n.valueCallback(a):a,rest:t.slice(s.length)}}}var kK,CK={ordinalNumber:(kK={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(kK.matchPattern);if(!n)return null;var r=n[0],o=e.match(kK.parsePattern);if(!o)return null;var i=kK.valueCallback?kK.valueCallback(o[0]):o[0];return{value:i=t.valueCallback?t.valueCallback(i):i,rest:e.slice(r.length)}}),era:xK({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:xK({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:xK({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:xK({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:xK({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},SK={code:"en-US",formatDistance:function(e,t,n){var r,o=vK[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:bK,formatRelative:function(e,t,n,r){return wK[e]},localize:_K,match:CK,options:{weekStartsOn:0,firstWeekContainsDate:1}},TK=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,DK=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,AK=/^'([^]*?)'?$/,OK=/''/g,PK=/[a-zA-Z]/;function IK(e,t,n){var r,o,i,a,s,l,u,c,d,p,f;RG(2,arguments);var h=String(t),g=LG(),m=null!==(r=g.locale)&&void 0!==r?r:SK,v=NG(null!==(o=null!==(i=null!==(a=void 0)&&void 0!==a?a:g.firstWeekContainsDate)&&void 0!==i?i:null===(s=g.locale)||void 0===s||null===(l=s.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:1);if(!(v>=1&&v<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=NG(null!==(u=null!==(c=null!==(d=void 0)&&void 0!==d?d:g.weekStartsOn)&&void 0!==c?c:null===(p=g.locale)||void 0===p||null===(f=p.options)||void 0===f?void 0:f.weekStartsOn)&&void 0!==u?u:0);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!m.localize)throw new RangeError("locale must contain localize property");if(!m.formatLong)throw new RangeError("locale must contain formatLong property");var b=BG(e);if(!MG(b))throw new RangeError("Invalid time value");var w=function(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}(b),E=UG(b,w),_={firstWeekContainsDate:v,weekStartsOn:y,locale:m,_originalDate:b};return h.match(DK).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,fK[t])(e,m.formatLong):e}).join("").match(TK).map(function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return function(e){var t=e.match(AK);if(!t)return e;return t[1].replace(OK,"'")}(n);var o,i=sK[r];if(i)return o=n,-1!==gK.indexOf(o)&&mK(n,t,String(e)),function(e){return-1!==hK.indexOf(e)}(n)&&mK(n,t,String(e)),i(E,n,m.localize,_);if(r.match(PK))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n}).join("")}function NK(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RK(e,t){return RK=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},RK(e,t)}function BK(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&RK(e,t)}function FK(e){return FK=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},FK(e)}function LK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(LK=function(){return!!e})()}function MK(e){var t=LK();return function(){var n,r=FK(e);if(t){var o=FK(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==IG(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return NK(e)}(this,n)}}function UK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jK(e){var t=function(e,t){if("object"!=IG(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=IG(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==IG(t)?t:t+""}function $K(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,jK(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zK(e,t,n){return(t=jK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var HK=function(){function e(){UK(this,e),zK(this,"priority",void 0),zK(this,"subPriority",0)}return $K(e,[{key:"validate",value:function(e,t){return!0}}]),e}(),VK=function(){BK(t,HK);var e=MK(t);function t(n,r,o,i,a){var s;return UK(this,t),(s=e.call(this)).value=n,s.validateValue=r,s.setValue=o,s.priority=i,a&&(s.subPriority=a),s}return $K(t,[{key:"validate",value:function(e,t){return this.validateValue(e,this.value,t)}},{key:"set",value:function(e,t,n){return this.setValue(e,t,this.value,n)}}]),t}(),WK=function(){function e(){UK(this,e),zK(this,"incompatibleTokens",void 0),zK(this,"priority",void 0),zK(this,"subPriority",void 0)}return $K(e,[{key:"run",value:function(e,t,n,r){var o=this.parse(e,t,n,r);return o?{setter:new VK(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}},{key:"validate",value:function(e,t,n){return!0}}]),e}(),qK=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",140),zK(NK(n),"incompatibleTokens",["R","u","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}},{key:"set",value:function(e,t,n){return t.era=n,e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}]),t}(),GK=/^(1[0-2]|0?\d)/,KK=/^(3[0-1]|[0-2]?\d)/,YK=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,ZK=/^(5[0-3]|[0-4]?\d)/,XK=/^(2[0-3]|[0-1]?\d)/,QK=/^(2[0-4]|[0-1]?\d)/,JK=/^(1[0-1]|0?\d)/,eY=/^(1[0-2]|0?\d)/,tY=/^[0-5]?\d/,nY=/^[0-5]?\d/,rY=/^\d/,oY=/^\d{1,2}/,iY=/^\d{1,3}/,aY=/^\d{1,4}/,sY=/^-?\d+/,lY=/^-?\d/,uY=/^-?\d{1,2}/,cY=/^-?\d{1,3}/,dY=/^-?\d{1,4}/,pY=/^([+-])(\d{2})(\d{2})?|Z/,fY=/^([+-])(\d{2})(\d{2})|Z/,hY=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,gY=/^([+-])(\d{2}):(\d{2})|Z/,mY=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function vY(e,t){return e?{value:t(e.value),rest:e.rest}:e}function yY(e,t){var n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function bY(e,t){var n=t.match(e);return n?"Z"===n[0]?{value:0,rest:t.slice(1)}:{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:t.slice(n[0].length)}:null}function wY(e){return yY(sY,e)}function EY(e,t){switch(e){case 1:return yY(rY,t);case 2:return yY(oY,t);case 3:return yY(iY,t);case 4:return yY(aY,t);default:return yY(new RegExp("^\\d{1,"+e+"}"),t)}}function _Y(e,t){switch(e){case 1:return yY(lY,t);case 2:return yY(uY,t);case 3:return yY(cY,t);case 4:return yY(dY,t);default:return yY(new RegExp("^-?\\d{1,"+e+"}"),t)}}function xY(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function kY(e,t){var n,r=t>0,o=r?t:1-t;if(o<=50)n=e||100;else{var i=o+50;n=e+100*Math.floor(i/100)-(e>=i%100?100:0)}return r?n:1-n}function CY(e){return e%400==0||e%4==0&&e%100!=0}var SY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",130),zK(NK(n),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"yy"===t}};switch(t){case"y":return vY(EY(4,e),r);case"yo":return vY(n.ordinalNumber(e,{unit:"year"}),r);default:return vY(EY(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n){var r=e.getUTCFullYear();if(n.isTwoDigitYear){var o=kY(n.year,r);return e.setUTCFullYear(o,0,1),e.setUTCHours(0,0,0,0),e}var i="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(i,0,1),e.setUTCHours(0,0,0,0),e}}]),t}(),TY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",130),zK(NK(n),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"YY"===t}};switch(t){case"Y":return vY(EY(4,e),r);case"Yo":return vY(n.ordinalNumber(e,{unit:"year"}),r);default:return vY(EY(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n,r){var o=VG(e,r);if(n.isTwoDigitYear){var i=kY(n.year,o);return e.setUTCFullYear(i,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),HG(e,r)}var a="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(a,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),HG(e,r)}}]),t}(),DY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",130),zK(NK(n),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t){return _Y("R"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){var r=new Date(0);return r.setUTCFullYear(n,0,4),r.setUTCHours(0,0,0,0),jG(r)}}]),t}(),AY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",130),zK(NK(n),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t){return _Y("u"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){return e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}]),t}(),OY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",120),zK(NK(n),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"Q":case"QQ":return EY(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),t}(),PY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",120),zK(NK(n),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"q":case"qq":return EY(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),t}(),IY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),zK(NK(n),"priority",110),n}return $K(t,[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"M":return vY(yY(GK,e),r);case"MM":return vY(EY(2,e),r);case"Mo":return vY(n.ordinalNumber(e,{unit:"month"}),r);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),t}(),NY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",110),zK(NK(n),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"L":return vY(yY(GK,e),r);case"LL":return vY(EY(2,e),r);case"Lo":return vY(n.ordinalNumber(e,{unit:"month"}),r);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),t}();var RY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",100),zK(NK(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"w":return yY(ZK,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return EY(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n,r){return HG(function(e,t,n){RG(2,arguments);var r=BG(e),o=NG(t),i=WG(r,n)-o;return r.setUTCDate(r.getUTCDate()-7*i),r}(e,n,r),r)}}]),t}();var BY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",100),zK(NK(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"I":return yY(ZK,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return EY(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n){return jG(function(e,t){RG(2,arguments);var n=BG(e),r=NG(t),o=zG(n)-r;return n.setUTCDate(n.getUTCDate()-7*o),n}(e,n))}}]),t}(),FY=[31,28,31,30,31,30,31,31,30,31,30,31],LY=[31,29,31,30,31,30,31,31,30,31,30,31],MY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",90),zK(NK(n),"subPriority",1),zK(NK(n),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"d":return yY(KK,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return EY(t.length,e)}}},{key:"validate",value:function(e,t){var n=CY(e.getUTCFullYear()),r=e.getUTCMonth();return n?t>=1&&t<=LY[r]:t>=1&&t<=FY[r]}},{key:"set",value:function(e,t,n){return e.setUTCDate(n),e.setUTCHours(0,0,0,0),e}}]),t}(),UY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",90),zK(NK(n),"subpriority",1),zK(NK(n),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"D":case"DD":return yY(YK,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return EY(t.length,e)}}},{key:"validate",value:function(e,t){return CY(e.getUTCFullYear())?t>=1&&t<=366:t>=1&&t<=365}},{key:"set",value:function(e,t,n){return e.setUTCMonth(0,n),e.setUTCHours(0,0,0,0),e}}]),t}();function jY(e,t,n){var r,o,i,a,s,l,u,c;RG(2,arguments);var d=LG(),p=NG(null!==(r=null!==(o=null!==(i=null!==(a=null==n?void 0:n.weekStartsOn)&&void 0!==a?a:null==n||null===(s=n.locale)||void 0===s||null===(l=s.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==o?o:null===(u=d.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==r?r:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=BG(e),h=NG(t),g=((h%7+7)%7<p?7:0)+h-f.getUTCDay();return f.setUTCDate(f.getUTCDate()+g),f}var $Y=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",90),zK(NK(n),"incompatibleTokens",["D","i","e","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=jY(e,n,r)).setUTCHours(0,0,0,0),e}}]),t}(),zY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",90),zK(NK(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return vY(EY(t.length,e),o);case"eo":return vY(n.ordinalNumber(e,{unit:"day"}),o);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=jY(e,n,r)).setUTCHours(0,0,0,0),e}}]),t}(),HY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",90),zK(NK(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return vY(EY(t.length,e),o);case"co":return vY(n.ordinalNumber(e,{unit:"day"}),o);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=jY(e,n,r)).setUTCHours(0,0,0,0),e}}]),t}();var VY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",90),zK(NK(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){var r=function(e){return 0===e?7:e};switch(t){case"i":case"ii":return EY(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return vY(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return vY(n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return vY(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);default:return vY(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r)}}},{key:"validate",value:function(e,t){return t>=1&&t<=7}},{key:"set",value:function(e,t,n){return e=function(e,t){RG(2,arguments);var n=NG(t);n%7==0&&(n-=7);var r=BG(e),o=((n%7+7)%7<1?7:0)+n-r.getUTCDay();return r.setUTCDate(r.getUTCDate()+o),r}(e,n),e.setUTCHours(0,0,0,0),e}}]),t}(),WY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",80),zK(NK(n),"incompatibleTokens",["b","B","H","k","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(xY(n),0,0,0),e}}]),t}(),qY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",80),zK(NK(n),"incompatibleTokens",["a","B","H","k","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(xY(n),0,0,0),e}}]),t}(),GY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",80),zK(NK(n),"incompatibleTokens",["a","b","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(xY(n),0,0,0),e}}]),t}(),KY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",70),zK(NK(n),"incompatibleTokens",["H","K","k","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"h":return yY(eY,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return EY(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=12}},{key:"set",value:function(e,t,n){var r=e.getUTCHours()>=12;return r&&n<12?e.setUTCHours(n+12,0,0,0):r||12!==n?e.setUTCHours(n,0,0,0):e.setUTCHours(0,0,0,0),e}}]),t}(),YY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",70),zK(NK(n),"incompatibleTokens",["a","b","h","K","k","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"H":return yY(XK,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return EY(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=23}},{key:"set",value:function(e,t,n){return e.setUTCHours(n,0,0,0),e}}]),t}(),ZY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",70),zK(NK(n),"incompatibleTokens",["h","H","k","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"K":return yY(JK,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return EY(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.getUTCHours()>=12&&n<12?e.setUTCHours(n+12,0,0,0):e.setUTCHours(n,0,0,0),e}}]),t}(),XY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",70),zK(NK(n),"incompatibleTokens",["a","b","h","H","K","t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"k":return yY(QK,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return EY(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=24}},{key:"set",value:function(e,t,n){var r=n<=24?n%24:n;return e.setUTCHours(r,0,0,0),e}}]),t}(),QY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",60),zK(NK(n),"incompatibleTokens",["t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"m":return yY(tY,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return EY(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCMinutes(n,0,0),e}}]),t}(),JY=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",50),zK(NK(n),"incompatibleTokens",["t","T"]),n}return $K(t,[{key:"parse",value:function(e,t,n){switch(t){case"s":return yY(nY,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return EY(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCSeconds(n,0),e}}]),t}(),eZ=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",30),zK(NK(n),"incompatibleTokens",["t","T"]),n}return $K(t,[{key:"parse",value:function(e,t){return vY(EY(t.length,e),function(e){return Math.floor(e*Math.pow(10,3-t.length))})}},{key:"set",value:function(e,t,n){return e.setUTCMilliseconds(n),e}}]),t}(),tZ=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",10),zK(NK(n),"incompatibleTokens",["t","T","x"]),n}return $K(t,[{key:"parse",value:function(e,t){switch(t){case"X":return bY(pY,e);case"XX":return bY(fY,e);case"XXXX":return bY(hY,e);case"XXXXX":return bY(mY,e);default:return bY(gY,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}]),t}(),nZ=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",10),zK(NK(n),"incompatibleTokens",["t","T","X"]),n}return $K(t,[{key:"parse",value:function(e,t){switch(t){case"x":return bY(pY,e);case"xx":return bY(fY,e);case"xxxx":return bY(hY,e);case"xxxxx":return bY(mY,e);default:return bY(gY,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}]),t}(),rZ=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",40),zK(NK(n),"incompatibleTokens","*"),n}return $K(t,[{key:"parse",value:function(e){return wY(e)}},{key:"set",value:function(e,t,n){return[new Date(1e3*n),{timestampIsSet:!0}]}}]),t}(),oZ=function(){BK(t,WK);var e=MK(t);function t(){var n;UK(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return zK(NK(n=e.call.apply(e,[this].concat(o))),"priority",20),zK(NK(n),"incompatibleTokens","*"),n}return $K(t,[{key:"parse",value:function(e){return wY(e)}},{key:"set",value:function(e,t,n){return[new Date(n),{timestampIsSet:!0}]}}]),t}();new qK,new SY,new TY,new DY,new AY,new OY,new PY,new IY,new NY,new RY,new BY,new MY,new UY,new $Y,new zY,new HY,new VY,new WY,new qY,new GY,new KY,new YY,new ZY,new XY,new QY,new JY,new eZ,new tZ,new nZ,new rZ,new oZ;const iZ=De('<div><div><input class="input__field--date focus:outline-none flex-1 w-full" data-testid="from-date">'),aZ=De('<p class="font-normal">'),sZ=De('<div class="flex items-center p-4 h-full"><input class="input__field--date focus:outline-none flex-1 w-full ml-2 h-full" data-testid="to-date">'),lZ=De('<div class="w-full mt-2 px-3 py-2 text-sm rounded-md">'),uZ=e=>{const[t,n]=O(cZ(e.defaultValue??"")),[r,o]=O(null),i=t=>{if(!t)return"";try{let n;if(e.options?.hasTime)n=new Date(t);else{if(/T|(\s+\d{1,2}:\d{2})/.test(t))n=new Date(t);else{const e=`${t.split(/[T\s]/)[0]}T12:00:00`;n=new Date(e),isNaN(n.getTime())&&(n=new Date(t))}}if(isNaN(n.getTime()))return t;return IK(n,e.options?.format??(e.options?.hasTime?PG:OG))}catch(e){return console.error("Error formatting date:",e),t}},a=t=>{if(t)return e.options?.hasTime?t:t.split(/[T\s]/)[0]},s=(t,n)=>{if(!e.options?.isRange)return o(null),!0;if(!t||!n)return t||n?(o("Please provide both start and end dates for the date range."),!1):(o(null),!0);const r=new Date(t),i=new Date(n);return isNaN(r.getTime())||isNaN(i.getTime())?(o(null),!0):r>i?(o(e.options?.retryMessageContent||"The start date cannot be after the end date. Please select a valid date range."),!1):(o(null),!0)};return ie(EW,{onSubmit:()=>{const n=t().from,r=t().to;if(e.options?.isRange){if(!n||!r)return void o("Please provide both start and end dates for the date range.")}else if(!n)return void o("Please select a date.");if(!s(n,r))return;const a=i(t().from),l=t().to?i(t().to):"",u=e.options?.isRange?`${a} to ${l}`:a,c=`${t().from}${e.options?.isRange?` to ${t().to}`:""}`;e.onSubmit({type:"text",value:c,label:u})},get buttonLabel(){return e.options?.labels?.button},get children(){const o=iZ(),i=o.firstChild,l=i.firstChild;return Be(i,(()=>{const t=N(()=>!!e.options?.isRange);return()=>t()&&(()=>{const t=aZ();return Be(t,()=>e.options.labels?.from??AG.from),t})()})(),l),l.addEventListener("change",e=>{const r={...t(),from:e.currentTarget.value};n(r),s(r.from,r.to)}),l.style.setProperty("min-height","32px"),l.style.setProperty("min-width","100px"),l.style.setProperty("font-size","16px"),Be(o,(()=>{const r=N(()=>!!e.options?.isRange);return()=>r()&&(()=>{const r=sZ(),o=r.firstChild;return Be(r,(()=>{const t=N(()=>!!e.options.isRange);return()=>t()&&(()=>{const t=aZ();return Be(t,()=>e.options.labels?.to??AG.to),t})()})(),o),o.addEventListener("change",e=>{const r={...t(),to:e.currentTarget.value};n(r),s(r.from,r.to)}),o.style.setProperty("min-height","32px"),o.style.setProperty("min-width","100px"),o.style.setProperty("font-size","16px"),P(n=>{const r=e.options.hasTime?"datetime-local":"date",i=(()=>{const n=a(e.options?.min),r=t().from;return r?n?new Date(r)>new Date(n)?r:n:r:n})(),s=a(e.options?.max);return r!==n._v$6&&Oe(o,"type",n._v$6=r),i!==n._v$7&&Oe(o,"min",n._v$7=i),s!==n._v$8&&Oe(o,"max",n._v$8=s),n},{_v$6:void 0,_v$7:void 0,_v$8:void 0}),P(()=>o.value=t().to),r})()})(),null),Be(o,(()=>{const e=N(()=>!!r());return()=>e()&&(()=>{const e=lZ();return e.style.setProperty("color","#c53030"),e.style.setProperty("background-color","#fff5f5"),e.style.setProperty("border","1px solid #feb2b2"),Be(e,r),e})()})(),null),P(n=>{const r=it("flex flex-col w-full",e.options?.isRange?"items-end":"items-center"),s=it("flex items-center",e.options?.isRange&&"pb-0 gap-2"),u=e.options?.hasTime?"datetime-local":"date",c=a(e.options?.min),d=(()=>{const n=a(e.options?.max),r=t().to;return r?n?new Date(r)<new Date(n)?r:n:r:n})();return r!==n._v$&&Pe(o,n._v$=r),s!==n._v$2&&Pe(i,n._v$2=s),u!==n._v$3&&Oe(l,"type",n._v$3=u),c!==n._v$4&&Oe(l,"min",n._v$4=c),d!==n._v$5&&Oe(l,"max",n._v$5=d),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0}),P(()=>l.value=t().from),o}})},cZ=e=>{if(!e.includes("to"))return{from:e,to:""};const[t,n]=e.split(" to ");return{from:t,to:n}},dZ="Numbers",pZ=10,fZ={button:xW},hZ=1,gZ=De('<form class="flex flex-col gap-3"><div class="flex flex-wrap justify-center gap-2 py-2">'),mZ=De('<span class="text-sm w-full text-gray-600 dark:text-gray-400">'),vZ=De('<span class="text-sm w-full text-right pr-2 text-gray-600 dark:text-gray-400">'),yZ=De('<div class="flex justify-end pt-2">'),bZ=De('<div role="checkbox">'),wZ=De("<div>"),EZ=e=>{const[t,n]=O(e.defaultValue?Number(e.defaultValue):void 0),r=n=>{n.preventDefault();const r=t();et(r)||e.onSubmit({type:"text",value:r.toString()})},o=t=>{e.block.options?.isOneClickSubmitEnabled&&e.onSubmit({type:"text",value:t.toString()}),n(t)};return(()=>{const n=gZ(),i=n.firstChild;return n.addEventListener("submit",r),Be(n,(()=>{const t=N(()=>!!e.block.options?.labels?.left);return()=>t()&&(()=>{const t=mZ();return Be(t,()=>e.block.options.labels.left),t})()})(),i),Be(i,ie(ge,{get each(){return Array.from(Array((e.block.options?.length??pZ)+("Numbers"===(e.block.options?.buttonType??dZ)?-((e.block.options?.startsAt??hZ)-1):0)))},children:(n,r)=>ie(_Z,ce(()=>e.block.options,{get rating(){return t()},get idx(){return r()+("Numbers"===(e.block.options?.buttonType??dZ)?e.block.options?.startsAt??hZ:1)},onClick:o}))})),Be(n,(()=>{const t=N(()=>!!e.block.options?.labels?.right);return()=>t()&&(()=>{const t=vZ();return Be(t,()=>e.block.options.labels.right),t})()})(),null),Be(n,(()=>{const n=N(()=>!!Je(t()));return()=>n()&&(()=>{const t=yZ();return Be(t,ie(bW,{get children(){return e.block.options?.labels?.button??fZ.button}})),t})()})(),null),n})()},_Z=e=>{const t=t=>{t.preventDefault(),e.onClick(e.idx)};return ie(ye,{get children(){return[ie(be,{get when(){return"Numbers"===(e.buttonType??dZ)},get children(){return[ie(ve,{get when(){return e.isOneClickSubmitEnabled},get children(){return ie(yW,{"on:click":t,get children(){return e.idx}})}}),ie(ve,{get when(){return!e.isOneClickSubmitEnabled},get children(){const n=bZ();return n.addEventListener("click",t),Be(n,()=>e.idx),P(t=>{const r=Je(e.rating)&&e.idx<=e.rating,o=it("button button--selectable flex items-center justify-center font-medium focus:outline-none cursor-pointer select-none",Je(e.rating)&&e.idx<=e.rating&&" button--selected");return r!==t._v$&&Oe(n,"aria-checked",t._v$=r),o!==t._v$2&&Pe(n,t._v$2=o),t},{_v$:void 0,_v$2:void 0}),n}})]}}),ie(be,{get when(){return"Numbers"!==(e.buttonType??dZ)},get children(){const t=wZ();return t.addEventListener("click",()=>e.onClick(e.idx)),P(n=>{const r="input__field--rating flex justify-center items-center cursor-pointer w-[48px] h-[48px]"+(Je(e.rating)&&e.idx<=e.rating?" input__field--rating--selected":""),o=e.customIcon?.isEnabled&&!tt(e.customIcon.svg)?e.customIcon.svg:xZ;return r!==n._v$3&&Pe(t,n._v$3=r),o!==n._v$4&&(t.innerHTML=n._v$4=o),n},{_v$3:void 0,_v$4:void 0}),t}})]}})},xZ='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>',kZ={isMultipleAllowed:!1,labels:{placeholder:"<strong>\n Click to upload\n </strong> or drag and drop<br>\n (size limit: 10MB)",button:"Upload",clear:"Clear",skip:"Skip",success:{single:"File uploaded",multiple:"{total} files uploaded"}}},CZ=De('<div class="w-full bg-gray-200 rounded-full h-2.5"><div class="h-2.5 rounded-full input__field--upload__progress-bar">'),SZ=De('<div class="p-4 flex gap-2 border-gray-200 border overflow-auto bg-white rounded-md w-full">'),TZ=De('<div class="flex flex-col justify-center items-center gap-4 max-w-[90%]"><p class="text-sm text-gray-500 text-center">'),DZ=De('<input id="dropzone-file" type="file" class="hidden">'),AZ=De('<div class="flex justify-end">'),OZ=De('<div class="flex justify-end"><div class="flex gap-2">'),PZ=De('<form class="flex flex-col w-full gap-2"><label for="dropzone-file">'),IZ=De('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-gray-500"><polyline points="16 16 12 12 8 16"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16">'),NZ=e=>{const[t,n]=O([]),[r,o]=O(!1),[i,a]=O(0),[s,l]=O(!1),u=r=>{const o=Array.from(r).map(e=>LW({existingFiles:t(),newFile:e,onError:({description:e,title:t})=>MW.create({title:t,description:e})})).filter(Je);if(0!==o.length)return e.block.options?.isMultipleAllowed?void n([...t(),...o]):d(o[0])},c=async e=>{e.preventDefault(),0!==t().length&&p(t())},d=async t=>{o(!0);const n=await UW({apiHost:e.context.apiHost??St({ignoreChatApiUrl:!0}),files:[{file:t,input:{sessionId:e.context.sessionId,fileName:t.name}}]});if(o(!1),n.length&&n[0])return e.onSubmit({type:"text",label:e.block.options?.labels?.success?.single??kZ.labels.success.single,value:n[0]?BZ(n[0].url):"",attachments:[{type:t.type,url:n[0].url}]});MW.create({description:"An error occured while uploading the file"})},p=async t=>{o(!0);const n=await UW({apiHost:e.context.apiHost??St({ignoreChatApiUrl:!0}),files:t.map(t=>({file:t,input:{sessionId:e.context.sessionId,fileName:t.name}})),onUploadProgress:a});if(o(!1),a(0),n.length!==t.length)return MW.create({description:"An error occured while uploading the files"});e.onSubmit({type:"text",label:n.length>1?(e.block.options?.labels?.success?.multiple??kZ.labels.success.multiple).replaceAll("{total}",n.length.toString()):e.block.options?.labels?.success?.single??kZ.labels.success.single,value:n.filter(Je).map(({url:e})=>BZ(e)).join(", "),attachments:n.filter(Je)})},f=e=>{e.preventDefault(),l(!0)},h=()=>l(!1),g=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer?.files&&u(e.dataTransfer.files)},m=()=>n([]),v=()=>e.onSkip(e.block.options?.labels?.skip??kZ.labels.skip);return(()=>{const o=PZ(),a=o.firstChild;return o.addEventListener("submit",c),a.addEventListener("drop",g),a.addEventListener("dragleave",h),a.addEventListener("dragover",f),Be(a,ie(ye,{get children(){return[ie(be,{get when(){return r()},get children(){return ie(ve,{get when(){return t().length>1},get fallback(){return ie(mW,{})},get children(){const e=CZ(),t=e.firstChild;return t.style.setProperty("transition","width 150ms cubic-bezier(0.4, 0, 0.2, 1)"),P(()=>null!=`${i()>0?i:10}%`?t.style.setProperty("width",`${i()>0?i:10}%`):t.style.removeProperty("width")),e}})}}),ie(be,{get when(){return!r()},get children(){return[(()=>{const r=TZ(),o=r.firstChild;return Be(r,ie(ve,{get when(){return t().length},get fallback(){return ie(RZ,{})},get children(){const e=SZ();return e.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()}),Be(e,ie(ge,{get each(){return t()},children:(e,t)=>ie(dW,{file:e,onRemoveClick:()=>(e=>{n(t=>t.filter((t,n)=>n!==e))})(t())})})),e}}),o),P(()=>o.innerHTML=e.block.options?.labels?.placeholder??kZ.labels.placeholder),r})(),(()=>{const t=DZ();return t.addEventListener("change",e=>{e.currentTarget.files&&u(e.currentTarget.files)}),P(()=>t.multiple=e.block.options?.isMultipleAllowed??kZ.isMultipleAllowed),t})()]}})]}})),Be(o,ie(ve,{get when(){return 0===t().length&&!1===e.block.options?.isRequired},get children(){const t=AZ();return Be(t,ie(yW,{"on:click":v,get children(){return e.block.options?.labels?.skip??kZ.labels.skip}})),t}}),null),Be(o,ie(ve,{get when(){return N(()=>!!(e.block.options?.isMultipleAllowed&&t().length>0))()&&!r()},get children(){const n=OZ(),r=n.firstChild;return Be(r,ie(ve,{get when(){return t().length},get children(){return ie(yW,{"on:click":m,get children(){return e.block.options?.labels?.clear??kZ.labels.clear}})}}),null),Be(r,ie(bW,{get children(){return N(()=>(e.block.options?.labels?.button??kZ.labels.button)===kZ.labels.button)()?`Upload ${t().length} file${t().length>1?"s":""}`:e.block.options?.labels?.button}}),null),n}}),null),P(()=>Pe(a,"input__field--upload py-6 flex flex-col justify-center items-center w-full bg-gray-50 border-2 border-gray-300 border-dashed cursor-pointer hover:bg-gray-100 px-8"+(s()?"input__upload--dragging":""))),o})()},RZ=()=>IZ(),BZ=e=>{const t=e.split("/"),n=t.pop();if(!n)return e;let r=n;try{r=decodeURIComponent(n)}catch{}const o=encodeURIComponent(r);return[...t,o].join("/")},FZ=xW,LZ="Filter the options...",MZ=De('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3px" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12">'),UZ=e=>(()=>{const t=MZ();return Ne(t,e,!0,!0),t})(),jZ=De('<button class="w-5 h-5">'),$Z=De('<div class="flex justify-between items-center gap-2 w-full pr-4"><input class="input__field focus:outline-none bg-transparent px-4 py-4 flex-1 w-full" type="text">'),zZ=e=>{const[t,n]=O(""),[r,o]=de(e,["onInput","ref"]),i=()=>{n(""),e.onClear()};return(()=>{const a=$Z(),s=a.firstChild;s.$$input=e=>(e=>{n(e),r.onInput(e)})(e.currentTarget.value);const l=e.ref;return"function"==typeof l?Re(l,s):e.ref=s,s.style.setProperty("font-size","16px"),Ne(s,ce({get value(){return t()}},o),!1,!1),Be(a,ie(ve,{get when(){return t().length>0},get children(){const e=jZ();return e.addEventListener("click",i),Be(e,ie(vt,{class:"w-4"})),e}}),null),a})()};Ae(["input"]);const HZ=De('<form class="flex flex-col gap-2 w-full items-end">'),VZ=De('<div class="flex flex-col gap-2 w-full items-end">'),WZ=De('<div class="flex items-end w-full">'),qZ=De("<div>"),GZ=De('<img fetchpriority="high" class="m-auto min-w-[200px] w-full max-h-[200px] h-full object-cover rounded-t-[var(--quickbot-button-border-radius)]">'),KZ=De('<span class="font-normal">'),YZ=De('<span class="text-sm whitespace-pre-wrap text-left">'),ZZ=De('<div class="flex flex-col gap-1 flex-1">'),XZ=De("<span>"),QZ=De('<span class="flex h-3 w-3 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-3 w-3 brightness-150">'),JZ=e=>{let t;const[n,r]=O(e.defaultItems),[o,i]=O([]),[a,s]=O(0);B(()=>{zi(),0});const l=t=>{const r=n()[t];if(r){if(!e.multiple){const t=r.content,n=r.value??r.content??r.id;return r.pictureSrc?e.onSubmit({type:"text",label:nt(t)?t:r.pictureSrc??r.id,value:r.value??r.id}):e.onSubmit({type:"text",label:t,value:n})}u(r.id)}},u=e=>{const t=o().indexOf(e);i(-1!==t?t=>t.filter(t=>t!==e):t=>[...t,e])},c=t=>{t?.preventDefault(),e.onSubmit({type:"text",value:o().map(t=>{const n=e.defaultItems.find(e=>e.id===t);return n?n.pictureSrc?nt(n.content)?n.content:n.pictureSrc:n.content:""}).join(", ")})},d=t=>{const n=(t??"").toLowerCase();r(e.defaultItems.filter(e=>{const t=e.content?.toLowerCase()??"";return e.pictureSrc?t.includes(n)||e.description?.toLowerCase().includes(n):t.includes(n)}))};I(()=>{a()===e.defaultItems.filter(e=>Je(e.pictureSrc)).length&&e.onTransitionEnd()});const p=()=>{s(e=>e+1)},f=e=>o().includes(e),h=()=>{if(!e.multiple)return n();const t=o().filter(e=>!n().some(t=>t.id===e)).map(t=>e.defaultItems.find(e=>e.id===t)).filter(Je);return[...n(),...t]};return ie(ye,{get children(){return[ie(be,{get when(){return e.multiple},get children(){const n=HZ();return n.addEventListener("submit",c),Be(n,ie(eX,{get options(){return e.options},get multiple(){return e.multiple},inputRef:t,filterItems:d,get defaultItems(){return e.defaultItems},setFilteredItems:r,get itemsToRender(){return h()},isItemSelected:f,handleClick:l,onImageLoad:p,get chunkIndex(){return e.chunkIndex},get selectedItemIds(){return o()}})),n}}),ie(be,{get when(){return!e.multiple},get children(){const n=VZ();return Be(n,ie(eX,{get options(){return e.options},get multiple(){return e.multiple},inputRef:t,filterItems:d,get defaultItems(){return e.defaultItems},setFilteredItems:r,get itemsToRender(){return h()},isItemSelected:f,handleClick:l,onImageLoad:p,get chunkIndex(){return e.chunkIndex},get selectedItemIds(){return o()}})),n}})]}})},eX=e=>[ie(ve,{get when(){return e.options?.isSearchable},get children(){const t=WZ();return Be(t,ie(zZ,{ref(t){const n=e.inputRef;"function"==typeof n?n(t):e.inputRef=t},get onInput(){return e.filterItems},get placeholder(){return e.options?.searchInputPlaceholder??LZ},onClear:()=>e.setFilteredItems(e.defaultItems)})),t}}),(()=>{const t=qZ();return Be(t,ie(ge,{get each(){return e.itemsToRender},children:(t,n)=>ie(rX,{item:t,get index(){return n()},selected:()=>e.isItemSelected(t.id),onClick:()=>e.handleClick(n()),get onImageLoad(){return e.onImageLoad},get multiple(){return e.multiple},get showPingIndicator(){return 0===e.chunkIndex&&1===e.defaultItems.length}})})),P(()=>Pe(t,it("flex flex-wrap justify-end gap-2",e.options?.isSearchable&&"overflow-y-scroll max-h-80 rounded-md"))),t})(),ie(ve,{get when(){return e.multiple&&e.selectedItemIds.length>0},get children(){return ie(bW,{get children(){return e.options?.buttonLabel??FZ}})}})],tX=e=>(()=>{const t=GZ();return Ie(t,"load",e.onImageLoad),P(n=>{const r=e.item.pictureSrc,o=e.item.content??`Picture ${e.index+1}`,i=`Picture choice ${e.index+1}`;return r!==n._v$&&Oe(t,"src",n._v$=r),o!==n._v$2&&Oe(t,"alt",n._v$2=o),i!==n._v$3&&Oe(t,"elementtiming",n._v$3=i),n},{_v$:void 0,_v$2:void 0,_v$3:void 0}),t})(),nX=e=>(()=>{const t=ZZ();return Be(t,ie(ve,{get when(){return e.item.content},get children(){const t=KZ();return Be(t,()=>e.item.content),t}}),null),Be(t,ie(ve,{get when(){return e.item.description},get children(){const t=YZ();return Be(t,()=>e.item.description),t}}),null),t})(),rX=e=>ie(ye,{get children(){return[ie(be,{get when(){return e.item.pictureSrc&&e.multiple},get children(){return ie(yW,{type:"button",role:"checkbox",get"aria-checked"(){return e.selected()},get"on:click"(){return e.onClick},get class(){return it("button--selectable","button--has-image",rt(e.item.pictureSrc)&&"button--has-svg")},get"data-itemid"(){return e.item.id},get children(){return[ie(tX,{get item(){return e.item},get index(){return e.index},get onImageLoad(){return e.onImageLoad},get multiple(){return e.multiple}}),(()=>{const t=qZ();return Be(t,ie(oX,{get isChecked(){return e.selected()},class:"flex-shrink-0"}),null),Be(t,ie(nX,{get item(){return e.item}}),null),P(()=>Pe(t,it("py-2 px-4 flex items-center gap-2",e.item.description&&"items-start"))),t})()]}})}}),ie(be,{get when(){return e.item.pictureSrc&&!e.multiple},get children(){return ie(yW,{get"on:click"(){return e.onClick},get"data-itemid"(){return e.item.id},get class(){return it("button--selectable","button--has-image",rt(e.item.pictureSrc)&&"button--has-svg")},get children(){return[ie(tX,{get item(){return e.item},get index(){return e.index},get onImageLoad(){return e.onImageLoad},get multiple(){return e.multiple}}),(()=>{const t=qZ();return Be(t,ie(nX,{get item(){return e.item}})),P(()=>Pe(t,it("py-2 px-4 flex items-center gap-2",e.item.description&&"items-start"))),t})()]}})}}),ie(be,{get when(){return!e.item.pictureSrc&&e.multiple},get children(){const t=XZ();return Be(t,ie(yW,{type:"button",role:"checkbox",get"aria-checked"(){return e.selected()},get"on:click"(){return e.onClick},get class(){return it("button--selectable",e.selected()&&"button--selected")},get"data-itemid"(){return e.item.id},get children(){const t=qZ();return Be(t,ie(oX,{get isChecked(){return e.selected()},class:"flex-shrink-0"}),null),Be(t,ie(nX,{get item(){return e.item}}),null),P(()=>Pe(t,it("flex items-center gap-2",e.item.description&&"items-start"))),t}})),P(()=>Pe(t,it("relative",zi()&&"w-full"))),t}}),ie(be,{get when(){return!e.item.pictureSrc&&!e.multiple},get children(){const t=XZ();return Be(t,ie(yW,{get"on:click"(){return e.onClick},get class(){return it("button--selectable",e.selected()&&"button--selected")},get"data-itemid"(){return e.item.id},get children(){const t=qZ();return Be(t,ie(nX,{get item(){return e.item}})),P(()=>Pe(t,it("flex items-center gap-2",e.item.description&&"items-start"))),t}}),null),Be(t,ie(ve,{get when(){return e.showPingIndicator},get children(){return QZ()}}),null),P(()=>Pe(t,it("relative",zi()&&"w-full"))),t}})]}}),oX=e=>(()=>{const t=qZ();return Be(t,ie(UZ,{get classList(){return{"w-3":!0,"h-3":!0,"transition-opacity":!0,"duration-200":!0,"opacity-100":e.isChecked,"group-hover:opacity-0":e.isChecked,"opacity-0":!e.isChecked}}}),null),Be(t,ie(vt,{get classList(){return{absolute:!0,"top-1/2":!0,"left-1/2":!0,"-translate-x-1/2":!0,"-translate-y-1/2":!0,"w-3":!0,"h-3":!0,"transition-opacity":!0,"duration-200":!0,"opacity-0":!0,"group-hover:opacity-100":e.isChecked}}}),null),P(()=>Pe(t,it("button__checkbox","w-4 h-4 rounded-full relative flex items-center justify-center",e.isChecked&&"button__checkbox--checked",e.class))),t})(),iX={button:"Pay",success:"Success"},aX=De('<div class="input__field--error mt-4 text-center animate-fade-in">'),sX=De('<form id="payment-form" class="flex flex-col p-4 w-full items-center"><slot name="stripe-payment-form">');let lX,uX=null,cX=null;const dX=e=>{const[t,n]=O(),[r,o]=O(!1),[i,a]=O(!1);B(async()=>{if(pX(lX),!e.options?.publicKey)return n("Missing Stripe public key");var t;if(uX=await(t=e.options?.publicKey,new Promise(e=>{if(window.Stripe)return e(window.Stripe(t));const n=document.createElement("script");n.src="https://js.stripe.com/v3",document.body.appendChild(n),n.onload=()=>{if(!window.Stripe)throw new Error("Stripe.js failed to load.");e(window.Stripe(t))}})),!uX)return;cX=uX.elements({appearance:{theme:"stripe",variables:{colorPrimary:getComputedStyle(lX).getPropertyValue("--quickbot-button-bg-color")}},clientSecret:e.options.paymentIntentSecret});cX.create("payment",{layout:"tabs"}).mount("#payment-element"),setTimeout(()=>{o(!0),e.onTransitionEnd()},1e3)});const s=async t=>{if(t.preventDefault(),!uX||!cX)return;var r;a(!0),r={sessionId:e.context.sessionId,resultId:e.context.resultId,bot:e.context.bot},sessionStorage.setItem("botPaymentInProgress",JSON.stringify(r));const{postalCode:o,...i}=e.options?.additionalInformation?.address??{},{error:s,paymentIntent:l}=await uX.confirmPayment({elements:cX,confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:e.options?.additionalInformation?.name,email:e.options?.additionalInformation?.email,phone:e.options?.additionalInformation?.phoneNumber,address:{...i,postal_code:o}}}},redirect:"if_required"});return Dt(),a(!1),"validation_error"!==s?.type?"card_error"===s?.type?n(s.message):s||"succeeded"!==l.status?void 0:e.onSuccess():void 0};return(()=>{const n=sX(),o=n.firstChild;n.addEventListener("submit",s);return"function"==typeof lX?Re(lX,o):lX=o,o._$owner=M(),Be(n,ie(ve,{get when(){return r()},get children(){return ie(bW,{get isLoading(){return i()},class:"mt-4 w-full max-w-lg animate-fade-in",get children(){return[N(()=>e.options?.labels?.button??iX.button)," ",N(()=>e.options?.amountLabel)]}})}}),null),Be(n,ie(ve,{get when(){return t()},get children(){const e=aX();return Be(e,t),e}}),null),n})()},pX=e=>{const t=e.getRootNode().host,n=document.createElement("div");n.style.width="100%",n.slot="stripe-payment-form",t.appendChild(n);const r=document.createElement("div");r.id="payment-element",n.appendChild(r)},fX=e=>ie(dX,{get onSuccess(){return e.onSuccess},get options(){return e.options},get context(){return e.context},get onTransitionEnd(){return e.onTransitionEnd}});let hX=function(e){return e.ZAPIER="Zapier",e.MAKE_COM="Make.com",e.PABBLY_CONNECT="Pabbly",e.CHATWOOT="Chatwoot",e.PIXEL="Pixel",e.PAYMENT="stripe",e}({});const gX=De("<div>"),mX=De('<div class="transition-opacity duration-200 px-5 py-3">'),vX=e=>{const{setAnswer:t,isSending:n,getDisplayedMessageIndex:r,chatChunks:o}=$i(),[i,a]=Tn(O(),{key:`bot-${e.context.bot.id}-input-footer-${e.chunkIndex}`,storage:e.context.storage}),s=()=>o()[e.chunkIndex]?.input?.answer,l=()=>{const e=o(),t=!!e.at(-1)?.streamingMessageId||n(),i=e.some((e,t)=>0!==e.messages.length&&r(t)<e.messages.length);return!et(s())||t||i},u=async n=>{a(n),t(e.chunkIndex,n),e.onSubmit(n)},c=n=>{const r={type:"text",value:n};a(r),t(e.chunkIndex,r),e.onSkip()},d=()=>(e.hasError?(e=>{if(e)return"text"===e.type?e.value:e.url})(i()):void 0)??(e.isInputPrefillEnabled?e.block.prefilledValue:void 0),p=()=>u({type:"text",value:e.block.options?.labels?.success??iX.success});return I(()=>{if(e.block.type===kW.FILE)return;const n=rn().findLast(t=>e.chunkIndex===t.inputIndex)?.formattedMessage;if(n){const r=s();if("text"===r?.type&&r.label!==n){if(e.block.type===kW.CHOICE&&r.label)return;a(e=>"text"===e?.type?{...e,label:n}:e),t(e.chunkIndex,{...r,label:n})}}}),(()=>{const t=mX();return Be(t,ie(ve,{get when(){return e.hasHostAvatar},get children(){const e=gX();return P(()=>Pe(e,it("flex flex-shrink-0 items-center",zi()?"w-6 h-6":"w-10 h-10"))),e}}),null),Be(t,ie(ye,{get children(){return[ie(be,{get when(){return e.block.type===kW.TEXT},get children(){return ie(pG,{get block(){return e.block},get defaultValue(){return d()},get context(){return e.context},onSubmit:u,isInputDisabled:l,hasError:!1})}}),ie(be,{get when(){return e.block.type===kW.NUMBER},get children(){return ie(gG,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u})}}),ie(be,{get when(){return e.block.type===kW.EMAIL},get children(){return ie(bG,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u,isInputDisabled:l,hasError:!1})}}),ie(be,{get when(){return e.block.type===kW.URL},get children(){return ie(EG,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u,isInputDisabled:l,hasError:!1})}}),ie(be,{get when(){return e.block.type===kW.PHONE},get children(){return ie(DG,{get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return d()},onSubmit:u,isInputDisabled:l,hasError:!1})}}),ie(be,{get when(){return N(()=>e.block.type===kW.DATE)()&&!l()},get children(){return ie(uZ,{get options(){return e.block.options},get defaultValue(){return d()},onSubmit:u})}}),ie(be,{get when(){return N(()=>e.block.type===kW.RATING)()&&!l()},get children(){return ie(EZ,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u})}}),ie(be,{get when(){return N(()=>e.block.type===kW.FILE)()&&!l()},get children(){return ie(NZ,{get context(){return e.context},get block(){return e.block},onSubmit:u,onSkip:c})}}),ie(be,{get when(){return N(()=>e.block.type===hX.PAYMENT)()&&!l()},get children(){return ie(fX,{get context(){return e.context},get options(){return{...e.block.options,...e.block.runtimeOptions}},onSuccess:p,get onTransitionEnd(){return e.onTransitionEnd}})}}),ie(be,{get when(){return e.block.type===kW.CHOICE&&!l()&&e.block},keyed:!0,children:t=>ie(JZ,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return t.items},get options(){return t.options},onSubmit:u,get onTransitionEnd(){return e.onTransitionEnd},get multiple(){return!!t.options?.isMultipleChoice}})})]}}),null),P(()=>Oe(t,"data-blockid",e.block.id)),t})()},yX=De('<div class="conversation-container__footer transition-colors duration-200 border-t border-black/8 empty:hidden">'),bX=e=>{const{chatChunks:t,theme:n,hasError:r,blockRef:o,currentBlock:i,sendMessage:a,isSending:s,getDisplayedMessageIndex:l}=$i(),u=()=>a(void 0);return[(()=>{const c=yX();return Be(c,ie(ve,{get when(){return i()?.input},children:i=>ie(vX,{get block(){return i()},get chunkIndex(){return t().length-1},get hasHostAvatar(){return n().chat?.hostAvatar?.isEnabled??!1},get guestAvatar(){return n().chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.initialChatReply.bot.settings.general?.isInputPrefillEnabled??ln.isInputPrefillEnabled},get hasError(){return r()},onSubmit:a,onTransitionEnd:()=>sn(o),onSkip:u})}),null),Be(c,ie(ve,{get when(){const e=i(),n=t(),r=!!n.at(-1)?.streamingMessageId||s(),o=n.some((e,t)=>0!==e.messages.length&&l(t)<e.messages.length);return!e?.input&&!r&&!o},get children(){return ie(iW,{})}}),null),c})(),ie(ve,{get when(){return e.initialChatReply.bot.settings.general?.isBrandingEnabled},get children(){return ie(rW,{get botContainer(){return e.botContainer}})}})]},wX=De('<div class="conversation-container flex flex-col h-full">'),EX=e=>ie(ji,ce(e,{get children(){const t=wX();return Be(t,ie(JV,e),null),Be(t,ie(bX,e),null),t}})),_X=De('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),xX=e=>(()=>{const t=_X(),n=t.firstChild,r=n.nextSibling;return Be(n,()=>e.error.message),Be(r,()=>JSON.stringify(e.error.cause,null,2)),t})(),kX="resultId",CX=e=>{if(e)try{const t=sessionStorage.getItem(`bot-${e}-initialChatReply`)??localStorage.getItem(`bot-${e}-initialChatReply`);if(!t)return;return JSON.parse(t)}catch{}},SX=(e,{botId:t,storage:n})=>{try{const r=JSON.stringify(e);OX(n).setItem(`bot-${t}-initialChatReply`,r)}catch{}},TX=()=>{try{sessionStorage.setItem("bot-botOpened","true")}catch{}},DX=()=>{try{sessionStorage.removeItem("bot-botOpened")}catch{}},AX=()=>{try{return"true"===sessionStorage.getItem("bot-botOpened")}catch{return!1}},OX=e=>"session"===(e??ln.rememberUser.storage)?sessionStorage:localStorage,PX=e=>{let t;try{const n=CX(e);n?.bot?.id&&(t=n.bot.id)}catch{}const n=[`bot-${e}`,`resultId-${e}`];t&&t!==e&&(n.push(`bot-${t}`),n.push(`resultId-${t}`));[localStorage,sessionStorage].forEach(e=>{Object.keys(e).forEach(t=>{n.some(e=>t.startsWith(e))&&e.removeItem(t)})})},IX={position:"--quickbot-progress-bar-position",color:"--quickbot-progress-bar-color",colorRgb:"--quickbot-progress-bar-bg-rgb",height:"--quickbot-progress-bar-height",top:"--quickbot-progress-bar-top",bottom:"--quickbot-progress-bar-bottom"},NX={container:{fontFamily:"--quickbot-container-font-family",maxWidth:"--quickbot-chat-container-max-width",maxHeight:"--quickbot-chat-container-max-height",bgColor:"--quickbot-chat-container-bg-rgb",bgImage:"--quickbot-chat-container-bg-image",color:"--quickbot-chat-container-color",borderRadius:"--quickbot-chat-container-border-radius",borderWidth:"--quickbot-chat-container-border-width",borderColor:"--quickbot-chat-container-border-rgb",borderOpacity:"--quickbot-chat-container-border-opacity",opacity:"--quickbot-chat-container-opacity",blur:"--quickbot-chat-container-blur",boxShadow:"--quickbot-chat-container-box-shadow"},hostBubbles:{bgColor:"--quickbot-host-bubble-bg-rgb",color:"--quickbot-host-bubble-color",borderRadius:"--quickbot-host-bubble-border-radius",borderWidth:"--quickbot-host-bubble-border-width",borderColor:"--quickbot-host-bubble-border-rgb",borderOpacity:"--quickbot-host-bubble-border-opacity",opacity:"--quickbot-host-bubble-opacity",blur:"--quickbot-host-bubble-blur",boxShadow:"--quickbot-host-bubble-box-shadow"},guestBubbles:{bgColor:"--quickbot-guest-bubble-bg-rgb",color:"--quickbot-guest-bubble-color",borderRadius:"--quickbot-guest-bubble-border-radius",borderWidth:"--quickbot-guest-bubble-border-width",borderColor:"--quickbot-guest-bubble-border-rgb",borderOpacity:"--quickbot-guest-bubble-border-opacity",opacity:"--quickbot-guest-bubble-opacity",blur:"--quickbot-guest-bubble-blur",boxShadow:"--quickbot-guest-bubble-box-shadow"},inputs:{bgColor:"--quickbot-input-bg-rgb",color:"--quickbot-input-color",placeholderColor:"--quickbot-input-placeholder-color",borderRadius:"--quickbot-input-border-radius",borderWidth:"--quickbot-input-border-width",borderColor:"--quickbot-input-border-rgb",borderOpacity:"--quickbot-input-border-opacity",opacity:"--quickbot-input-opacity",blur:"--quickbot-input-blur",boxShadow:"--quickbot-input-box-shadow"},buttons:{bgRgb:"--quickbot-button-bg-rgb",color:"--quickbot-button-color",borderRadius:"--quickbot-button-border-radius",borderWidth:"--quickbot-button-border-width",borderColor:"--quickbot-button-border-rgb",borderOpacity:"--quickbot-button-border-opacity",opacity:"--quickbot-button-opacity",blur:"--quickbot-button-blur",boxShadow:"--quickbot-button-box-shadow"},checkbox:{bgRgb:"--quickbot-checkbox-bg-rgb",alphaRatio:"--selectable-alpha-ratio"}},RX=(e,t,n)=>{const r=e?.position??RV;t.setProperty(IX.position,"fixed"===r?n?"absolute":"fixed":r),t.setProperty(IX.color,e?.color??"#01a952"),t.setProperty(IX.colorRgb,$W(e?.backgroundColor??"#dffaeb").join(", ")),t.setProperty(IX.height,`${e?.thickness??4}px`);const o=e?.placement??"top";t.setProperty(IX.top,"Top"===o?"0":"auto"),t.setProperty(IX.bottom,"Bottom"===o?"0":"auto")},BX=(e,t)=>{FX(e?.container,t,e?.roundness),LX(e?.hostBubbles,t,e?.roundness),MX(e?.guestBubbles,t,e?.roundness),UX(e?.buttons,t,e?.roundness),jX(e?.inputs,t,e?.roundness),$X(e?.container,t)},FX=(e,t,n)=>{const r=e?.font;t.setProperty(NX.container.fontFamily,("string"==typeof r?r:r?.family)??NV);const o=e?.background,i=o?.type??IV.COLOR,a=o?.content;let s=e?.backgroundColor??FV;o&&i===IV.COLOR&&a?s=a:o&&i===IV.NONE&&(s="transparent");const l="transparent"===s||tt(s),u=HW(s);o&&i===IV.IMAGE&&a?t.setProperty(NX.container.bgImage,`url(${a})`):t.setProperty(NX.container.bgImage,"none"),t.setProperty(NX.container.bgColor,l?"0, 0, 0":u.rgb.join(", ")),t.setProperty(NX.container.color,jW(e?.color??"#303235").join(", ")),t.setProperty(NX.container.maxWidth,e?.maxWidth??"800px"),t.setProperty(NX.container.maxHeight,e?.maxHeight??"100%");const c=l?0:1!==u.alpha?u.alpha:e?.opacity??1;t.setProperty(NX.container.opacity,l?"0":c.toString()),t.setProperty(NX.container.blur,1===c||l?"0px":`${e?.blur??0}px`),HX(e?.shadow,t,NX.container.boxShadow),zX(e?.border??{roundeness:n??BV},t,NX.container.borderRadius),t.setProperty(NX.container.borderWidth,Je(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(NX.container.borderOpacity,Je(e?.border?.opacity)?e.border.opacity.toString():1..toString()),t.setProperty(NX.container.borderColor,$W(e?.border?.color??"").join(", "))},LX=(e,t,n)=>{const r=e?.backgroundColor??"#f5f5f5",o=HW(r);t.setProperty(NX.hostBubbles.bgColor,o.rgb.join(", ")),t.setProperty(NX.hostBubbles.color,e?.color??"#202020"),zX(e?.border??{roundeness:n??BV},t,NX.hostBubbles.borderRadius),t.setProperty(NX.hostBubbles.borderWidth,Je(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(NX.hostBubbles.borderColor,$W(e?.border?.color??"").join(", "));const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(NX.hostBubbles.opacity,i.toString()),t.setProperty(NX.hostBubbles.borderOpacity,Je(e?.border?.opacity)?e.border.opacity.toString():1..toString()),t.setProperty(NX.hostBubbles.blur,Je(e?.blur)?`${e.blur??0}px`:"none"),HX(e?.shadow,t,NX.hostBubbles.boxShadow)},MX=(e,t,n)=>{const r=e?.backgroundColor??"#dffaeb",o=HW(r);t.setProperty(NX.guestBubbles.bgColor,o.rgb.join(", ")),t.setProperty(NX.guestBubbles.color,e?.color??"#1c201f"),zX(e?.border??{roundeness:n??BV},t,NX.guestBubbles.borderRadius),t.setProperty(NX.guestBubbles.borderWidth,Je(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(NX.guestBubbles.borderColor,$W(e?.border?.color??"").join(", ")),t.setProperty(NX.guestBubbles.borderOpacity,Je(e?.border?.opacity)?e.border.opacity.toString():1..toString());const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(NX.guestBubbles.opacity,i.toString()),t.setProperty(NX.guestBubbles.blur,Je(e?.blur)?`${e.blur??0}px`:"none"),HX(e?.shadow,t,NX.guestBubbles.boxShadow)},UX=(e,t,n)=>{const r=e?.backgroundColor??LV,o=HW(r);t.setProperty(NX.buttons.bgRgb,o.rgb.join(", ")),t.setProperty(NX.buttons.color,e?.color??"#ffffff"),zX(e?.border??{roundeness:n??BV},t,NX.buttons.borderRadius),t.setProperty(NX.buttons.borderWidth,Je(e?.border?.thickness)?`${e?.border?.thickness}px`:"0px"),t.setProperty(NX.buttons.borderColor,$W(e?.border?.color??e?.backgroundColor??LV).join(", ")),t.setProperty(NX.buttons.borderOpacity,Je(e?.border?.opacity)?e.border.opacity.toString():1..toString());const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(NX.buttons.opacity,i.toString()),t.setProperty(NX.buttons.blur,Je(e?.blur)?`${e.blur??0}px`:"none"),HX(e?.shadow,t,NX.buttons.boxShadow)},jX=(e,t,n)=>{const r=e?.backgroundColor??"#FFFFFF",o=HW(r);t.setProperty(NX.inputs.bgColor,o.rgb.join(", ")),t.setProperty(NX.inputs.color,e?.color??"#202020"),t.setProperty(NX.inputs.placeholderColor,e?.placeholderColor??"#9095A0"),zX(e?.border??{roundeness:n??BV},t,NX.inputs.borderRadius),t.setProperty(NX.inputs.borderWidth,Je(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(NX.inputs.borderColor,$W(e?.border?.color??"").join(", ")),t.setProperty(NX.inputs.borderOpacity,Je(e?.border?.opacity)?e.border.opacity.toString():1..toString());const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(NX.inputs.opacity,i.toString()),t.setProperty(NX.inputs.blur,Je(e?.blur)?`${e.blur??0}px`:"none"),HX(e?.shadow??"md",t,NX.inputs.boxShadow)},$X=(e,t)=>{const n=e?.backgroundColor??FV;"transparent"===n||tt(n)||(e?.opacity??1)<=.2?(t.setProperty(NX.checkbox.bgRgb,"255, 255, 255"),t.setProperty(NX.checkbox.alphaRatio,"2")):(t.setProperty(NX.checkbox.bgRgb,$W(n).concat(e?.opacity??1).join(", ")),t.setProperty(NX.checkbox.alphaRatio,"2"))},zX=(e,t,n)=>{switch(e?.roundeness??BV){case"none":t.setProperty(n,"0");break;case"medium":t.setProperty(n,"6px");break;case"large":t.setProperty(n,"20px");break;case"custom":t.setProperty(n,`${e.customRoundeness??6}px`)}},HX=(e,t,n)=>{if(void 0!==e)switch(e){case"none":t.setProperty(n,"0 0 #0000");break;case"sm":t.setProperty(n,"0 1px 2px 0 rgb(0 0 0 / 0.05)");break;case"md":t.setProperty(n,"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)");break;case"lg":t.setProperty(n,"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)");break;case"xl":t.setProperty(n,"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)");break;case"2xl":t.setProperty(n,"0 25px 50px -12px rgb(0 0 0 / 0.25)")}else t.setProperty(n,"0 0 #0000")},VX="bot-font",WX=e=>{const t=document.getElementById(VX);if("string"==typeof e||"Google"===e.type){const n=("string"==typeof e?e:e.family)??NV;if(t?.getAttribute("href")?.includes(n))return;t?.remove();const r=document.createElement("link");return r.href=`https://fonts.bunny.net/css2?family=${n}:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&display=swap`,r.rel="stylesheet",r.id=VX,void document.head.appendChild(r)}if("Custom"===e.type){if(nt(e.css)){if(t?.innerHTML===e.css)return;t?.remove();const n=document.createElement("style");n.innerHTML=e.css,n.id=VX,document.head.appendChild(n)}if(nt(e.url)){if(t?.getAttribute("href")===e.url)return;t?.remove();const n=document.createElement("link");n.href=e.url,n.rel="stylesheet",n.id=VX,document.head.appendChild(n)}}},qX=De('<div class="left-0 w-full z-[42424242] progress-bar "><div class="absolute h-full transition-[width] duration-[250ms] ease-in-out progress-bar__fill">'),GX=e=>(()=>{const t=qX(),n=t.firstChild;return P(()=>null!=`${e.value}%`?n.style.setProperty("width",`${e.value}%`):n.style.removeProperty("width")),t})(),[,KX]=O(),YX=De("<style>"),ZX=De('<div class="flex items-center justify-center h-full w-full">'),XX=De("<div>"),QX=e=>{const[t,n]=O(),[r,o]=O(""),[i,a]=O(!1),[s,l]=O(!1),[u,c]=O(),d=async()=>{e.font&&WX(e.font),a(!0),l(!0);const t=new URLSearchParams(location.search);e.onInit?.();const r={};t.forEach((e,t)=>{r[t]=e});const i="string"==typeof e.bot?e.bot:void 0,s="string"!=typeof e.bot||(e.isPreview??!1),u=(e=>{if(e)try{return sessionStorage.getItem(`${kX}-${e}`)??localStorage.getItem(`${kX}-${e}`)??void 0}catch{}})(i),{data:d,error:p}=await async function({bot:e,isPreview:t,apiHost:n,prefilledVariables:r,resultId:o,stripeRedirectStatus:i,startFrom:a,sessionId:s}){if(et(e))throw new Error("Bot ID is required to get initial messages");const l=Tt()??void 0,u=l?JSON.parse(l):void 0;if(u){Dt();try{return{data:{...await Xt.post(Jt({apiHost:n,apiEndpoint:`/api/v1/sessions/${u.sessionId}/continueChat`}),{json:{message:u?"failed"===i?"fail":"Success":void 0},timeout:!1}).json(),...u}}}catch(e){return{error:e}}}const c="string"==typeof e?e:e.id;if(t)try{return{data:await Xt.post(Jt({apiHost:n,apiEndpoint:`/api/v1/bots/${c}/preview/startChat`}),{json:{isStreamEnabled:!0,startFrom:a,bot:e,prefilledVariables:{...r,system_device:en(navigator.userAgent),"Device type":en(navigator.userAgent)},sessionId:s},timeout:!1}).json()}}catch(e){return{error:e}}try{const e=parent!==window&&nt(document.referrer)?new URL(document.referrer).origin:void 0,t=await Xt.post(Jt({apiHost:n,apiEndpoint:`/api/v1/bots/${c}/startChat`}),{headers:{"x-quickbot-iframe-referrer-origin":e},json:{isStreamEnabled:!0,prefilledVariables:{...r,system_device:en(navigator.userAgent),"Device type":en(navigator.userAgent)},resultId:o,isOnlyRegistering:!1},timeout:!1}),i=t.headers.get("access-control-allow-origin");if(e&&i&&"*"!==i&&!e.includes(i))throw new Qt(i);return{data:await t.json()}}catch(e){return{error:e}}}({stripeRedirectStatus:t.get("redirect_status")??void 0,bot:e.bot,apiHost:e.apiHost,isPreview:s,resultId:nt(e.resultId)?e.resultId:u,prefilledVariables:{...r,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(p instanceof At)return l(!1),s?c(new Error("An error occurred while loading the bot.",{cause:{status:p.response.status,body:await p.response.json()}})):400===p.response.status||403===p.response.status?c(new Error("This bot is now closed.")):404===p.response.status?c(new Error("The bot you're looking for doesn't exist.")):c(new Error(`Error! Couldn't initiate the chat. (${p.response.statusText})`));if(p instanceof Qt)return l(!1),c(new Error(p.message));if(!d)return l(!1),p&&(console.error(p),s)?c(new Error("Error! Could not reach server. Check your connection.",{cause:p})):c(new Error("Error! Could not reach server. Check your connection."));if(d.resultId&&i&&(d.bot.settings.general?.rememberUser?.isEnabled??ln.rememberUser.isEnabled)){u&&u!==d.resultId&&PX(i);const t=d.bot.settings.general?.rememberUser?.storage??ln.rememberUser.storage;((e="session")=>(t,n)=>{try{OX(e).setItem(`${kX}-${t}`,n)}catch{}})(t)(i,d.resultId);const r=CX(i);r&&r.bot.publishedAt&&d.bot.publishedAt?new Date(r.bot.publishedAt).getTime()===new Date(d.bot.publishedAt).getTime()?n(d):(PX(i),n(d),SX(d,{botId:i,storage:t})):(n(d),SX(d,{botId:i,storage:t})),e.onChatStatePersisted?.(!0)}else PX(i||d.bot.id),n(d),d.logs&&e.onNewLogs?.(d.logs),e.onChatStatePersisted?.(!1);o(d.bot.theme.customCss??""),l(!1)};return I(()=>{et(e.bot)||i()||d().then()}),I(()=>{et(e.bot)||"string"==typeof e.bot||(o(e.bot.theme.customCss??""),e.bot.theme.progressBar?.isEnabled&&t()&&!t()?.bot.theme.progressBar?.isEnabled&&(a(!1),d().then()))}),F(()=>{a(!1)}),[(()=>{const e=YX();return Be(e,r),e})(),ie(ve,{get when(){return u()},keyed:!0,children:e=>ie(xX,{error:e})}),ie(ve,{get when(){return N(()=>!!s())()&&!u()},get children(){const e=ZX();return Be(e,ie(mW,{class:"h-8 w-8 text-blue-500"})),e}}),ie(ve,{get when(){return t()},keyed:!0,children:t=>ie(JX,{get class(){return e.class},get initialChatReply(){return{...t,bot:{...t.bot,settings:"string"==typeof e.bot?t.bot?.settings:e.bot?.settings,theme:"string"==typeof e.bot?t.bot?.theme:e.bot?.theme}}},get context(){return{apiHost:e.apiHost,isPreview:"string"!=typeof e.bot||(e.isPreview??!1),resultId:t.resultId,sessionId:t.sessionId,bot:t.bot,storage:t.bot.settings.general?.rememberUser?.isEnabled&&"string"==typeof e.bot&&!e.isPreview?t.bot.settings.general?.rememberUser?.storage??ln.rememberUser.storage:void 0}},get progressBarRef(){return e.progressBarRef},get onNewBlock(){return e.onNewBlock},get onNewLogs(){return e.onNewLogs},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onBubblesDisplayed(){return e.onBubblesDisplayed}})})]},JX=e=>{const[t,n]=Tn(O(e.initialChatReply.progress),{storage:e.context.storage,key:`bot-${e.context.bot.id}-progressValue`}),[r,o]=O(!1);let i;const a=new ResizeObserver(e=>Hi(e[0].target.clientWidth<400));return B(()=>{i&&(KX(i),a.observe(i),Qi(`${i.clientHeight}px`),((e,t,n)=>{if(!e)return;const r=t?.style;r&&(RX(e.progressBar,r,n),BX(e.chat,r))})(e.initialChatReply.bot.theme,i,e.context.isPreview),o(!0))}),I(()=>{WX(e.initialChatReply.bot.theme.chat?.container?.font??{type:"Google",family:NV})}),F(()=>{i&&a.unobserve(i)}),(()=>{const o=XX();return"function"==typeof i?Re(i,o):i=o,Be(o,ie(ve,{get when(){return Je(t())&&e.initialChatReply.bot.theme.progressBar?.isEnabled},get children(){return ie(ve,{get when(){return e.progressBarRef&&"fixed"===(e.initialChatReply.bot.theme.progressBar?.position??RV)},get fallback(){return ie(GX,{get value(){return t()}})},get children(){return ie(Ve,{get mount(){return e.progressBarRef},get children(){return ie(GX,{get value(){return t()}})}})}})}}),null),Be(o,ie(ve,{get when(){return r()},get children(){return ie(EX,{botContainer:i,get context(){return e.context},get initialChatReply(){return e.initialChatReply},get onNewBlock(){return e.onNewBlock},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onNewLogs(){return e.onNewLogs},onProgressUpdate:n,get onBubblesDisplayed(){return e.onBubblesDisplayed}})}}),null),Be(o,ie(pV,{toaster:MW,children:e=>ie(hV.Root,{get children(){return[ie(hV.Title,{get children(){return e().title}}),ie(hV.Description,{get children(){return e().description}}),ie(hV.CloseTrigger,{class:"absolute right-2 top-2",get children(){return ie(vt,{class:"w-4"})}})]}})}),null),P(()=>Pe(o,it("h-full w-full flex flex-col quickbot",e.class))),o})()},eQ=De("<style>"),tQ=De("<div>"),nQ=De('<div part="bot">'),rQ=e=>{const[t,n]=de(e,["onOpen","onClose","previewMessage","onPreviewMessageClick","theme","autoShowDelay"]),[r,o]=O(!0),[i,a]=O(n.prefilledVariables),[s,l]=O(!1),[u,c]=O({message:t.previewMessage?.message??"",avatarUrl:t.previewMessage?.avatarUrl}),[d,p]=O(!1),[f,h]=O(!1),[g,m]=O(oQ(t.theme?.button?.size??"medium"));let v;I(()=>{m(oQ(t.theme?.button?.size??"medium"))}),_W(e=>{const{data:t}=e;"open"===t.command&&y(),"close"===t.command&&b(),"toggle"===t.command&&w(),"showPreviewMessage"===t.command&&_(t.message),"hidePreviewMessage"===t.command&&x(),"setPrefilledVariables"===t.command&&a(e=>({...e,...t.variables})),"unmount"===t.command&&k()}),B(()=>{const e=t.autoShowDelay,n=t.previewMessage?.autoShowDelay;(AX()||Tt())&&y(),Je(e)&&setTimeout(()=>{y()},e),Je(n)&&setTimeout(()=>{_()},n)}),I(()=>{e.prefilledVariables&&a(t=>({...t,...e.prefilledVariables}))});const y=()=>{f()||h(!0),x(),p(!0),d()&&t.onOpen?.()},b=()=>{p(!1),DX(),d()&&t.onClose?.()},w=()=>{d()?b():y()},E=()=>{t.onPreviewMessageClick?.(),y()},_=e=>{e&&c(e),d()||l(!0)},x=()=>{l(!1)},k=()=>{d()?(b(),setTimeout(()=>{o(!1)},200)):o(!1)},C=e=>{n.onChatStatePersisted?.(e),e&&TX()};return ie(ve,{get when(){return r()},get children(){return ie(AH,{get value(){return document.querySelector("bot-bubble")?.shadowRoot},get children(){return[(()=>{const e=eQ();return Be(e,Xe),e})(),ie(ve,{get when(){return s()},get children(){return ie(xt,ce(u,{get placement(){return t.theme?.placement},get previewMessageTheme(){return t.theme?.previewMessage},get buttonSize(){return g()},onClick:E,onCloseClick:x}))}}),ie(gt,ce(()=>t.theme?.button,{get placement(){return t.theme?.placement},toggleBot:w,get isBotOpened(){return d()},get buttonSize(){return g()}})),(()=>{const e=tQ();return"function"==typeof v?Re(v,e):v=e,e})(),(()=>{const r=nQ();return r.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),r.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),r.style.setProperty("z-index","42424242"),Be(r,ie(ve,{get when(){return f()},get children(){return ie(QX,ce(n,{onChatStatePersisted:C,get prefilledVariables(){return i()},class:"rounded-lg",progressBarRef:v}))}})),P(n=>{const o=`calc(100% - ${g()} - 32px)`,i=e.theme?.chatWindow?.maxHeight??"704px",a=e.theme?.chatWindow?.maxWidth??"400px",s="left"===e.theme?.placement?"bottom left":"bottom right",l=d()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",u=t.theme?.chatWindow?.backgroundColor,c=`calc(${g()} + 32px)`,p="fixed rounded-lg w-full"+(d()?" opacity-1":" opacity-0 pointer-events-none")+("left"===e.theme?.placement?" left-5":" sm:right-5 right-0");return o!==n._v$&&(null!=(n._v$=o)?r.style.setProperty("height",o):r.style.removeProperty("height")),i!==n._v$2&&(null!=(n._v$2=i)?r.style.setProperty("max-height",i):r.style.removeProperty("max-height")),a!==n._v$3&&(null!=(n._v$3=a)?r.style.setProperty("max-width",a):r.style.removeProperty("max-width")),s!==n._v$4&&(null!=(n._v$4=s)?r.style.setProperty("transform-origin",s):r.style.removeProperty("transform-origin")),l!==n._v$5&&(null!=(n._v$5=l)?r.style.setProperty("transform",l):r.style.removeProperty("transform")),u!==n._v$6&&(null!=(n._v$6=u)?r.style.setProperty("background-color",u):r.style.removeProperty("background-color")),c!==n._v$7&&(null!=(n._v$7=c)?r.style.setProperty("bottom",c):r.style.removeProperty("bottom")),p!==n._v$8&&Pe(r,n._v$8=p),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0}),r})()]}})}})},oQ=e=>"medium"===e?"48px":"large"===e?"64px":e||"48px",iQ=De("<style>"),aQ=De('<div class="relative" aria-labelledby="modal-title" role="dialog" aria-modal="true"><style></style><div class="fixed inset-0 bg-black bg-opacity-50 transition-opacity animate-fade-in" part="overlay"></div><div class="fixed inset-0 z-10 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div>'),sQ=e=>{const[t,n]=de(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[r,o]=O(n.prefilledVariables),[i,a]=O(t.isOpen??!1);_W(e=>{const{data:t}=e;"open"===t.command&&l(),"close"===t.command&&u(),"toggle"===t.command&&c(),"setPrefilledVariables"===t.command&&o(e=>({...e,...t.variables}))}),B(()=>{(t.defaultOpen||Tt()||AX())&&l();const e=t.autoShowDelay;Je(e)&&setTimeout(()=>{l()},e)}),I(()=>{et(e.isOpen)||e.isOpen===i()||c()}),I(()=>{e.prefilledVariables&&o(t=>({...t,...e.prefilledVariables}))});const s=e=>{e.stopPropagation()},l=()=>{a(!0),t.onOpen?.(),document.body.style.setProperty("overflow","hidden","important"),document.addEventListener("pointerdown",u)},u=()=>{a(!1),t.onClose?.(),document.body.style.overflow="auto",document.removeEventListener("pointerdown",u),DX()},c=()=>i()?u():l(),d=e=>{n.onChatStatePersisted?.(e),e&&TX()};return ie(ve,{get when(){return i()},get children(){return ie(AH,{get value(){return document.querySelector("quickbot-popup")?.shadowRoot},get children(){return[(()=>{const e=iQ();return Be(e,Xe),e})(),(()=>{const t=aQ(),o=t.firstChild,i=o.nextSibling.nextSibling.firstChild.firstChild;return Be(o,Xe),i.addEventListener("pointerdown",s),Be(i,ie(QX,ce(n,{get prefilledVariables(){return r()},onChatStatePersisted:d}))),P(n=>{const r=e.theme?.zIndex??42424242,o="relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg"+(e.theme?.backgroundColor?" shadow-xl":""),a=e.theme?.backgroundColor??"transparent",s=e.theme?.width??"512px";return r!==n._v$&&(null!=(n._v$=r)?t.style.setProperty("z-index",r):t.style.removeProperty("z-index")),o!==n._v$2&&Pe(i,n._v$2=o),a!==n._v$3&&(null!=(n._v$3=a)?i.style.setProperty("background-color",a):i.style.removeProperty("background-color")),s!==n._v$4&&(null!=(n._v$4=s)?i.style.setProperty("max-width",s):i.style.removeProperty("max-width")),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t})()]}})}})},lQ=De("<style>\n:host {\n display: block;\n width: 100%;\n height: 100%;\n overflow-y: hidden;\n}\n"),uQ=(e,{element:t})=>{const[n,r]=O(!1),o=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&r(!0)});return _W(()=>{}),B(()=>{o.observe(t)}),F(()=>{o.disconnect()}),ie(AH,{get value(){return document.querySelector("quickbot-standard")?.shadowRoot},get children(){return[(()=>{const e=lQ(),t=e.firstChild;return Be(e,Xe,t),e})(),ie(ve,{get when(){return n()},get children(){return ie(QX,e)}})]}})},cQ=()=>{window.postMessage({isFromBot:!0,command:"close"})},dQ=()=>{window.postMessage({isFromBot:!0,command:"hidePreviewMessage"})},pQ=()=>{window.postMessage({isFromBot:!0,command:"open"})},fQ=e=>{const t={isFromBot:!0,command:"setPrefilledVariables",variables:e};window.postMessage(t)},hQ=e=>{const t={isFromBot:!0,command:"showPreviewMessage",message:e};window.postMessage(t)},gQ=()=>{window.postMessage({isFromBot:!0,command:"toggle"})},mQ=e=>{const t={isFromBot:!0,command:"setInputValue",value:e};window.postMessage(t)},vQ=()=>{window.postMessage({isFromBot:!0,command:"unmount"})},yQ=e=>{const t=e.id?document.getElementById(e.id):document.querySelector("quickbot-standard");if(!t)throw new Error("<quickbot-standard> element not found.");Object.assign(t,e)},bQ=e=>{const t=document.createElement("quickbot-popup");Object.assign(t,e),document.body.prepend(t)},wQ=e=>{const t=document.createElement("bot-bubble");Object.assign(t,e),document.body.prepend(t)};"undefined"!=typeof window&&(Ge("quickbot-standard",Ke,uQ),Ge("bot-bubble",Ze,rQ),Ge("quickbot-popup",Ye,sQ));(e=>{"undefined"!=typeof window&&(window.Bot={...e})})({initStandard:yQ,initPopup:bQ,initBubble:wQ,close:cQ,hidePreviewMessage:dQ,open:pQ,setPrefilledVariables:fQ,showPreviewMessage:hQ,toggle:gQ,setInputValue:mQ,unmount:vQ});