avo 2.18.1.pre.1.eagerloaddirs → 2.19.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of avo might be problematic. Click here for more details.

Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -2
  3. data/Gemfile.lock +2 -5
  4. data/app/components/avo/actions_component.html.erb +1 -1
  5. data/app/components/avo/actions_component.rb +4 -4
  6. data/app/components/avo/base_component.rb +2 -1
  7. data/app/components/avo/field_wrapper_component.rb +7 -1
  8. data/app/components/avo/fields/has_one_field/show_component.rb +1 -2
  9. data/app/components/avo/filters_component.html.erb +1 -1
  10. data/app/components/avo/filters_component.rb +2 -2
  11. data/app/components/avo/sidebar_profile_component.rb +3 -1
  12. data/app/components/avo/views/resource_show_component.html.erb +1 -1
  13. data/app/controllers/avo/base_controller.rb +14 -7
  14. data/app/helpers/avo/application_helper.rb +5 -1
  15. data/app/javascript/js/controllers/search_controller.js +11 -2
  16. data/app/views/avo/partials/_branding.html.erb +1 -0
  17. data/bin/init +11 -1
  18. data/bin/test +1 -0
  19. data/db/factories.rb +5 -0
  20. data/lib/avo/base_action.rb +17 -7
  21. data/lib/avo/concerns/filters_session_handler.rb +43 -0
  22. data/lib/avo/configuration/branding.rb +9 -1
  23. data/lib/avo/configuration.rb +3 -0
  24. data/lib/avo/engine.rb +5 -0
  25. data/lib/avo/fields/base_field.rb +20 -11
  26. data/lib/avo/fields/concerns/has_default.rb +17 -0
  27. data/lib/avo/fields/concerns/is_readonly.rb +1 -1
  28. data/lib/avo/fields/concerns/is_required.rb +2 -2
  29. data/lib/avo/fields/key_value_field.rb +1 -1
  30. data/lib/avo/filters/base_filter.rb +17 -2
  31. data/lib/avo/hosts/resource_view_record_host.rb +7 -0
  32. data/lib/avo/hosts/visibility_host.rb +11 -0
  33. data/lib/avo/resources/controls/action.rb +1 -3
  34. data/lib/avo/services/authorization_clients/nil_client.rb +37 -0
  35. data/lib/avo/services/authorization_service.rb +11 -1
  36. data/lib/avo/version.rb +1 -1
  37. data/lib/avo.rb +2 -0
  38. data/lib/generators/avo/resource_generator.rb +281 -0
  39. data/lib/generators/avo/templates/action.tt +3 -0
  40. data/lib/generators/avo/templates/filters/boolean_filter.tt +3 -0
  41. data/lib/generators/avo/templates/filters/multiple_select_filter.tt +3 -0
  42. data/lib/generators/avo/templates/filters/select_filter.tt +3 -0
  43. data/lib/generators/avo/templates/filters/text_filter.tt +3 -0
  44. data/lib/generators/avo/templates/initializer/avo.tt +4 -0
  45. data/lib/generators/avo/templates/resource/controller.tt +1 -1
  46. data/lib/generators/avo/templates/resource/resource.tt +2 -2
  47. data/lib/generators/model_generator.rb +10 -0
  48. data/lib/generators/rails/avo_resource_generator.rb +11 -0
  49. data/public/avo-assets/avo.base.js +1 -1
  50. data/public/avo-assets/avo.base.js.map +2 -2
  51. data/public/avo-assets/favicon.ico +0 -0
  52. metadata +12 -5
  53. data/config/master.key +0 -1
@@ -123,7 +123,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
123
123
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _tt(t,e){if(!!t){if(typeof t=="string")return WF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return WF(t,e)}}function Stt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function ktt(t){if(Array.isArray(t))return WF(t)}function WF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function que(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,a=i.attribute,s=i.tagName,u=s===void 0?"mark":s;return e.apply(void 0,[r,{}].concat(xtt(qE({hit:o,attribute:a}).map(function(c,f){return c.isHighlighted?e(u,{key:f},c.value):c.value}))))}}var Fue=se(()=>{km()});function Ett(t){return Dtt(t)||Att(t)||Ttt(t)||Ctt()}function Ctt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
124
124
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ttt(t,e){if(!!t){if(typeof t=="string")return UF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return UF(t,e)}}function Att(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Dtt(t){if(Array.isArray(t))return UF(t)}function UF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Nue(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,a=i.attribute,s=i.tagName,u=s===void 0?"mark":s;return e.apply(void 0,[r,{}].concat(Ett(bue({hit:o,attribute:a}).map(function(c,f){return c.isHighlighted?e(u,{key:f},c.value):c.value}))))}}var Bue=se(()=>{km()});function Ott(t){return Ptt(t)||Ltt(t)||Itt(t)||Mtt()}function Mtt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
125
125
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Itt(t,e){if(!!t){if(typeof t=="string")return VF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VF(t,e)}}function Ltt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Ptt(t){if(Array.isArray(t))return VF(t)}function VF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function jue(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,a=i.attribute,s=i.tagName,u=s===void 0?"mark":s;return e.apply(void 0,[r,{}].concat(Ott(wue({hit:o,attribute:a}).map(function(c,f){return c.isHighlighted?e(u,{key:f},c.value):c.value}))))}}var zue=se(()=>{km()});function Rtt(t){return Btt(t)||Ntt(t)||Ftt(t)||qtt()}function qtt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
126
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ftt(t,e){if(!!t){if(typeof t=="string")return $F(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $F(t,e)}}function Ntt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Btt(t){if(Array.isArray(t))return $F(t)}function $F(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Hue(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,a=i.attribute,s=i.tagName,u=s===void 0?"mark":s;return e.apply(void 0,[r,{}].concat(Rtt(BE({hit:o,attribute:a}).map(function(c,f){return c.isHighlighted?e(u,{key:f},c.value):c.value}))))}}var Wue=se(()=>{km()});var Uue=se(()=>{Fue();Bue();zue();Wue()});function Vue(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function HE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vue(Object(r),!0).forEach(function(n){jtt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vue(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function jtt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ztt(t,e){if(t==null)return{};var r=Htt(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}function Htt(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function $ue(t){var e,r=t.classNames,n=t.container,i=t.getEnvironmentProps,o=t.getFormProps,a=t.getInputProps,s=t.getItemProps,u=t.getLabelProps,c=t.getListProps,f=t.getPanelProps,p=t.getRootProps,g=t.panelContainer,m=t.panelPlacement,x=t.render,w=t.renderNoResults,A=t.renderer,k=t.detachedMediaQuery,T=t.components,D=ztt(t,["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components"]),M=wF(n);M.tagName;var P=typeof window<"u"?window:{},_=A??Vtt,C={Highlight:que(_),ReverseHighlight:Nue(_),ReverseSnippet:jue(_),Snippet:Hue(_)};return{renderer:{classNames:Ale(Wtt,r??{}),container:M,getEnvironmentProps:i??function(O){var F=O.props;return F},getFormProps:o??function(O){var F=O.props;return F},getInputProps:a??function(O){var F=O.props;return F},getItemProps:s??function(O){var F=O.props;return F},getLabelProps:u??function(O){var F=O.props;return F},getListProps:c??function(O){var F=O.props;return F},getPanelProps:f??function(O){var F=O.props;return F},getRootProps:p??function(O){var F=O.props;return F},panelContainer:g?wF(g):document.body,panelPlacement:m??"input-wrapper-width",render:x??Utt,renderNoResults:w,renderer:_,detachedMediaQuery:k??getComputedStyle(P.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:HE(HE({},C),T)},core:HE(HE({},D),{},{id:(e=D.id)!==null&&e!==void 0?e:wE(),environment:P})}}var Wtt,Utt,Vtt,Yue=se(()=>{wh();hue();Uue();_m();Wtt={clearButton:"aa-ClearButton",detachedCancelButton:"aa-DetachedCancelButton",detachedContainer:"aa-DetachedContainer",detachedFormContainer:"aa-DetachedFormContainer",detachedOverlay:"aa-DetachedOverlay",detachedSearchButton:"aa-DetachedSearchButton",detachedSearchButtonIcon:"aa-DetachedSearchButtonIcon",detachedSearchButtonPlaceholder:"aa-DetachedSearchButtonPlaceholder",form:"aa-Form",input:"aa-Input",inputWrapper:"aa-InputWrapper",inputWrapperPrefix:"aa-InputWrapperPrefix",inputWrapperSuffix:"aa-InputWrapperSuffix",item:"aa-Item",label:"aa-Label",list:"aa-List",loadingIndicator:"aa-LoadingIndicator",panel:"aa-Panel",panelLayout:"aa-PanelLayout",root:"aa-Autocomplete",source:"aa-Source",sourceFooter:"aa-SourceFooter",sourceHeader:"aa-SourceHeader",sourceNoResults:"aa-SourceNoResults",submitButton:"aa-SubmitButton"},Utt=function(e,r){var n=e.children;due(n,r)},Vtt={createElement:OF,Fragment:Sm}});function Kue(t){var e=t.panelPlacement,r=t.container,n=t.form,i=t.environment,o=r.getBoundingClientRect(),a=o.top+o.height;switch(e){case"start":return{top:a,left:o.left};case"end":return{top:a,right:i.document.documentElement.clientWidth-(o.left+o.width)};case"full-width":return{top:a,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var s=n.getBoundingClientRect();return{top:a,left:s.left,right:i.document.documentElement.clientWidth-(s.left+s.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}var Gue=se(()=>{});function WE(){return WE=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},WE.apply(this,arguments)}function Xue(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function UE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xue(Object(r),!0).forEach(function(n){$tt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xue(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $tt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Que(t){var e=t.autocomplete,r=t.autocompleteScopeApi,n=t.dom,i=t.propGetters,o=t.state;kF(n.root,i.getRootProps(UE({state:o,props:e.getRootProps({})},r))),kF(n.input,i.getInputProps(UE({state:o,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},r))),os(n.label,{hidden:o.status==="stalled"}),os(n.loadingIndicator,{hidden:o.status!=="stalled"}),os(n.clearButton,{hidden:!o.query})}function Zue(t,e){var r=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,o=e.createElement,a=e.dom,s=e.Fragment,u=e.panelContainer,c=e.propGetters,f=e.state,p=e.components;if(!f.isOpen){u.contains(a.panel)&&u.removeChild(a.panel);return}!u.contains(a.panel)&&f.status!=="loading"&&u.appendChild(a.panel),a.panel.classList.toggle("aa-Panel--stalled",f.status==="stalled");var g=f.collections.map(function(w,A){var k=w.source,T=w.items;return o("section",{key:A,className:i.source,"data-autocomplete-source-id":k.sourceId},k.templates.header&&o("div",{className:i.sourceHeader},k.templates.header({components:p,createElement:o,Fragment:s,items:T,source:k,state:f})),T.length===0&&k.templates.noResults&&f.query?o("div",{className:i.sourceNoResults},k.templates.noResults({components:p,createElement:o,Fragment:s,source:k,state:f})):o("ul",WE({className:i.list},c.getListProps(UE({state:f,props:r.getListProps({})},n))),T.map(function(D){var M=r.getItemProps({item:D,source:k});return o("li",WE({key:M.id,className:i.item},c.getItemProps(UE({state:f,props:M},n))),k.templates.item({components:p,createElement:o,Fragment:s,item:D,state:f}))})),k.templates.footer&&o("div",{className:i.sourceFooter},k.templates.footer({components:p,createElement:o,Fragment:s,items:T,source:k,state:f})))}),m=o(s,null,o("div",{className:"aa-PanelLayout aa-Panel--scrollable"},g),o("div",{className:"aa-GradientBottom"})),x=g.reduce(function(w,A){return w[A.props["data-autocomplete-source-id"]]=A,w},{});t({children:m,state:f,sections:g,elements:x,createElement:o,Fragment:s,components:p},a.panel)}var Jue=se(()=>{_m()});function ece(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Sh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ece(Object(r),!0).forEach(function(n){tce(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ece(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function tce(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rce(t){var e=Kle(),r=e.runEffect,n=e.cleanupEffects,i=e.runEffects,o=Xle(),a=o.reactive,s=o.runReactives,u=R0(!1),c=R0(t),f=R0(void 0),p=a(function(){return $ue(c.current)}),g=a(function(){return p.value.core.environment.matchMedia(p.value.renderer.detachedMediaQuery).matches}),m=a(function(){return cle(Sh(Sh({},p.value.core),{},{onStateChange:function(C){var O,F,B;u.current=C.state.collections.some(function(V){return V.source.templates.noResults}),(O=f.current)===null||O===void 0||O.call(f,C),(F=(B=p.value.core).onStateChange)===null||F===void 0||F.call(B,C)},shouldPanelOpen:c.current.shouldPanelOpen||function(_){var C=_.state,O=If(C)>0;if(!p.value.core.openOnFocus&&!C.query)return O;var F=Boolean(u.current||p.value.renderer.renderNoResults);return!O&&F||O}}))}),x=R0(Sh({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},p.value.core.initialState)),w={getEnvironmentProps:p.value.renderer.getEnvironmentProps,getFormProps:p.value.renderer.getFormProps,getInputProps:p.value.renderer.getInputProps,getItemProps:p.value.renderer.getItemProps,getLabelProps:p.value.renderer.getLabelProps,getListProps:p.value.renderer.getListProps,getPanelProps:p.value.renderer.getPanelProps,getRootProps:p.value.renderer.getRootProps},A={setActiveItemId:m.value.setActiveItemId,setQuery:m.value.setQuery,setCollections:m.value.setCollections,setIsOpen:m.value.setIsOpen,setStatus:m.value.setStatus,setContext:m.value.setContext,refresh:m.value.refresh},k=a(function(){return $le({autocomplete:m.value,autocompleteScopeApi:A,classNames:p.value.renderer.classNames,isDetached:g.value,placeholder:p.value.core.placeholder,propGetters:w,state:x.current})});function T(){os(k.value.panel,{style:g.value?{}:Kue({panelPlacement:p.value.renderer.panelPlacement,container:k.value.root,form:k.value.form,environment:p.value.core.environment})})}function D(_){x.current=_;var C={autocomplete:m.value,autocompleteScopeApi:A,classNames:p.value.renderer.classNames,components:p.value.renderer.components,container:p.value.renderer.container,createElement:p.value.renderer.renderer.createElement,dom:k.value,Fragment:p.value.renderer.renderer.Fragment,panelContainer:g.value?k.value.detachedContainer:p.value.renderer.panelContainer,propGetters:w,state:x.current},O=!If(_)&&!u.current&&p.value.renderer.renderNoResults||p.value.renderer.render;Que(C),Zue(O,C)}r(function(){var _=m.value.getEnvironmentProps({formElement:k.value.form,panelElement:k.value.panel,inputElement:k.value.input});return os(p.value.core.environment,_),function(){os(p.value.core.environment,Object.keys(_).reduce(function(C,O){return Sh(Sh({},C),{},tce({},O,void 0))},{}))}}),r(function(){var _=g.value?p.value.core.environment.document.body:p.value.renderer.panelContainer,C=g.value?k.value.detachedOverlay:k.value.panel;return g.value&&x.current.isOpen&&k.value.openDetachedOverlay(),D(x.current),function(){_.contains(C)&&_.removeChild(C)}}),r(function(){var _=p.value.renderer.container;return _.appendChild(k.value.root),function(){_.removeChild(k.value.root)}}),r(function(){var _=hF(function(C){var O=C.state;D(O)},0);return f.current=function(C){var O=C.state,F=C.prevState;if(O.isOpen&&!F.isOpen&&T(),O.query!==F.query){var B=document.querySelectorAll(".aa-Panel--scrollable");B.forEach(function(V){V.scrollTop!==0&&(V.scrollTop=0)})}_({state:O})},function(){f.current=void 0}}),r(function(){var _=hF(function(){var C=g.value;g.value=p.value.core.environment.matchMedia(p.value.renderer.detachedMediaQuery).matches,C!==g.value?P({}):requestAnimationFrame(T)},20);return p.value.core.environment.addEventListener("resize",_),function(){p.value.core.environment.removeEventListener("resize",_)}}),r(function(){if(!g.value)return function(){};function _(F){k.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",F)}function C(F){_(F.matches)}var O=p.value.core.environment.matchMedia(getComputedStyle(p.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));return _(O.matches),O.addEventListener("change",C),function(){O.removeEventListener("change",C)}}),r(function(){return requestAnimationFrame(T),function(){}});function M(){n()}function P(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(),c.current=SF(p.value.renderer,p.value.core,{initialState:x.current},_),s(),i(),m.value.refresh().then(function(){D(x.current)})}return Sh(Sh({},A),{},{update:P,destroy:M})}var nce=se(()=>{Cle();wh();Yle();Gle();Qle();Yue();Gue();Jue();_m()});var ice,oce=se(()=>{ice="1.0.0-alpha.46"});function ace(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function sce(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ace(Object(r),!0).forEach(function(n){Ytt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ace(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ytt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var lce,uce=se(()=>{km();oce();lce=jE(function(t){return zE(sce(sce({},t),{},{userAgents:[{segment:"autocomplete-js",version:ice}]}))})});var cce=se(()=>{});var OOt,fce=se(()=>{uce();OOt=lce({transformResponse:function(e){return e.hits}})});var dce=se(()=>{cce();fce()});var hce=se(()=>{});var pce=se(()=>{});var gce=se(()=>{});var mce=se(()=>{});var vce=se(()=>{});var yce=se(()=>{});var bce=se(()=>{});var xce=se(()=>{});var wce=se(()=>{});var _ce=se(()=>{});var Sce=se(()=>{});var kce=se(()=>{});var Ece=se(()=>{});var Cce=se(()=>{hce();pce();gce();mce();vce();yce();bce();xce();wce();_ce();Sce();kce();Ece()});var Tce=se(()=>{nce();dce();Cce()});var Ace,Dce=se(()=>{Ace=(t,e)=>{let r;return(...n)=>(r&&clearTimeout(r),new Promise(i=>{r=setTimeout(()=>i(t(...n)),e)}))}});var Oce,Mce,VE,Ice=se(()=>{Oce=Vr(mL());Pr();FL();Tce();Mce=Vr(N1());Dce();VE=class extends Ct{constructor(){super(...arguments);pt(this,"debouncedFetch",Ace(fetch,this.searchDebounce));pt(this,"destroyMethod")}get dataset(){return this.autocompleteTarget.dataset}get searchDebounce(){return window.Avo.configuration.search_debounce}get translationKeys(){let t;try{t=JSON.parse(this.dataset.translationKeys)}catch(e){t={}}return t}get isBelongsToSearch(){return this.dataset.viaAssociation==="belongs_to"}get isHasManySearch(){return this.dataset.viaAssociation==="has_many"}get isGlobalSearch(){return this.dataset.searchResource==="global"}connect(){let t=this;this.buttonTarget.onclick=()=>this.showSearchPanel(),this.clearValueTargets.forEach(e=>{e.getAttribute("value")&&this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")}),this.isGlobalSearch&&Oce.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="",rce({container:this.autocompleteTarget,placeholder:this.translationKeys.placeholder,translations:{detachedCancelButtonText:this.translationKeys.cancel_button},autoFocus:!0,openOnFocus:!0,detachedMediaQuery:"",getSources:({query:e})=>{document.body.classList.add("search-loading");let r=t.searchUrl(e);return t.debouncedFetch(r).then(n=>(document.body.classList.remove("search-loading"),n.json())).then(n=>Object.keys(n).map(i=>t.addSource(i,n[i])))}}),this.buttonTarget.dataset.shouldBeDisabled!=="true"&&this.buttonTarget.removeAttribute("disabled")}addSource(t,e){let r=this;return{sourceId:t,getItems:()=>e.results,onSelect:r.handleOnSelect.bind(r),templates:{header(){return`${e.header.toUpperCase()} ${e.help}`},item({item:n,createElement:i}){let o=[];if(n._avatar){let s;switch(n._avatar_type){default:case"circle":s="rounded-full";break;case"rounded":s="rounded";break;case"square":s="rounded-none";break}o.push(i("img",{src:n._avatar,alt:n._label,class:`flex-shrink-0 w-8 h-8 my-[2px] inline mr-2 ${s}`}))}let a=[n._label];return n._description&&a.push(i("div",{class:"aa-ItemDescription"},n._description)),o.push(i("div",null,a)),i("div",{class:"flex"},o)},noResults(){return r.translationKeys.no_item_found.replace("%{item}",t)}}}}handleOnSelect({item:t}){this.isBelongsToSearch?(this.updateFieldAttribute(this.hiddenIdTarget,"value",t._id),this.updateFieldAttribute(this.buttonTarget,"value",t._label),document.querySelector(".aa-DetachedOverlay").remove(),this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")):Yd.visit(t._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(t){return(0,Mce.default)().segment(this.searchSegments()).search(this.searchParams(t)).toString()}searchSegments(){let t=[window.Avo.configuration.root_path,"avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(t=[window.Avo.configuration.root_path,"avo_api","search"]),t}searchParams(t){let e={q:t,global:!1};return this.isGlobalSearch&&(e.global=!0),(this.isBelongsToSearch||this.isHasManySearch)&&(e=this.addAssociationParams(e),e=this.addReflectionParams(e),this.isBelongsToSearch&&(e=zc(za({},e),{via_parent_resource_id:this.dataset.viaParentResourceId,via_parent_resource_class:this.dataset.viaParentResourceClass,via_relation:this.dataset.viaRelation}))),e}addAssociationParams(t){return t=zc(za({},t),{via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId}),t}addReflectionParams(t){return t=zc(za({},t),{via_reflection_class:this.dataset.viaReflectionClass,via_reflection_id:this.dataset.viaReflectionId}),t}showSearchPanel(){this.autocompleteTarget.querySelector("button").click()}clearValue(){this.clearValueTargets.map(t=>this.updateFieldAttribute(t,"value","")),this.clearButtonTarget.classList.add("hidden")}updateFieldAttribute(t,e,r){t.setAttribute(e,r),t.dispatchEvent(new Event("input"))}};pt(VE,"targets",["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"])});var Lce,$E,Pce=se(()=>{Pr();Lce=Vr(N1()),$E=class extends Ct{get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(t){if(!this.parentTurboFrame.src)return;let e=new Lce.default(this.parentTurboFrame.src);e.search(zc(za({},e.query(!0)),{range:t.currentTarget.value})),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};pt($E,"targets",["select"])});var YE,Rce=se(()=>{nm();YE=class extends Ca{getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:t}=this.selectorTarget.dataset;return t}};pt(YE,"targets",["selector"])});async function GF(t,e=null){t.classList.remove("hidden"),await Fce("enter",t,e)}async function XF(t,e=null){await Fce("leave",t,e),t.classList.add("hidden")}async function qce(t,e=null){t.classList.contains("hidden")?await GF(t,e):await XF(t,e)}async function Fce(t,e,r){let n=e.dataset,i=r?`${r}-${t}`:t,o=`transition${t.charAt(0).toUpperCase()+t.slice(1)}`,a=n[o]?n[o].split(" "):[i],s=n[`${o}Start`]?n[`${o}Start`].split(" "):[`${i}-start`],u=n[`${o}End`]?n[`${o}End`].split(" "):[`${i}-end`];YF(e,a),YF(e,s),await Ktt(),KF(e,s),YF(e,u),await Gtt(e),KF(e,u),KF(e,a)}function YF(t,e){t.classList.add(...e)}function KF(t,e){t.classList.remove(...e)}function Ktt(){return new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})})}function Gtt(t){return new Promise(e=>{let r=getComputedStyle(t).transitionDuration.split(",")[0],n=Number(r.replace("s",""))*1e3;setTimeout(()=>{e()},n)})}var Nce=se(()=>{});function KE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}function QF(t,e){function r(i,o,a){if(!(typeof document>"u")){a=KE({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var u in a)!a[u]||(s+="; "+u,a[u]!==!0&&(s+="="+a[u].split(";")[0]));return document.cookie=i+"="+t.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var u=o[s].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(a[f]=t.read(c,f),i===f)break}catch{}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",KE({},o,{expires:-1}))},withAttributes:function(i){return QF(this.converter,KE({},this.attributes,i))},withConverter:function(i){return QF(KE({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Xtt,Qtt,z0,Bce=se(()=>{Xtt={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};Qtt=QF(Xtt,{path:"/"}),z0=Qtt});var H0,jce=se(()=>{Pr();Nce();Bce();H0=class extends Ct{get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return z0.get(this.cookieKey)==="1"}set cookie(t){z0.set(this.cookieKey,t===!0?1:0)}markSidebarClosed(){z0.set(this.cookieKey,"0"),this.openValue=!1,XF(this.sidebarTarget),this.mainAreaTarget.classList.remove("sidebar-open")}markSidebarOpen(){z0.set(this.cookieKey,"1"),this.openValue=!0,GF(this.sidebarTarget),this.mainAreaTarget.classList.add("sidebar-open")}toggleSidebar(){this.openValue?this.markSidebarClosed():this.markSidebarOpen()}toggleSidebarOnMobile(){qce(this.mobileSidebarTarget)}};pt(H0,"targets",["sidebar","mobileSidebar","mainArea"]),pt(H0,"values",{open:Boolean})});var Wce=Z((zce,Hce)=>{(function(t){typeof zce=="object"&&typeof Hce=="object"?t(Br()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){"use strict";var e=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,r=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,n=/[*+-]\s/;t.commands.newlineAndIndentContinueMarkdownList=function(o){if(o.getOption("disableInput"))return t.Pass;for(var a=o.listSelections(),s=[],u=0;u<a.length;u++){var c=a[u].head,f=o.getStateAfter(c.line),p=t.innerMode(o.getMode(),f);if(p.mode.name!=="markdown"){o.execCommand("newlineAndIndent");return}else f=p.state;var g=f.list!==!1,m=f.quote!==0,x=o.getLine(c.line),w=e.exec(x),A=/^\s*$/.test(x.slice(0,c.ch));if(!a[u].empty()||!g&&!m||!w||A){o.execCommand("newlineAndIndent");return}if(r.test(x)){var k=m&&/>\s*$/.test(x),T=!/>\s*$/.test(x);(k||T)&&o.replaceRange("",{line:c.line,ch:0},{line:c.line,ch:c.ch+1}),s[u]=`
126
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ftt(t,e){if(!!t){if(typeof t=="string")return $F(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $F(t,e)}}function Ntt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Btt(t){if(Array.isArray(t))return $F(t)}function $F(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Hue(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,a=i.attribute,s=i.tagName,u=s===void 0?"mark":s;return e.apply(void 0,[r,{}].concat(Rtt(BE({hit:o,attribute:a}).map(function(c,f){return c.isHighlighted?e(u,{key:f},c.value):c.value}))))}}var Wue=se(()=>{km()});var Uue=se(()=>{Fue();Bue();zue();Wue()});function Vue(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function HE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vue(Object(r),!0).forEach(function(n){jtt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vue(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function jtt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ztt(t,e){if(t==null)return{};var r=Htt(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(r[n]=t[n]))}return r}function Htt(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function $ue(t){var e,r=t.classNames,n=t.container,i=t.getEnvironmentProps,o=t.getFormProps,a=t.getInputProps,s=t.getItemProps,u=t.getLabelProps,c=t.getListProps,f=t.getPanelProps,p=t.getRootProps,g=t.panelContainer,m=t.panelPlacement,x=t.render,w=t.renderNoResults,A=t.renderer,k=t.detachedMediaQuery,T=t.components,D=ztt(t,["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components"]),M=wF(n);M.tagName;var P=typeof window<"u"?window:{},_=A??Vtt,C={Highlight:que(_),ReverseHighlight:Nue(_),ReverseSnippet:jue(_),Snippet:Hue(_)};return{renderer:{classNames:Ale(Wtt,r??{}),container:M,getEnvironmentProps:i??function(O){var F=O.props;return F},getFormProps:o??function(O){var F=O.props;return F},getInputProps:a??function(O){var F=O.props;return F},getItemProps:s??function(O){var F=O.props;return F},getLabelProps:u??function(O){var F=O.props;return F},getListProps:c??function(O){var F=O.props;return F},getPanelProps:f??function(O){var F=O.props;return F},getRootProps:p??function(O){var F=O.props;return F},panelContainer:g?wF(g):document.body,panelPlacement:m??"input-wrapper-width",render:x??Utt,renderNoResults:w,renderer:_,detachedMediaQuery:k??getComputedStyle(P.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:HE(HE({},C),T)},core:HE(HE({},D),{},{id:(e=D.id)!==null&&e!==void 0?e:wE(),environment:P})}}var Wtt,Utt,Vtt,Yue=se(()=>{wh();hue();Uue();_m();Wtt={clearButton:"aa-ClearButton",detachedCancelButton:"aa-DetachedCancelButton",detachedContainer:"aa-DetachedContainer",detachedFormContainer:"aa-DetachedFormContainer",detachedOverlay:"aa-DetachedOverlay",detachedSearchButton:"aa-DetachedSearchButton",detachedSearchButtonIcon:"aa-DetachedSearchButtonIcon",detachedSearchButtonPlaceholder:"aa-DetachedSearchButtonPlaceholder",form:"aa-Form",input:"aa-Input",inputWrapper:"aa-InputWrapper",inputWrapperPrefix:"aa-InputWrapperPrefix",inputWrapperSuffix:"aa-InputWrapperSuffix",item:"aa-Item",label:"aa-Label",list:"aa-List",loadingIndicator:"aa-LoadingIndicator",panel:"aa-Panel",panelLayout:"aa-PanelLayout",root:"aa-Autocomplete",source:"aa-Source",sourceFooter:"aa-SourceFooter",sourceHeader:"aa-SourceHeader",sourceNoResults:"aa-SourceNoResults",submitButton:"aa-SubmitButton"},Utt=function(e,r){var n=e.children;due(n,r)},Vtt={createElement:OF,Fragment:Sm}});function Kue(t){var e=t.panelPlacement,r=t.container,n=t.form,i=t.environment,o=r.getBoundingClientRect(),a=o.top+o.height;switch(e){case"start":return{top:a,left:o.left};case"end":return{top:a,right:i.document.documentElement.clientWidth-(o.left+o.width)};case"full-width":return{top:a,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var s=n.getBoundingClientRect();return{top:a,left:s.left,right:i.document.documentElement.clientWidth-(s.left+s.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}var Gue=se(()=>{});function WE(){return WE=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},WE.apply(this,arguments)}function Xue(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function UE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xue(Object(r),!0).forEach(function(n){$tt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xue(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $tt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Que(t){var e=t.autocomplete,r=t.autocompleteScopeApi,n=t.dom,i=t.propGetters,o=t.state;kF(n.root,i.getRootProps(UE({state:o,props:e.getRootProps({})},r))),kF(n.input,i.getInputProps(UE({state:o,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},r))),os(n.label,{hidden:o.status==="stalled"}),os(n.loadingIndicator,{hidden:o.status!=="stalled"}),os(n.clearButton,{hidden:!o.query})}function Zue(t,e){var r=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,o=e.createElement,a=e.dom,s=e.Fragment,u=e.panelContainer,c=e.propGetters,f=e.state,p=e.components;if(!f.isOpen){u.contains(a.panel)&&u.removeChild(a.panel);return}!u.contains(a.panel)&&f.status!=="loading"&&u.appendChild(a.panel),a.panel.classList.toggle("aa-Panel--stalled",f.status==="stalled");var g=f.collections.map(function(w,A){var k=w.source,T=w.items;return o("section",{key:A,className:i.source,"data-autocomplete-source-id":k.sourceId},k.templates.header&&o("div",{className:i.sourceHeader},k.templates.header({components:p,createElement:o,Fragment:s,items:T,source:k,state:f})),T.length===0&&k.templates.noResults&&f.query?o("div",{className:i.sourceNoResults},k.templates.noResults({components:p,createElement:o,Fragment:s,source:k,state:f})):o("ul",WE({className:i.list},c.getListProps(UE({state:f,props:r.getListProps({})},n))),T.map(function(D){var M=r.getItemProps({item:D,source:k});return o("li",WE({key:M.id,className:i.item},c.getItemProps(UE({state:f,props:M},n))),k.templates.item({components:p,createElement:o,Fragment:s,item:D,state:f}))})),k.templates.footer&&o("div",{className:i.sourceFooter},k.templates.footer({components:p,createElement:o,Fragment:s,items:T,source:k,state:f})))}),m=o(s,null,o("div",{className:"aa-PanelLayout aa-Panel--scrollable"},g),o("div",{className:"aa-GradientBottom"})),x=g.reduce(function(w,A){return w[A.props["data-autocomplete-source-id"]]=A,w},{});t({children:m,state:f,sections:g,elements:x,createElement:o,Fragment:s,components:p},a.panel)}var Jue=se(()=>{_m()});function ece(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Sh(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ece(Object(r),!0).forEach(function(n){tce(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ece(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function tce(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rce(t){var e=Kle(),r=e.runEffect,n=e.cleanupEffects,i=e.runEffects,o=Xle(),a=o.reactive,s=o.runReactives,u=R0(!1),c=R0(t),f=R0(void 0),p=a(function(){return $ue(c.current)}),g=a(function(){return p.value.core.environment.matchMedia(p.value.renderer.detachedMediaQuery).matches}),m=a(function(){return cle(Sh(Sh({},p.value.core),{},{onStateChange:function(C){var O,F,B;u.current=C.state.collections.some(function(V){return V.source.templates.noResults}),(O=f.current)===null||O===void 0||O.call(f,C),(F=(B=p.value.core).onStateChange)===null||F===void 0||F.call(B,C)},shouldPanelOpen:c.current.shouldPanelOpen||function(_){var C=_.state,O=If(C)>0;if(!p.value.core.openOnFocus&&!C.query)return O;var F=Boolean(u.current||p.value.renderer.renderNoResults);return!O&&F||O}}))}),x=R0(Sh({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},p.value.core.initialState)),w={getEnvironmentProps:p.value.renderer.getEnvironmentProps,getFormProps:p.value.renderer.getFormProps,getInputProps:p.value.renderer.getInputProps,getItemProps:p.value.renderer.getItemProps,getLabelProps:p.value.renderer.getLabelProps,getListProps:p.value.renderer.getListProps,getPanelProps:p.value.renderer.getPanelProps,getRootProps:p.value.renderer.getRootProps},A={setActiveItemId:m.value.setActiveItemId,setQuery:m.value.setQuery,setCollections:m.value.setCollections,setIsOpen:m.value.setIsOpen,setStatus:m.value.setStatus,setContext:m.value.setContext,refresh:m.value.refresh},k=a(function(){return $le({autocomplete:m.value,autocompleteScopeApi:A,classNames:p.value.renderer.classNames,isDetached:g.value,placeholder:p.value.core.placeholder,propGetters:w,state:x.current})});function T(){os(k.value.panel,{style:g.value?{}:Kue({panelPlacement:p.value.renderer.panelPlacement,container:k.value.root,form:k.value.form,environment:p.value.core.environment})})}function D(_){x.current=_;var C={autocomplete:m.value,autocompleteScopeApi:A,classNames:p.value.renderer.classNames,components:p.value.renderer.components,container:p.value.renderer.container,createElement:p.value.renderer.renderer.createElement,dom:k.value,Fragment:p.value.renderer.renderer.Fragment,panelContainer:g.value?k.value.detachedContainer:p.value.renderer.panelContainer,propGetters:w,state:x.current},O=!If(_)&&!u.current&&p.value.renderer.renderNoResults||p.value.renderer.render;Que(C),Zue(O,C)}r(function(){var _=m.value.getEnvironmentProps({formElement:k.value.form,panelElement:k.value.panel,inputElement:k.value.input});return os(p.value.core.environment,_),function(){os(p.value.core.environment,Object.keys(_).reduce(function(C,O){return Sh(Sh({},C),{},tce({},O,void 0))},{}))}}),r(function(){var _=g.value?p.value.core.environment.document.body:p.value.renderer.panelContainer,C=g.value?k.value.detachedOverlay:k.value.panel;return g.value&&x.current.isOpen&&k.value.openDetachedOverlay(),D(x.current),function(){_.contains(C)&&_.removeChild(C)}}),r(function(){var _=p.value.renderer.container;return _.appendChild(k.value.root),function(){_.removeChild(k.value.root)}}),r(function(){var _=hF(function(C){var O=C.state;D(O)},0);return f.current=function(C){var O=C.state,F=C.prevState;if(O.isOpen&&!F.isOpen&&T(),O.query!==F.query){var B=document.querySelectorAll(".aa-Panel--scrollable");B.forEach(function(V){V.scrollTop!==0&&(V.scrollTop=0)})}_({state:O})},function(){f.current=void 0}}),r(function(){var _=hF(function(){var C=g.value;g.value=p.value.core.environment.matchMedia(p.value.renderer.detachedMediaQuery).matches,C!==g.value?P({}):requestAnimationFrame(T)},20);return p.value.core.environment.addEventListener("resize",_),function(){p.value.core.environment.removeEventListener("resize",_)}}),r(function(){if(!g.value)return function(){};function _(F){k.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",F)}function C(F){_(F.matches)}var O=p.value.core.environment.matchMedia(getComputedStyle(p.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));return _(O.matches),O.addEventListener("change",C),function(){O.removeEventListener("change",C)}}),r(function(){return requestAnimationFrame(T),function(){}});function M(){n()}function P(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(),c.current=SF(p.value.renderer,p.value.core,{initialState:x.current},_),s(),i(),m.value.refresh().then(function(){D(x.current)})}return Sh(Sh({},A),{},{update:P,destroy:M})}var nce=se(()=>{Cle();wh();Yle();Gle();Qle();Yue();Gue();Jue();_m()});var ice,oce=se(()=>{ice="1.0.0-alpha.46"});function ace(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function sce(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ace(Object(r),!0).forEach(function(n){Ytt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ace(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ytt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var lce,uce=se(()=>{km();oce();lce=jE(function(t){return zE(sce(sce({},t),{},{userAgents:[{segment:"autocomplete-js",version:ice}]}))})});var cce=se(()=>{});var OOt,fce=se(()=>{uce();OOt=lce({transformResponse:function(e){return e.hits}})});var dce=se(()=>{cce();fce()});var hce=se(()=>{});var pce=se(()=>{});var gce=se(()=>{});var mce=se(()=>{});var vce=se(()=>{});var yce=se(()=>{});var bce=se(()=>{});var xce=se(()=>{});var wce=se(()=>{});var _ce=se(()=>{});var Sce=se(()=>{});var kce=se(()=>{});var Ece=se(()=>{});var Cce=se(()=>{hce();pce();gce();mce();vce();yce();bce();xce();wce();_ce();Sce();kce();Ece()});var Tce=se(()=>{nce();dce();Cce()});var Ace,Dce=se(()=>{Ace=(t,e)=>{let r;return(...n)=>(r&&clearTimeout(r),new Promise(i=>{r=setTimeout(()=>i(t(...n)),e)}))}});var Oce,Mce,VE,Ice=se(()=>{Oce=Vr(mL());Pr();FL();Tce();Mce=Vr(N1());Dce();VE=class extends Ct{constructor(){super(...arguments);pt(this,"debouncedFetch",Ace(fetch,this.searchDebounce));pt(this,"destroyMethod")}get dataset(){return this.autocompleteTarget.dataset}get searchDebounce(){return window.Avo.configuration.search_debounce}get translationKeys(){let t;try{t=JSON.parse(this.dataset.translationKeys)}catch(e){t={}}return t}get isBelongsToSearch(){return this.dataset.viaAssociation==="belongs_to"}get isHasManySearch(){return this.dataset.viaAssociation==="has_many"}get isGlobalSearch(){return this.dataset.searchResource==="global"}connect(){let t=this;this.buttonTarget.onclick=()=>this.showSearchPanel(),this.clearValueTargets.forEach(r=>{r.getAttribute("value")&&this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")}),this.isGlobalSearch&&Oce.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="";let{destroy:e}=rce({container:this.autocompleteTarget,placeholder:this.translationKeys.placeholder,translations:{detachedCancelButtonText:this.translationKeys.cancel_button},autoFocus:!0,openOnFocus:!0,detachedMediaQuery:"",getSources:({query:r})=>{document.body.classList.add("search-loading");let n=t.searchUrl(r);return t.debouncedFetch(n).then(i=>(document.body.classList.remove("search-loading"),i.json())).then(i=>Object.keys(i).map(o=>t.addSource(o,i[o])))}});this.destroyMethod=e,this.buttonTarget.dataset.shouldBeDisabled!=="true"&&this.buttonTarget.removeAttribute("disabled")}disconnect(){this.destroyMethod&&(this.destroyMethod(),this.destroyMethod=null)}addSource(t,e){let r=this;return{sourceId:t,getItems:()=>e.results,onSelect:r.handleOnSelect.bind(r),templates:{header(){return`${e.header.toUpperCase()} ${e.help}`},item({item:n,createElement:i}){let o=[];if(n._avatar){let s;switch(n._avatar_type){default:case"circle":s="rounded-full";break;case"rounded":s="rounded";break;case"square":s="rounded-none";break}o.push(i("img",{src:n._avatar,alt:n._label,class:`flex-shrink-0 w-8 h-8 my-[2px] inline mr-2 ${s}`}))}let a=[n._label];return n._description&&a.push(i("div",{class:"aa-ItemDescription"},n._description)),o.push(i("div",null,a)),i("div",{class:"flex"},o)},noResults(){return r.translationKeys.no_item_found.replace("%{item}",t)}}}}handleOnSelect({item:t}){this.isBelongsToSearch?(this.updateFieldAttribute(this.hiddenIdTarget,"value",t._id),this.updateFieldAttribute(this.buttonTarget,"value",t._label),document.querySelector(".aa-DetachedOverlay").remove(),this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")):Yd.visit(t._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(t){return(0,Mce.default)().segment(this.searchSegments()).search(this.searchParams(t)).toString()}searchSegments(){let t=[window.Avo.configuration.root_path,"avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(t=[window.Avo.configuration.root_path,"avo_api","search"]),t}searchParams(t){let e={q:t,global:!1};return this.isGlobalSearch&&(e.global=!0),(this.isBelongsToSearch||this.isHasManySearch)&&(e=this.addAssociationParams(e),e=this.addReflectionParams(e),this.isBelongsToSearch&&(e=zc(za({},e),{via_parent_resource_id:this.dataset.viaParentResourceId,via_parent_resource_class:this.dataset.viaParentResourceClass,via_relation:this.dataset.viaRelation}))),e}addAssociationParams(t){return t=zc(za({},t),{via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId}),t}addReflectionParams(t){return t=zc(za({},t),{via_reflection_class:this.dataset.viaReflectionClass,via_reflection_id:this.dataset.viaReflectionId}),t}showSearchPanel(){this.autocompleteTarget.querySelector("button").click()}clearValue(){this.clearValueTargets.map(t=>this.updateFieldAttribute(t,"value","")),this.clearButtonTarget.classList.add("hidden")}updateFieldAttribute(t,e,r){t.setAttribute(e,r),t.dispatchEvent(new Event("input"))}};pt(VE,"targets",["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"])});var Lce,$E,Pce=se(()=>{Pr();Lce=Vr(N1()),$E=class extends Ct{get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(t){if(!this.parentTurboFrame.src)return;let e=new Lce.default(this.parentTurboFrame.src);e.search(zc(za({},e.query(!0)),{range:t.currentTarget.value})),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};pt($E,"targets",["select"])});var YE,Rce=se(()=>{nm();YE=class extends Ca{getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:t}=this.selectorTarget.dataset;return t}};pt(YE,"targets",["selector"])});async function GF(t,e=null){t.classList.remove("hidden"),await Fce("enter",t,e)}async function XF(t,e=null){await Fce("leave",t,e),t.classList.add("hidden")}async function qce(t,e=null){t.classList.contains("hidden")?await GF(t,e):await XF(t,e)}async function Fce(t,e,r){let n=e.dataset,i=r?`${r}-${t}`:t,o=`transition${t.charAt(0).toUpperCase()+t.slice(1)}`,a=n[o]?n[o].split(" "):[i],s=n[`${o}Start`]?n[`${o}Start`].split(" "):[`${i}-start`],u=n[`${o}End`]?n[`${o}End`].split(" "):[`${i}-end`];YF(e,a),YF(e,s),await Ktt(),KF(e,s),YF(e,u),await Gtt(e),KF(e,u),KF(e,a)}function YF(t,e){t.classList.add(...e)}function KF(t,e){t.classList.remove(...e)}function Ktt(){return new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})})}function Gtt(t){return new Promise(e=>{let r=getComputedStyle(t).transitionDuration.split(",")[0],n=Number(r.replace("s",""))*1e3;setTimeout(()=>{e()},n)})}var Nce=se(()=>{});function KE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}function QF(t,e){function r(i,o,a){if(!(typeof document>"u")){a=KE({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var u in a)!a[u]||(s+="; "+u,a[u]!==!0&&(s+="="+a[u].split(";")[0]));return document.cookie=i+"="+t.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var u=o[s].split("="),c=u.slice(1).join("=");try{var f=decodeURIComponent(u[0]);if(a[f]=t.read(c,f),i===f)break}catch{}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",KE({},o,{expires:-1}))},withAttributes:function(i){return QF(this.converter,KE({},this.attributes,i))},withConverter:function(i){return QF(KE({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Xtt,Qtt,z0,Bce=se(()=>{Xtt={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};Qtt=QF(Xtt,{path:"/"}),z0=Qtt});var H0,jce=se(()=>{Pr();Nce();Bce();H0=class extends Ct{get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return z0.get(this.cookieKey)==="1"}set cookie(t){z0.set(this.cookieKey,t===!0?1:0)}markSidebarClosed(){z0.set(this.cookieKey,"0"),this.openValue=!1,XF(this.sidebarTarget),this.mainAreaTarget.classList.remove("sidebar-open")}markSidebarOpen(){z0.set(this.cookieKey,"1"),this.openValue=!0,GF(this.sidebarTarget),this.mainAreaTarget.classList.add("sidebar-open")}toggleSidebar(){this.openValue?this.markSidebarClosed():this.markSidebarOpen()}toggleSidebarOnMobile(){qce(this.mobileSidebarTarget)}};pt(H0,"targets",["sidebar","mobileSidebar","mainArea"]),pt(H0,"values",{open:Boolean})});var Wce=Z((zce,Hce)=>{(function(t){typeof zce=="object"&&typeof Hce=="object"?t(Br()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){"use strict";var e=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,r=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,n=/[*+-]\s/;t.commands.newlineAndIndentContinueMarkdownList=function(o){if(o.getOption("disableInput"))return t.Pass;for(var a=o.listSelections(),s=[],u=0;u<a.length;u++){var c=a[u].head,f=o.getStateAfter(c.line),p=t.innerMode(o.getMode(),f);if(p.mode.name!=="markdown"){o.execCommand("newlineAndIndent");return}else f=p.state;var g=f.list!==!1,m=f.quote!==0,x=o.getLine(c.line),w=e.exec(x),A=/^\s*$/.test(x.slice(0,c.ch));if(!a[u].empty()||!g&&!m||!w||A){o.execCommand("newlineAndIndent");return}if(r.test(x)){var k=m&&/>\s*$/.test(x),T=!/>\s*$/.test(x);(k||T)&&o.replaceRange("",{line:c.line,ch:0},{line:c.line,ch:c.ch+1}),s[u]=`
127
127
  `}else{var D=w[1],M=w[5],P=!(n.test(w[2])||w[2].indexOf(">")>=0),_=P?parseInt(w[3],10)+1+w[4]:w[2].replace("x"," ");s[u]=`
128
128
  `+D+_+M,P&&i(o,c)}}o.replaceSelections(s)};function i(o,a){var s=a.line,u=0,c=0,f=e.exec(o.getLine(s)),p=f[1];do{u+=1;var g=s+u,m=o.getLine(g),x=e.exec(m);if(x){var w=x[1],A=parseInt(f[3],10)+u-c,k=parseInt(x[3],10),T=k;if(p===w&&!isNaN(k))A===k&&(T=k+1),A>k&&(T=A+1),o.replaceRange(m.replace(e,w+T+x[4]+x[5]),{line:g,ch:0},{line:g,ch:m.length});else{if(p.length>w.length||p.length<w.length&&u===1)return;c+=1}}}while(x)}})});var Vce=Z(()=>{var Uce=Br();Uce.commands.tabAndIndentMarkdownList=function(t){var e=t.listSelections(),r=e[0].head,n=t.getStateAfter(r.line),i=n.list!==!1;if(i){t.execCommand("indentMore");return}if(t.options.indentWithTabs)t.execCommand("insertTab");else{var o=Array(t.options.tabSize+1).join(" ");t.replaceSelection(o)}};Uce.commands.shiftTabAndUnindentMarkdownList=function(t){var e=t.listSelections(),r=e[0].head,n=t.getStateAfter(r.line),i=n.list!==!1;if(i){t.execCommand("indentLess");return}if(t.options.indentWithTabs)t.execCommand("insertTab");else{var o=Array(t.options.tabSize+1).join(" ");t.replaceSelection(o)}}});var Kce=Z(($ce,Yce)=>{(function(t){typeof $ce=="object"&&typeof Yce=="object"?t(Br()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){"use strict";t.defineOption("fullScreen",!1,function(n,i,o){o==t.Init&&(o=!1),!o!=!i&&(i?e(n):r(n))});function e(n){var i=n.getWrapperElement();n.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:i.style.width,height:i.style.height},i.style.width="",i.style.height="auto",i.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",n.refresh()}function r(n){var i=n.getWrapperElement();i.className=i.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var o=n.state.fullScreenRestore;i.style.width=o.width,i.style.height=o.height,window.scrollTo(o.scrollLeft,o.scrollTop),n.refresh()}})});var Qce=Z((Gce,Xce)=>{(function(t){typeof Gce=="object"&&typeof Xce=="object"?t(Br()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){t.defineOption("placeholder","",function(s,u,c){var f=c&&c!=t.Init;if(u&&!f)s.on("blur",i),s.on("change",o),s.on("swapDoc",o),t.on(s.getInputField(),"compositionupdate",s.state.placeholderCompose=function(){n(s)}),o(s);else if(!u&&f){s.off("blur",i),s.off("change",o),s.off("swapDoc",o),t.off(s.getInputField(),"compositionupdate",s.state.placeholderCompose),e(s);var p=s.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}u&&!s.hasFocus()&&i(s)});function e(s){s.state.placeholder&&(s.state.placeholder.parentNode.removeChild(s.state.placeholder),s.state.placeholder=null)}function r(s){e(s);var u=s.state.placeholder=document.createElement("pre");u.style.cssText="height: 0; overflow: visible",u.style.direction=s.getOption("direction"),u.className="CodeMirror-placeholder CodeMirror-line-like";var c=s.getOption("placeholder");typeof c=="string"&&(c=document.createTextNode(c)),u.appendChild(c),s.display.lineSpace.insertBefore(u,s.display.lineSpace.firstChild)}function n(s){setTimeout(function(){var u=!1;if(s.lineCount()==1){var c=s.getInputField();u=c.nodeName=="TEXTAREA"?!s.getLine(0).length:!/[^\u200b]/.test(c.querySelector(".CodeMirror-line").textContent)}u?r(s):e(s)},20)}function i(s){a(s)&&r(s)}function o(s){var u=s.getWrapperElement(),c=a(s);u.className=u.className.replace(" CodeMirror-empty","")+(c?" CodeMirror-empty":""),c?r(s):e(s)}function a(s){return s.lineCount()===1&&s.getLine(0)===""}})});var efe=Z((Zce,Jce)=>{(function(t){typeof Zce=="object"&&typeof Jce=="object"?t(Br()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){"use strict";t.defineOption("styleSelectedText",!1,function(f,p,g){var m=g&&g!=t.Init;p&&!m?(f.state.markedSelection=[],f.state.markedSelectionStyle=typeof p=="string"?p:"CodeMirror-selectedtext",u(f),f.on("cursorActivity",e),f.on("change",r)):!p&&m&&(f.off("cursorActivity",e),f.off("change",r),s(f),f.state.markedSelection=f.state.markedSelectionStyle=null)});function e(f){f.state.markedSelection&&f.operation(function(){c(f)})}function r(f){f.state.markedSelection&&f.state.markedSelection.length&&f.operation(function(){s(f)})}var n=8,i=t.Pos,o=t.cmpPos;function a(f,p,g,m){if(o(p,g)!=0)for(var x=f.state.markedSelection,w=f.state.markedSelectionStyle,A=p.line;;){var k=A==p.line?p:i(A,0),T=A+n,D=T>=g.line,M=D?g:i(T,0),P=f.markText(k,M,{className:w});if(m==null?x.push(P):x.splice(m++,0,P),D)break;A=T}}function s(f){for(var p=f.state.markedSelection,g=0;g<p.length;++g)p[g].clear();p.length=0}function u(f){s(f);for(var p=f.listSelections(),g=0;g<p.length;g++)a(f,p[g].from(),p[g].to())}function c(f){if(!f.somethingSelected())return s(f);if(f.listSelections().length>1)return u(f);var p=f.getCursor("start"),g=f.getCursor("end"),m=f.state.markedSelection;if(!m.length)return a(f,p,g);var x=m[0].find(),w=m[m.length-1].find();if(!x||!w||g.line-p.line<=n||o(p,w.to)>=0||o(g,x.from)<=0)return u(f);for(;o(p,x.from)>0;)m.shift().clear(),x=m[0].find();for(o(p,x.from)<0&&(x.to.line-p.line<n?(m.shift().clear(),a(f,p,x.to,0)):a(f,p,x.from,0));o(g,w.to)<0;)m.pop().clear(),w=m[m.length-1].find();o(g,w.to)>0&&(g.line-w.from.line<n?(m.pop().clear(),a(f,w.from,g)):a(f,w.to,g))}})});var nfe=Z((tfe,rfe)=>{(function(t){typeof tfe=="object"&&typeof rfe=="object"?t(Br(),z1(),H1()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],t):t(CodeMirror)})(function(t){"use strict";var e=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;t.defineMode("gfm",function(r,n){var i=0;function o(c){return c.code=!1,null}var a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(c){return{code:c.code,codeBlock:c.codeBlock,ateSpace:c.ateSpace}},token:function(c,f){if(f.combineTokens=null,f.codeBlock)return c.match(/^```+/)?(f.codeBlock=!1,null):(c.skipToEnd(),null);if(c.sol()&&(f.code=!1),c.sol()&&c.match(/^```+/))return c.skipToEnd(),f.codeBlock=!0,null;if(c.peek()==="`"){c.next();var p=c.pos;c.eatWhile("`");var g=1+c.pos-p;return f.code?g===i&&(f.code=!1):(i=g,f.code=!0),null}else if(f.code)return c.next(),null;if(c.eatSpace())return f.ateSpace=!0,null;if((c.sol()||f.ateSpace)&&(f.ateSpace=!1,n.gitHubSpice!==!1)){if(c.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return f.combineTokens=!0,"link";if(c.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return f.combineTokens=!0,"link"}return c.match(e)&&c.string.slice(c.start-2,c.start)!="]("&&(c.start==0||/\W/.test(c.string.charAt(c.start-1)))?(f.combineTokens=!0,"link"):(c.next(),null)},blankLine:o},s={taskLists:!0,strikethrough:!0,emoji:!0};for(var u in n)s[u]=n[u];return s.name="markdown",t.overlayMode(t.getMode(r,s),a)},"markdown"),t.defineMIME("text/x-gfm","gfm")})});var ife=Z(()=>{});var ofe=Z((_Mt,JF)=>{var ZF;(function(){"use strict";ZF=function(t,e,r,n){n=n||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=n.flags||{},this.memoized={},this.loaded=!1;var i=this,o,a,s,u,c;t&&(i.dictionary=t,e&&r?m():typeof window<"u"&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension?(n.dictionaryPath?o=n.dictionaryPath:o="typo/dictionaries",e||f(chrome.extension.getURL(o+"/"+t+"/"+t+".aff"),p),r||f(chrome.extension.getURL(o+"/"+t+"/"+t+".dic"),g)):(n.dictionaryPath?o=n.dictionaryPath:typeof __dirname<"u"?o=__dirname+"/dictionaries":o="./dictionaries",e||f(o+"/"+t+"/"+t+".aff",p),r||f(o+"/"+t+"/"+t+".dic",g)));function f(x,w){var A=i._readFile(x,null,n.asyncLoad);n.asyncLoad?A.then(function(k){w(k)}):w(A)}function p(x){e=x,r&&m()}function g(x){r=x,e&&m()}function m(){for(i.rules=i._parseAFF(e),i.compoundRuleCodes={},a=0,u=i.compoundRules.length;a<u;a++){var x=i.compoundRules[a];for(s=0,c=x.length;s<c;s++)i.compoundRuleCodes[x[s]]=[]}"ONLYINCOMPOUND"in i.flags&&(i.compoundRuleCodes[i.flags.ONLYINCOMPOUND]=[]),i.dictionaryTable=i._parseDIC(r);for(a in i.compoundRuleCodes)i.compoundRuleCodes[a].length===0&&delete i.compoundRuleCodes[a];for(a=0,u=i.compoundRules.length;a<u;a++){var w=i.compoundRules[a],A="";for(s=0,c=w.length;s<c;s++){var k=w[s];k in i.compoundRuleCodes?A+="("+i.compoundRuleCodes[k].join("|")+")":A+=k}i.compoundRules[a]=new RegExp(A,"i")}i.loaded=!0,n.asyncLoad&&n.loadedCallback&&n.loadedCallback(i)}return this},ZF.prototype={load:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);return this},_readFile:function(t,e,r){if(e=e||"utf8",typeof XMLHttpRequest<"u"){var n,i=new XMLHttpRequest;return i.open("GET",t,r),r&&(n=new Promise(function(a,s){i.onload=function(){i.status===200?a(i.responseText):s(i.statusText)},i.onerror=function(){s(i.statusText)}})),i.overrideMimeType&&i.overrideMimeType("text/plain; charset="+e),i.send(null),r?n:i.responseText}else if(typeof GN<"u"){var o=ife();try{if(o.existsSync(t))return o.readFileSync(t,e);console.log("Path "+t+" does not exist.")}catch(a){return console.log(a),""}}},_parseAFF:function(t){var e={},r,n,i,o,a,s,u,c;t=this._removeAffixComments(t);var f=t.split(/\r?\n/);for(a=0,u=f.length;a<u;a++){r=f[a];var p=r.split(/\s+/),g=p[0];if(g=="PFX"||g=="SFX"){var m=p[1],x=p[2];i=parseInt(p[3],10);var w=[];for(s=a+1,c=a+1+i;s<c;s++){n=f[s],o=n.split(/\s+/);var A=o[2],k=o[3].split("/"),T=k[0];T==="0"&&(T="");var D=this.parseRuleCodes(k[1]),M=o[4],P={};P.add=T,D.length>0&&(P.continuationClasses=D),M!=="."&&(g==="SFX"?P.match=new RegExp(M+"$"):P.match=new RegExp("^"+M)),A!="0"&&(g==="SFX"?P.remove=new RegExp(A+"$"):P.remove=A),w.push(P)}e[m]={type:g,combineable:x=="Y",entries:w},a+=i}else if(g==="COMPOUNDRULE"){for(i=parseInt(p[1],10),s=a+1,c=a+1+i;s<c;s++)r=f[s],o=r.split(/\s+/),this.compoundRules.push(o[1]);a+=i}else g==="REP"?(o=r.split(/\s+/),o.length===3&&this.replacementTable.push([o[1],o[2]])):this.flags[g]=p[1]}return e},_removeAffixComments:function(t){return t=t.replace(/^\s*#.*$/mg,""),t=t.replace(/^\s\s*/m,"").replace(/\s\s*$/m,""),t=t.replace(/\n{2,}/g,`
129
129
  `),t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),t},_parseDIC:function(t){t=this._removeDicComments(t);var e=t.split(/\r?\n/),r={};function n(F,B){r.hasOwnProperty(F)||(r[F]=null),B.length>0&&(r[F]===null&&(r[F]=[]),r[F].push(B))}for(var i=1,o=e.length;i<o;i++){var a=e[i];if(!!a){var s=a.split("/",2),u=s[0];if(s.length>1){var c=this.parseRuleCodes(s[1]);(!("NEEDAFFIX"in this.flags)||c.indexOf(this.flags.NEEDAFFIX)==-1)&&n(u,c);for(var f=0,p=c.length;f<p;f++){var g=c[f],m=this.rules[g];if(m)for(var x=this._applyRule(u,m),w=0,A=x.length;w<A;w++){var k=x[w];if(n(k,[]),m.combineable)for(var T=f+1;T<p;T++){var D=c[T],M=this.rules[D];if(M&&M.combineable&&m.type!=M.type)for(var P=this._applyRule(k,M),_=0,C=P.length;_<C;_++){var O=P[_];n(O,[])}}}g in this.compoundRuleCodes&&this.compoundRuleCodes[g].push(u)}}else n(u.trim(),[])}}return r},_removeDicComments:function(t){return t=t.replace(/^\t.*$/mg,""),t},parseRuleCodes:function(t){if(t)if("FLAG"in this.flags){if(this.flags.FLAG==="long"){for(var e=[],r=0,n=t.length;r<n;r+=2)e.push(t.substr(r,2));return e}else if(this.flags.FLAG==="num")return t.split(",")}else return t.split("");else return[]},_applyRule:function(t,e){for(var r=e.entries,n=[],i=0,o=r.length;i<o;i++){var a=r[i];if(!a.match||t.match(a.match)){var s=t;if(a.remove&&(s=s.replace(a.remove,"")),e.type==="SFX"?s=s+a.add:s=a.add+s,n.push(s),"continuationClasses"in a)for(var u=0,c=a.continuationClasses.length;u<c;u++){var f=this.rules[a.continuationClasses[u]];f&&(n=n.concat(this._applyRule(s,f)))}}}return n},check:function(t){if(!this.loaded)throw"Dictionary not loaded.";var e=t.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(e))return!0;if(e.toUpperCase()===e){var r=e[0]+e.substring(1).toLowerCase();if(this.hasFlag(r,"KEEPCASE"))return!1;if(this.checkExact(r)||this.checkExact(e.toLowerCase()))return!0}var n=e[0].toLowerCase()+e.substring(1);if(n!==e){if(this.hasFlag(n,"KEEPCASE"))return!1;if(this.checkExact(n))return!0}return!1},checkExact:function(t){if(!this.loaded)throw"Dictionary not loaded.";var e=this.dictionaryTable[t],r,n;if(typeof e>"u"){if("COMPOUNDMIN"in this.flags&&t.length>=this.flags.COMPOUNDMIN){for(r=0,n=this.compoundRules.length;r<n;r++)if(t.match(this.compoundRules[r]))return!0}}else{if(e===null)return!0;if(typeof e=="object"){for(r=0,n=e.length;r<n;r++)if(!this.hasFlag(t,"ONLYINCOMPOUND",e[r]))return!0}}return!1},hasFlag:function(t,e,r){if(!this.loaded)throw"Dictionary not loaded.";return!!(e in this.flags&&(typeof r>"u"&&(r=Array.prototype.concat.apply([],this.dictionaryTable[t])),r&&r.indexOf(this.flags[e])!==-1))},alphabet:"",suggest:function(t,e){if(!this.loaded)throw"Dictionary not loaded.";if(e=e||5,this.memoized.hasOwnProperty(t)){var r=this.memoized[t].limit;if(e<=r||this.memoized[t].suggestions.length<r)return this.memoized[t].suggestions.slice(0,e)}if(this.check(t))return[];for(var n=0,i=this.replacementTable.length;n<i;n++){var o=this.replacementTable[n];if(t.indexOf(o[0])!==-1){var a=t.replace(o[0],o[1]);if(this.check(a))return[a]}}var s=this;s.alphabet="abcdefghijklmnopqrstuvwxyz";function u(f,p){var g={},m,x,w,A,k,T,D=s.alphabet.length;if(typeof f=="string"){var M=f;f={},f[M]=!0}for(var M in f)for(m=0,A=M.length+1;m<A;m++){var P=[M.substring(0,m),M.substring(m)];if(P[1]&&(T=P[0]+P[1].substring(1),(!p||s.check(T))&&(T in g?g[T]+=1:g[T]=1)),P[1].length>1&&P[1][1]!==P[1][0]&&(T=P[0]+P[1][1]+P[1][0]+P[1].substring(2),(!p||s.check(T))&&(T in g?g[T]+=1:g[T]=1)),P[1]){var _=P[1].substring(0,1).toUpperCase()===P[1].substring(0,1)?"uppercase":"lowercase";for(x=0;x<D;x++){var C=s.alphabet[x];_==="uppercase"&&(C=C.toUpperCase()),C!=P[1].substring(0,1)&&(T=P[0]+C+P[1].substring(1),(!p||s.check(T))&&(T in g?g[T]+=1:g[T]=1))}}if(P[1])for(x=0;x<D;x++){var _=P[0].substring(-1).toUpperCase()===P[0].substring(-1)&&P[1].substring(0,1).toUpperCase()===P[1].substring(0,1)?"uppercase":"lowercase",C=s.alphabet[x];_==="uppercase"&&(C=C.toUpperCase()),T=P[0]+C+P[1],(!p||s.check(T))&&(T in g?g[T]+=1:g[T]=1)}}return g}function c(f){var p=u(f),g=u(p,!0),m=g;for(var x in p)!s.check(x)||(x in m?m[x]+=p[x]:m[x]=p[x]);var w,A,k=[];for(w in m)m.hasOwnProperty(w)&&k.push([w,m[w]]);function T(_,C){var O=_[1],F=C[1];return O<F?-1:O>F?1:C[0].localeCompare(_[0])}k.sort(T).reverse();var D=[],M="lowercase";f.toUpperCase()===f?M="uppercase":f.substr(0,1).toUpperCase()+f.substr(1).toLowerCase()===f&&(M="capitalized");var P=e;for(w=0;w<Math.min(P,k.length);w++)M==="uppercase"?k[w][0]=k[w][0].toUpperCase():M==="capitalized"&&(k[w][0]=k[w][0].substr(0,1).toUpperCase()+k[w][0].substr(1)),!s.hasFlag(k[w][0],"NOSUGGEST")&&D.indexOf(k[w][0])==-1?D.push(k[w][0]):P++;return D}return this.memoized[t]={suggestions:c(t),limit:e},this.memoized[t].suggestions}}})();typeof JF<"u"&&(JF.exports=ZF)});var lfe=Z((SMt,sfe)=>{"use strict";var afe=ofe();function xn(t){if(t=t||{},typeof t.codeMirrorInstance!="function"||typeof t.codeMirrorInstance.defineMode!="function"){console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`");return}String.prototype.includes||(String.prototype.includes=function(){"use strict";return String.prototype.indexOf.apply(this,arguments)!==-1}),t.codeMirrorInstance.defineMode("spell-checker",function(e){if(!xn.aff_loading){xn.aff_loading=!0;var r=new XMLHttpRequest;r.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),r.onload=function(){r.readyState===4&&r.status===200&&(xn.aff_data=r.responseText,xn.num_loaded++,xn.num_loaded==2&&(xn.typo=new afe("en_US",xn.aff_data,xn.dic_data,{platform:"any"})))},r.send(null)}if(!xn.dic_loading){xn.dic_loading=!0;var n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),n.onload=function(){n.readyState===4&&n.status===200&&(xn.dic_data=n.responseText,xn.num_loaded++,xn.num_loaded==2&&(xn.typo=new afe("en_US",xn.aff_data,xn.dic_data,{platform:"any"})))},n.send(null)}var i='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',o={token:function(s){var u=s.peek(),c="";if(i.includes(u))return s.next(),null;for(;(u=s.peek())!=null&&!i.includes(u);)c+=u,s.next();return xn.typo&&!xn.typo.check(c)?"spell-error":null}},a=t.codeMirrorInstance.getMode(e,e.backdrop||"text/plain");return t.codeMirrorInstance.overlayMode(a,o,!0)})}xn.num_loaded=0;xn.aff_loading=!1;xn.dic_loading=!1;xn.aff_data="";xn.dic_data="";xn.typo;sfe.exports=xn});var bfe=Z(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});function ufe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ztt(t,e,r){return e&&ufe(t.prototype,e),r&&ufe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Jtt(t,e){if(!!t){if(typeof t=="string")return cfe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cfe(t,e)}}function cfe(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function W0(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=Jtt(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.