avo 2.32.3 → 2.32.5
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/components/avo/actions_component.rb +4 -2
- data/app/components/avo/index/resource_map_component.html.erb +1 -1
- data/app/javascript/js/controllers/search_controller.js +3 -1
- data/app/views/avo/actions/show.html.erb +2 -1
- data/config/routes.rb +2 -2
- data/lib/avo/base_action.rb +1 -1
- data/lib/avo/resources/controls/action.rb +4 -1
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/install_generator.rb +11 -0
- data/public/avo-assets/avo.base.js +1 -1
- data/public/avo-assets/avo.base.js.map +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc2e0d4d0438f400a3ceb9929a504b9b9f42e760155a6321c9cbca07e575f52b
|
4
|
+
data.tar.gz: d023300fd0ca0d5484c05545da79f495fd1e2f47e2c8576353a4d87eec23dc9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8335667ee5a3c608c6533d758fccc92508a20ca927c75acd890761ffe1ee2d3a1ebbb72c7ddb56e94162a0d72bd36eaf606ebfdf85217c33a971f9e26358c8c2
|
7
|
+
data.tar.gz: b2dbeb103ac187a839526bf614afdda7bf6fdfd73a242e2323308b8332df738575fe5469f87a85d7cab95be29ea75e47fc7118cfd54bfbcece6cd545978b63c2
|
data/Gemfile.lock
CHANGED
@@ -53,13 +53,15 @@ class Avo::ActionsComponent < ViewComponent::Base
|
|
53
53
|
|
54
54
|
def single_record_path(id)
|
55
55
|
Avo::Services::URIService.parse(@resource.record_path)
|
56
|
-
.append_paths("actions"
|
56
|
+
.append_paths("actions")
|
57
|
+
.append_query("action_id": id)
|
57
58
|
.to_s
|
58
59
|
end
|
59
60
|
|
60
61
|
def many_records_path(id)
|
61
62
|
Avo::Services::URIService.parse(@resource.records_path)
|
62
|
-
.append_paths("actions"
|
63
|
+
.append_paths("actions")
|
64
|
+
.append_query("action_id": id)
|
63
65
|
.to_s
|
64
66
|
end
|
65
67
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<%= js_map(resource_location_markers, **resource_mapkick_options) %>
|
5
5
|
</div>
|
6
6
|
<% if render_table? %>
|
7
|
-
<div class="overflow-auto<%= table_component_order_class %>">
|
7
|
+
<div class="overflow-auto <%= table_component_order_class %>">
|
8
8
|
<%= render(Avo::Index::ResourceTableComponent.new(resources: @resources, resource: @resource, reflection: @reflection, parent_model: @parent_model, parent_resource: @parent_resource, pagy: @pagy, query: @query)) %>
|
9
9
|
</div>
|
10
10
|
<% end %>
|
@@ -211,7 +211,9 @@ export default class extends Controller {
|
|
211
211
|
searchUrl(query) {
|
212
212
|
const url = URI()
|
213
213
|
|
214
|
-
return url.segment([window.Avo.configuration.root_path, ...this.searchSegments()])
|
214
|
+
return url.segment([window.Avo.configuration.root_path, ...this.searchSegments()])
|
215
|
+
.search(this.searchParams(encodeURIComponent(query)))
|
216
|
+
.readable().toString()
|
215
217
|
}
|
216
218
|
|
217
219
|
searchSegments() {
|
@@ -9,7 +9,7 @@
|
|
9
9
|
>
|
10
10
|
<%= form_with model: @model,
|
11
11
|
scope: 'fields',
|
12
|
-
url: "#{@resource.records_path}/actions
|
12
|
+
url: "#{@resource.records_path}/actions",
|
13
13
|
local: true,
|
14
14
|
data: @action.class.form_data_attributes do |form|
|
15
15
|
%>
|
@@ -20,6 +20,7 @@
|
|
20
20
|
<div class="flex-1 flex">
|
21
21
|
<%= @action.get_message %>
|
22
22
|
</div>
|
23
|
+
<%= hidden_field_tag :action_id, @action.param_id %>
|
23
24
|
<%= form.hidden_field :avo_resource_ids, value: params[:resource_ids], 'data-action-target': 'resourceIds' %>
|
24
25
|
<%= form.hidden_field :avo_selected_query, 'data-action-target': 'selectedAllQuery' %>
|
25
26
|
<% if @action.get_fields.present? %>
|
data/config/routes.rb
CHANGED
@@ -28,8 +28,8 @@ Avo::Engine.routes.draw do
|
|
28
28
|
delete "/:resource_name/:id/active_storage_attachments/:attachment_name/:attachment_id", to: "attachments#destroy"
|
29
29
|
|
30
30
|
# Actions
|
31
|
-
get "/:resource_name(/:id)/actions
|
32
|
-
post "/:resource_name(/:id)/actions
|
31
|
+
get "/:resource_name(/:id)/actions/(:action_id)", to: "actions#show"
|
32
|
+
post "/:resource_name(/:id)/actions/(:action_id)", to: "actions#handle"
|
33
33
|
|
34
34
|
# Generate resource routes as below:
|
35
35
|
# resources :posts
|
data/lib/avo/base_action.rb
CHANGED
@@ -18,7 +18,10 @@ module Avo
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def path
|
21
|
-
Avo::Services::URIService.parse(@resource.record_path)
|
21
|
+
Avo::Services::URIService.parse(@resource.record_path)
|
22
|
+
.append_paths("actions")
|
23
|
+
.append_query(action_id: action.param_id)
|
24
|
+
.to_s
|
22
25
|
end
|
23
26
|
|
24
27
|
def label
|
data/lib/avo/version.rb
CHANGED
@@ -14,6 +14,17 @@ module Generators
|
|
14
14
|
|
15
15
|
template "initializer/avo.tt", "config/initializers/avo.rb"
|
16
16
|
directory File.join(__dir__, "templates", "locales"), "config/locales"
|
17
|
+
create_resources
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_resources
|
21
|
+
if defined?(User).present?
|
22
|
+
Rails::Generators.invoke("avo:resource", ["user", "-q"], {destination_root: Rails.root })
|
23
|
+
end
|
24
|
+
|
25
|
+
if defined?(Account).present?
|
26
|
+
Rails::Generators.invoke("avo:resource", ["account", "-q"], {destination_root: Rails.root })
|
27
|
+
end
|
17
28
|
end
|
18
29
|
end
|
19
30
|
end
|
@@ -619,7 +619,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
619
619
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ptt(t,e){if(!!t){if(typeof t=="string")return jz(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 jz(t,e)}}function Ltt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Rtt(t){if(Array.isArray(t))return jz(t)}function jz(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 lde(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,s=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e.apply(void 0,[r,{}].concat(Itt(W2({hit:o,attribute:s}).map(function(m,p){return m.isHighlighted?e(f,{key:p},m.value):m.value}))))}}var ude=He(()=>{yx()});function Ftt(t){return Btt(t)||ztt(t)||Ntt(t)||qtt()}function qtt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
620
620
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ntt(t,e){if(!!t){if(typeof t=="string")return Uz(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 Uz(t,e)}}function ztt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Btt(t){if(Array.isArray(t))return Uz(t)}function Uz(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 cde(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,s=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e.apply(void 0,[r,{}].concat(Ftt(Whe({hit:o,attribute:s}).map(function(m,p){return m.isHighlighted?e(f,{key:p},m.value):m.value}))))}}var fde=He(()=>{yx()});function jtt(t){return Wtt(t)||Htt(t)||Vtt(t)||Utt()}function Utt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
621
621
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vtt(t,e){if(!!t){if(typeof t=="string")return Vz(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 Vz(t,e)}}function Htt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Wtt(t){if(Array.isArray(t))return Vz(t)}function Vz(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 hde(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,s=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e.apply(void 0,[r,{}].concat(jtt(Ghe({hit:o,attribute:s}).map(function(m,p){return m.isHighlighted?e(f,{key:p},m.value):m.value}))))}}var dde=He(()=>{yx()});function $tt(t){return Ztt(t)||Ytt(t)||Ktt(t)||Gtt()}function Gtt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
622
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ktt(t,e){if(!!t){if(typeof t=="string")return Hz(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 Hz(t,e)}}function Ytt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Ztt(t){if(Array.isArray(t))return Hz(t)}function Hz(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 pde(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,s=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e.apply(void 0,[r,{}].concat($tt(K2({hit:o,attribute:s}).map(function(m,p){return m.isHighlighted?e(f,{key:p},m.value):m.value}))))}}var mde=He(()=>{yx()});var gde=He(()=>{ude();fde();dde();mde()});function vde(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 X2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vde(Object(r),!0).forEach(function(n){Xtt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vde(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Xtt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jtt(t,e){if(t==null)return{};var r=Qtt(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 Qtt(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 yde(t){var e,r=t.classNames,n=t.container,i=t.getEnvironmentProps,o=t.getFormProps,s=t.getInputProps,l=t.getItemProps,f=t.getLabelProps,m=t.getListProps,p=t.getPanelProps,_=t.getRootProps,k=t.panelContainer,T=t.panelPlacement,D=t.render,O=t.renderNoResults,B=t.renderer,P=t.detachedMediaQuery,q=t.components,j=Jtt(t,["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components"]),g=bz(n);g.tagName;var $=typeof window<"u"?window:{},V=B??rrt,J={Highlight:lde(V),ReverseHighlight:cde(V),ReverseSnippet:hde(V),Snippet:pde(V)};return{renderer:{classNames:ehe(ert,r??{}),container:g,getEnvironmentProps:i??function(ee){var he=ee.props;return he},getFormProps:o??function(ee){var he=ee.props;return he},getInputProps:s??function(ee){var he=ee.props;return he},getItemProps:l??function(ee){var he=ee.props;return he},getLabelProps:f??function(ee){var he=ee.props;return he},getListProps:m??function(ee){var he=ee.props;return he},getPanelProps:p??function(ee){var he=ee.props;return he},getRootProps:_??function(ee){var he=ee.props;return he},panelContainer:k?bz(k):document.body,panelPlacement:T??"input-wrapper-width",render:D??trt,renderNoResults:O,renderer:V,detachedMediaQuery:P??getComputedStyle($.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:X2(X2({},J),q)},core:X2(X2({},j),{},{id:(e=j.id)!==null&&e!==void 0?e:O2(),environment:$})}}var ert,trt,rrt,bde=He(()=>{ky();zhe();gde();gx();ert={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"},trt=function(e,r){var n=e.children;Nhe(n,r)},rrt={createElement:Az,Fragment:vx}});function xde(t){var e=t.panelPlacement,r=t.container,n=t.form,i=t.environment,o=r.getBoundingClientRect(),s=o.top+o.height;switch(e){case"start":return{top:s,left:o.left};case"end":return{top:s,right:i.document.documentElement.clientWidth-(o.left+o.width)};case"full-width":return{top:s,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var l=n.getBoundingClientRect();return{top:s,left:l.left,right:i.document.documentElement.clientWidth-(l.left+l.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}var _de=He(()=>{});function J2(){return J2=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},J2.apply(this,arguments)}function wde(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 Q2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wde(Object(r),!0).forEach(function(n){nrt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wde(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nrt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sde(t){var e=t.autocomplete,r=t.autocompleteScopeApi,n=t.dom,i=t.propGetters,o=t.state;wz(n.root,i.getRootProps(Q2({state:o,props:e.getRootProps({})},r))),wz(n.input,i.getInputProps(Q2({state:o,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},r))),wh(n.label,{hidden:o.status==="stalled"}),wh(n.loadingIndicator,{hidden:o.status!=="stalled"}),wh(n.clearButton,{hidden:!o.query})}function Ede(t,e){var r=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,o=e.createElement,s=e.dom,l=e.Fragment,f=e.panelContainer,m=e.propGetters,p=e.state,_=e.components;if(!p.isOpen){f.contains(s.panel)&&f.removeChild(s.panel);return}!f.contains(s.panel)&&p.status!=="loading"&&f.appendChild(s.panel),s.panel.classList.toggle("aa-Panel--stalled",p.status==="stalled");var k=p.collections.map(function(O,B){var P=O.source,q=O.items;return o("section",{key:B,className:i.source,"data-autocomplete-source-id":P.sourceId},P.templates.header&&o("div",{className:i.sourceHeader},P.templates.header({components:_,createElement:o,Fragment:l,items:q,source:P,state:p})),q.length===0&&P.templates.noResults&&p.query?o("div",{className:i.sourceNoResults},P.templates.noResults({components:_,createElement:o,Fragment:l,source:P,state:p})):o("ul",J2({className:i.list},m.getListProps(Q2({state:p,props:r.getListProps({})},n))),q.map(function(j){var g=r.getItemProps({item:j,source:P});return o("li",J2({key:g.id,className:i.item},m.getItemProps(Q2({state:p,props:g},n))),P.templates.item({components:_,createElement:o,Fragment:l,item:j,state:p}))})),P.templates.footer&&o("div",{className:i.sourceFooter},P.templates.footer({components:_,createElement:o,Fragment:l,items:q,source:P,state:p})))}),T=o(l,null,o("div",{className:"aa-PanelLayout aa-Panel--scrollable"},k),o("div",{className:"aa-GradientBottom"})),D=k.reduce(function(O,B){return O[B.props["data-autocomplete-source-id"]]=B,O},{});t({children:T,state:p,sections:k,elements:D,createElement:o,Fragment:l,components:_},s.panel)}var kde=He(()=>{gx()});function Tde(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 Cy(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Tde(Object(r),!0).forEach(function(n){Cde(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tde(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Cde(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ade(t){var e=xhe(),r=e.runEffect,n=e.cleanupEffects,i=e.runEffects,o=whe(),s=o.reactive,l=o.runReactives,f=cS(!1),m=cS(t),p=cS(void 0),_=s(function(){return yde(m.current)}),k=s(function(){return _.value.core.environment.matchMedia(_.value.renderer.detachedMediaQuery).matches}),T=s(function(){return Ffe(Cy(Cy({},_.value.core),{},{onStateChange:function(J){var ee,he,fe;f.current=J.state.collections.some(function(Ce){return Ce.source.templates.noResults}),(ee=p.current)===null||ee===void 0||ee.call(p,J),(he=(fe=_.value.core).onStateChange)===null||he===void 0||he.call(fe,J)},shouldPanelOpen:m.current.shouldPanelOpen||function(V){var J=V.state,ee=Zg(J)>0;if(!_.value.core.openOnFocus&&!J.query)return ee;var he=Boolean(f.current||_.value.renderer.renderNoResults);return!ee&&he||ee}}))}),D=cS(Cy({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},_.value.core.initialState)),O={getEnvironmentProps:_.value.renderer.getEnvironmentProps,getFormProps:_.value.renderer.getFormProps,getInputProps:_.value.renderer.getInputProps,getItemProps:_.value.renderer.getItemProps,getLabelProps:_.value.renderer.getLabelProps,getListProps:_.value.renderer.getListProps,getPanelProps:_.value.renderer.getPanelProps,getRootProps:_.value.renderer.getRootProps},B={setActiveItemId:T.value.setActiveItemId,setQuery:T.value.setQuery,setCollections:T.value.setCollections,setIsOpen:T.value.setIsOpen,setStatus:T.value.setStatus,setContext:T.value.setContext,refresh:T.value.refresh},P=s(function(){return yhe({autocomplete:T.value,autocompleteScopeApi:B,classNames:_.value.renderer.classNames,isDetached:k.value,placeholder:_.value.core.placeholder,propGetters:O,state:D.current})});function q(){wh(P.value.panel,{style:k.value?{}:xde({panelPlacement:_.value.renderer.panelPlacement,container:P.value.root,form:P.value.form,environment:_.value.core.environment})})}function j(V){D.current=V;var J={autocomplete:T.value,autocompleteScopeApi:B,classNames:_.value.renderer.classNames,components:_.value.renderer.components,container:_.value.renderer.container,createElement:_.value.renderer.renderer.createElement,dom:P.value,Fragment:_.value.renderer.renderer.Fragment,panelContainer:k.value?P.value.detachedContainer:_.value.renderer.panelContainer,propGetters:O,state:D.current},ee=!Zg(V)&&!f.current&&_.value.renderer.renderNoResults||_.value.renderer.render;Sde(J),Ede(ee,J)}r(function(){var V=T.value.getEnvironmentProps({formElement:P.value.form,panelElement:P.value.panel,inputElement:P.value.input});return wh(_.value.core.environment,V),function(){wh(_.value.core.environment,Object.keys(V).reduce(function(J,ee){return Cy(Cy({},J),{},Cde({},ee,void 0))},{}))}}),r(function(){var V=k.value?_.value.core.environment.document.body:_.value.renderer.panelContainer,J=k.value?P.value.detachedOverlay:P.value.panel;return k.value&&D.current.isOpen&&P.value.openDetachedOverlay(),j(D.current),function(){V.contains(J)&&V.removeChild(J)}}),r(function(){var V=_.value.renderer.container;return V.appendChild(P.value.root),function(){V.removeChild(P.value.root)}}),r(function(){var V=fz(function(J){var ee=J.state;j(ee)},0);return p.current=function(J){var ee=J.state,he=J.prevState;if(ee.isOpen&&!he.isOpen&&q(),ee.query!==he.query){var fe=document.querySelectorAll(".aa-Panel--scrollable");fe.forEach(function(Ce){Ce.scrollTop!==0&&(Ce.scrollTop=0)})}V({state:ee})},function(){p.current=void 0}}),r(function(){var V=fz(function(){var J=k.value;k.value=_.value.core.environment.matchMedia(_.value.renderer.detachedMediaQuery).matches,J!==k.value?$({}):requestAnimationFrame(q)},20);return _.value.core.environment.addEventListener("resize",V),function(){_.value.core.environment.removeEventListener("resize",V)}}),r(function(){if(!k.value)return function(){};function V(he){P.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",he)}function J(he){V(he.matches)}var ee=_.value.core.environment.matchMedia(getComputedStyle(_.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));return V(ee.matches),ee.addEventListener("change",J),function(){ee.removeEventListener("change",J)}}),r(function(){return requestAnimationFrame(q),function(){}});function g(){n()}function $(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(),m.current=_z(_.value.renderer,_.value.core,{initialState:D.current},V),l(),i(),T.value.refresh().then(function(){j(D.current)})}return Cy(Cy({},B),{},{update:$,destroy:g})}var Dde=He(()=>{Jfe();ky();bhe();_he();She();bde();_de();kde();gx()});var Ode,Ide=He(()=>{Ode="1.0.0-alpha.46"});function Mde(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 Pde(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Mde(Object(r),!0).forEach(function(n){irt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mde(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function irt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Lde,Rde=He(()=>{yx();Ide();Lde=Y2(function(t){return Z2(Pde(Pde({},t),{},{userAgents:[{segment:"autocomplete-js",version:Ode}]}))})});var Fde=He(()=>{});var WDt,qde=He(()=>{Rde();WDt=Lde({transformResponse:function(e){return e.hits}})});var Nde=He(()=>{Fde();qde()});var zde=He(()=>{});var Bde=He(()=>{});var jde=He(()=>{});var Ude=He(()=>{});var Vde=He(()=>{});var Hde=He(()=>{});var Wde=He(()=>{});var $de=He(()=>{});var Gde=He(()=>{});var Kde=He(()=>{});var Yde=He(()=>{});var Zde=He(()=>{});var Xde=He(()=>{});var Jde=He(()=>{zde();Bde();jde();Ude();Vde();Hde();Wde();$de();Gde();Kde();Yde();Zde();Xde()});var Qde=He(()=>{Dde();Nde();Jde()});var eD,Wz=He(()=>{eD=(t,e)=>{let r;return(...n)=>(r&&clearTimeout(r),new Promise(i=>{r=setTimeout(()=>i(t(...n)),e)}))}});var epe,tpe,tD,rpe=He(()=>{epe=ho(dF());so();FF();Qde();tpe=ho(Y0());Wz();tD=class extends rn{constructor(){super(...arguments);Vr(this,"debouncedFetch",eD(fetch,this.searchDebounce));Vr(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&&epe.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="";let{destroy:e}=Ade({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 l;switch(n._avatar_type){default:case"circle":l="rounded-full";break;case"rounded":l="rounded";break;case"square":l="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 ${l}`}))}let s=[n._label];return n._description&&s.push(i("div",{class:"aa-ItemDescription"},n._description)),o.push(i("div",null,s)),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")):Xv.visit(t._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(t){return(0,tpe.default)().segment([window.Avo.configuration.root_path,...this.searchSegments()]).search(this.searchParams(t)).readable().toString()}searchSegments(){let t=["avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(t=["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=ag(ih({},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=ag(ih({},t),{via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId}),t}addReflectionParams(t){return t=ag(ih({},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"))}};Vr(tD,"targets",["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"])});var npe,rD,ipe=He(()=>{so();npe=ho(Y0()),rD=class extends rn{get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(t){if(!this.parentTurboFrame.src)return;let e=new npe.default(this.parentTurboFrame.src);e.search(ag(ih({},e.query(!0)),{range:t.currentTarget.value})),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};Vr(rD,"targets",["select"])});var nD,ope=He(()=>{Z0();nD=class extends Df{getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:t}=this.selectorTarget.dataset;return t}};Vr(nD,"targets",["selector"])});async function Kz(t,e=null){t.classList.remove("hidden"),await spe("enter",t,e)}async function Yz(t,e=null){await spe("leave",t,e),t.classList.add("hidden")}async function ape(t,e=null){t.classList.contains("hidden")?await Kz(t,e):await Yz(t,e)}async function spe(t,e,r){let n=e.dataset,i=r?`${r}-${t}`:t,o=`transition${t.charAt(0).toUpperCase()+t.slice(1)}`,s=n[o]?n[o].split(" "):[i],l=n[`${o}Start`]?n[`${o}Start`].split(" "):[`${i}-start`],f=n[`${o}End`]?n[`${o}End`].split(" "):[`${i}-end`];$z(e,s),$z(e,l),await ort(),Gz(e,l),$z(e,f),await art(e),Gz(e,f),Gz(e,s)}function $z(t,e){t.classList.add(...e)}function Gz(t,e){t.classList.remove(...e)}function ort(){return new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})})}function art(t){return new Promise(e=>{let r=getComputedStyle(t).transitionDuration.split(",")[0],n=Number(r.replace("s",""))*1e3;setTimeout(()=>{e()},n)})}var lpe=He(()=>{});function iD(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 Zz(t,e){function r(i,o,s){if(!(typeof document>"u")){s=iD({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var f in s)!s[f]||(l+="; "+f,s[f]!==!0&&(l+="="+s[f].split(";")[0]));return document.cookie=i+"="+t.write(o,i)+l}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],s={},l=0;l<o.length;l++){var f=o[l].split("="),m=f.slice(1).join("=");try{var p=decodeURIComponent(f[0]);if(s[p]=t.read(m,p),i===p)break}catch{}}return i?s[i]:s}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",iD({},o,{expires:-1}))},withAttributes:function(i){return Zz(this.converter,iD({},this.attributes,i))},withConverter:function(i){return Zz(iD({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var srt,lrt,gS,upe=He(()=>{srt={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)}};lrt=Zz(srt,{path:"/"}),gS=lrt});var vS,cpe=He(()=>{so();lpe();upe();vS=class extends rn{get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return gS.get(this.cookieKey)==="1"}set cookie(t){gS.set(this.cookieKey,t===!0?1:0)}markSidebarClosed(){gS.set(this.cookieKey,"0"),this.openValue=!1,Yz(this.sidebarTarget),this.mainAreaTarget.classList.remove("sidebar-open")}markSidebarOpen(){gS.set(this.cookieKey,"1"),this.openValue=!0,Kz(this.sidebarTarget),this.mainAreaTarget.classList.add("sidebar-open")}toggleSidebar(){this.openValue?this.markSidebarClosed():this.markSidebarOpen()}toggleSidebarOnMobile(){ape(this.mobileSidebarTarget)}};Vr(vS,"targets",["sidebar","mobileSidebar","mainArea"]),Vr(vS,"values",{open:Boolean})});var dpe=ve((fpe,hpe)=>{(function(t){typeof fpe=="object"&&typeof hpe=="object"?t(So()):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 s=o.listSelections(),l=[],f=0;f<s.length;f++){var m=s[f].head,p=o.getStateAfter(m.line),_=t.innerMode(o.getMode(),p);if(_.mode.name!=="markdown"){o.execCommand("newlineAndIndent");return}else p=_.state;var k=p.list!==!1,T=p.quote!==0,D=o.getLine(m.line),O=e.exec(D),B=/^\s*$/.test(D.slice(0,m.ch));if(!s[f].empty()||!k&&!T||!O||B){o.execCommand("newlineAndIndent");return}if(r.test(D)){var P=T&&/>\s*$/.test(D),q=!/>\s*$/.test(D);(P||q)&&o.replaceRange("",{line:m.line,ch:0},{line:m.line,ch:m.ch+1}),l[f]=`
|
622
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ktt(t,e){if(!!t){if(typeof t=="string")return Hz(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 Hz(t,e)}}function Ytt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Ztt(t){if(Array.isArray(t))return Hz(t)}function Hz(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 pde(t){var e=t.createElement,r=t.Fragment;return function(i){var o=i.hit,s=i.attribute,l=i.tagName,f=l===void 0?"mark":l;return e.apply(void 0,[r,{}].concat($tt(K2({hit:o,attribute:s}).map(function(m,p){return m.isHighlighted?e(f,{key:p},m.value):m.value}))))}}var mde=He(()=>{yx()});var gde=He(()=>{ude();fde();dde();mde()});function vde(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 X2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vde(Object(r),!0).forEach(function(n){Xtt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vde(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Xtt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jtt(t,e){if(t==null)return{};var r=Qtt(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 Qtt(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 yde(t){var e,r=t.classNames,n=t.container,i=t.getEnvironmentProps,o=t.getFormProps,s=t.getInputProps,l=t.getItemProps,f=t.getLabelProps,m=t.getListProps,p=t.getPanelProps,_=t.getRootProps,k=t.panelContainer,T=t.panelPlacement,D=t.render,O=t.renderNoResults,B=t.renderer,P=t.detachedMediaQuery,q=t.components,j=Jtt(t,["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components"]),g=bz(n);g.tagName;var $=typeof window<"u"?window:{},V=B??rrt,J={Highlight:lde(V),ReverseHighlight:cde(V),ReverseSnippet:hde(V),Snippet:pde(V)};return{renderer:{classNames:ehe(ert,r??{}),container:g,getEnvironmentProps:i??function(ee){var he=ee.props;return he},getFormProps:o??function(ee){var he=ee.props;return he},getInputProps:s??function(ee){var he=ee.props;return he},getItemProps:l??function(ee){var he=ee.props;return he},getLabelProps:f??function(ee){var he=ee.props;return he},getListProps:m??function(ee){var he=ee.props;return he},getPanelProps:p??function(ee){var he=ee.props;return he},getRootProps:_??function(ee){var he=ee.props;return he},panelContainer:k?bz(k):document.body,panelPlacement:T??"input-wrapper-width",render:D??trt,renderNoResults:O,renderer:V,detachedMediaQuery:P??getComputedStyle($.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:X2(X2({},J),q)},core:X2(X2({},j),{},{id:(e=j.id)!==null&&e!==void 0?e:O2(),environment:$})}}var ert,trt,rrt,bde=He(()=>{ky();zhe();gde();gx();ert={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"},trt=function(e,r){var n=e.children;Nhe(n,r)},rrt={createElement:Az,Fragment:vx}});function xde(t){var e=t.panelPlacement,r=t.container,n=t.form,i=t.environment,o=r.getBoundingClientRect(),s=o.top+o.height;switch(e){case"start":return{top:s,left:o.left};case"end":return{top:s,right:i.document.documentElement.clientWidth-(o.left+o.width)};case"full-width":return{top:s,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var l=n.getBoundingClientRect();return{top:s,left:l.left,right:i.document.documentElement.clientWidth-(l.left+l.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}var _de=He(()=>{});function J2(){return J2=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},J2.apply(this,arguments)}function wde(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 Q2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wde(Object(r),!0).forEach(function(n){nrt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wde(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nrt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sde(t){var e=t.autocomplete,r=t.autocompleteScopeApi,n=t.dom,i=t.propGetters,o=t.state;wz(n.root,i.getRootProps(Q2({state:o,props:e.getRootProps({})},r))),wz(n.input,i.getInputProps(Q2({state:o,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},r))),wh(n.label,{hidden:o.status==="stalled"}),wh(n.loadingIndicator,{hidden:o.status!=="stalled"}),wh(n.clearButton,{hidden:!o.query})}function Ede(t,e){var r=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,o=e.createElement,s=e.dom,l=e.Fragment,f=e.panelContainer,m=e.propGetters,p=e.state,_=e.components;if(!p.isOpen){f.contains(s.panel)&&f.removeChild(s.panel);return}!f.contains(s.panel)&&p.status!=="loading"&&f.appendChild(s.panel),s.panel.classList.toggle("aa-Panel--stalled",p.status==="stalled");var k=p.collections.map(function(O,B){var P=O.source,q=O.items;return o("section",{key:B,className:i.source,"data-autocomplete-source-id":P.sourceId},P.templates.header&&o("div",{className:i.sourceHeader},P.templates.header({components:_,createElement:o,Fragment:l,items:q,source:P,state:p})),q.length===0&&P.templates.noResults&&p.query?o("div",{className:i.sourceNoResults},P.templates.noResults({components:_,createElement:o,Fragment:l,source:P,state:p})):o("ul",J2({className:i.list},m.getListProps(Q2({state:p,props:r.getListProps({})},n))),q.map(function(j){var g=r.getItemProps({item:j,source:P});return o("li",J2({key:g.id,className:i.item},m.getItemProps(Q2({state:p,props:g},n))),P.templates.item({components:_,createElement:o,Fragment:l,item:j,state:p}))})),P.templates.footer&&o("div",{className:i.sourceFooter},P.templates.footer({components:_,createElement:o,Fragment:l,items:q,source:P,state:p})))}),T=o(l,null,o("div",{className:"aa-PanelLayout aa-Panel--scrollable"},k),o("div",{className:"aa-GradientBottom"})),D=k.reduce(function(O,B){return O[B.props["data-autocomplete-source-id"]]=B,O},{});t({children:T,state:p,sections:k,elements:D,createElement:o,Fragment:l,components:_},s.panel)}var kde=He(()=>{gx()});function Tde(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 Cy(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Tde(Object(r),!0).forEach(function(n){Cde(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tde(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Cde(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ade(t){var e=xhe(),r=e.runEffect,n=e.cleanupEffects,i=e.runEffects,o=whe(),s=o.reactive,l=o.runReactives,f=cS(!1),m=cS(t),p=cS(void 0),_=s(function(){return yde(m.current)}),k=s(function(){return _.value.core.environment.matchMedia(_.value.renderer.detachedMediaQuery).matches}),T=s(function(){return Ffe(Cy(Cy({},_.value.core),{},{onStateChange:function(J){var ee,he,fe;f.current=J.state.collections.some(function(Ce){return Ce.source.templates.noResults}),(ee=p.current)===null||ee===void 0||ee.call(p,J),(he=(fe=_.value.core).onStateChange)===null||he===void 0||he.call(fe,J)},shouldPanelOpen:m.current.shouldPanelOpen||function(V){var J=V.state,ee=Zg(J)>0;if(!_.value.core.openOnFocus&&!J.query)return ee;var he=Boolean(f.current||_.value.renderer.renderNoResults);return!ee&&he||ee}}))}),D=cS(Cy({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},_.value.core.initialState)),O={getEnvironmentProps:_.value.renderer.getEnvironmentProps,getFormProps:_.value.renderer.getFormProps,getInputProps:_.value.renderer.getInputProps,getItemProps:_.value.renderer.getItemProps,getLabelProps:_.value.renderer.getLabelProps,getListProps:_.value.renderer.getListProps,getPanelProps:_.value.renderer.getPanelProps,getRootProps:_.value.renderer.getRootProps},B={setActiveItemId:T.value.setActiveItemId,setQuery:T.value.setQuery,setCollections:T.value.setCollections,setIsOpen:T.value.setIsOpen,setStatus:T.value.setStatus,setContext:T.value.setContext,refresh:T.value.refresh},P=s(function(){return yhe({autocomplete:T.value,autocompleteScopeApi:B,classNames:_.value.renderer.classNames,isDetached:k.value,placeholder:_.value.core.placeholder,propGetters:O,state:D.current})});function q(){wh(P.value.panel,{style:k.value?{}:xde({panelPlacement:_.value.renderer.panelPlacement,container:P.value.root,form:P.value.form,environment:_.value.core.environment})})}function j(V){D.current=V;var J={autocomplete:T.value,autocompleteScopeApi:B,classNames:_.value.renderer.classNames,components:_.value.renderer.components,container:_.value.renderer.container,createElement:_.value.renderer.renderer.createElement,dom:P.value,Fragment:_.value.renderer.renderer.Fragment,panelContainer:k.value?P.value.detachedContainer:_.value.renderer.panelContainer,propGetters:O,state:D.current},ee=!Zg(V)&&!f.current&&_.value.renderer.renderNoResults||_.value.renderer.render;Sde(J),Ede(ee,J)}r(function(){var V=T.value.getEnvironmentProps({formElement:P.value.form,panelElement:P.value.panel,inputElement:P.value.input});return wh(_.value.core.environment,V),function(){wh(_.value.core.environment,Object.keys(V).reduce(function(J,ee){return Cy(Cy({},J),{},Cde({},ee,void 0))},{}))}}),r(function(){var V=k.value?_.value.core.environment.document.body:_.value.renderer.panelContainer,J=k.value?P.value.detachedOverlay:P.value.panel;return k.value&&D.current.isOpen&&P.value.openDetachedOverlay(),j(D.current),function(){V.contains(J)&&V.removeChild(J)}}),r(function(){var V=_.value.renderer.container;return V.appendChild(P.value.root),function(){V.removeChild(P.value.root)}}),r(function(){var V=fz(function(J){var ee=J.state;j(ee)},0);return p.current=function(J){var ee=J.state,he=J.prevState;if(ee.isOpen&&!he.isOpen&&q(),ee.query!==he.query){var fe=document.querySelectorAll(".aa-Panel--scrollable");fe.forEach(function(Ce){Ce.scrollTop!==0&&(Ce.scrollTop=0)})}V({state:ee})},function(){p.current=void 0}}),r(function(){var V=fz(function(){var J=k.value;k.value=_.value.core.environment.matchMedia(_.value.renderer.detachedMediaQuery).matches,J!==k.value?$({}):requestAnimationFrame(q)},20);return _.value.core.environment.addEventListener("resize",V),function(){_.value.core.environment.removeEventListener("resize",V)}}),r(function(){if(!k.value)return function(){};function V(he){P.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",he)}function J(he){V(he.matches)}var ee=_.value.core.environment.matchMedia(getComputedStyle(_.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));return V(ee.matches),ee.addEventListener("change",J),function(){ee.removeEventListener("change",J)}}),r(function(){return requestAnimationFrame(q),function(){}});function g(){n()}function $(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(),m.current=_z(_.value.renderer,_.value.core,{initialState:D.current},V),l(),i(),T.value.refresh().then(function(){j(D.current)})}return Cy(Cy({},B),{},{update:$,destroy:g})}var Dde=He(()=>{Jfe();ky();bhe();_he();She();bde();_de();kde();gx()});var Ode,Ide=He(()=>{Ode="1.0.0-alpha.46"});function Mde(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 Pde(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Mde(Object(r),!0).forEach(function(n){irt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mde(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function irt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Lde,Rde=He(()=>{yx();Ide();Lde=Y2(function(t){return Z2(Pde(Pde({},t),{},{userAgents:[{segment:"autocomplete-js",version:Ode}]}))})});var Fde=He(()=>{});var WDt,qde=He(()=>{Rde();WDt=Lde({transformResponse:function(e){return e.hits}})});var Nde=He(()=>{Fde();qde()});var zde=He(()=>{});var Bde=He(()=>{});var jde=He(()=>{});var Ude=He(()=>{});var Vde=He(()=>{});var Hde=He(()=>{});var Wde=He(()=>{});var $de=He(()=>{});var Gde=He(()=>{});var Kde=He(()=>{});var Yde=He(()=>{});var Zde=He(()=>{});var Xde=He(()=>{});var Jde=He(()=>{zde();Bde();jde();Ude();Vde();Hde();Wde();$de();Gde();Kde();Yde();Zde();Xde()});var Qde=He(()=>{Dde();Nde();Jde()});var eD,Wz=He(()=>{eD=(t,e)=>{let r;return(...n)=>(r&&clearTimeout(r),new Promise(i=>{r=setTimeout(()=>i(t(...n)),e)}))}});var epe,tpe,tD,rpe=He(()=>{epe=ho(dF());so();FF();Qde();tpe=ho(Y0());Wz();tD=class extends rn{constructor(){super(...arguments);Vr(this,"debouncedFetch",eD(fetch,this.searchDebounce));Vr(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&&epe.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="";let{destroy:e}=Ade({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 l;switch(n._avatar_type){default:case"circle":l="rounded-full";break;case"rounded":l="rounded";break;case"square":l="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 ${l}`}))}let s=[n._label];return n._description&&s.push(i("div",{class:"aa-ItemDescription"},n._description)),o.push(i("div",null,s)),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")):Xv.visit(t._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(t){return(0,tpe.default)().segment([window.Avo.configuration.root_path,...this.searchSegments()]).search(this.searchParams(encodeURIComponent(t))).readable().toString()}searchSegments(){let t=["avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(t=["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=ag(ih({},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=ag(ih({},t),{via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId}),t}addReflectionParams(t){return t=ag(ih({},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"))}};Vr(tD,"targets",["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"])});var npe,rD,ipe=He(()=>{so();npe=ho(Y0()),rD=class extends rn{get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(t){if(!this.parentTurboFrame.src)return;let e=new npe.default(this.parentTurboFrame.src);e.search(ag(ih({},e.query(!0)),{range:t.currentTarget.value})),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};Vr(rD,"targets",["select"])});var nD,ope=He(()=>{Z0();nD=class extends Df{getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:t}=this.selectorTarget.dataset;return t}};Vr(nD,"targets",["selector"])});async function Kz(t,e=null){t.classList.remove("hidden"),await spe("enter",t,e)}async function Yz(t,e=null){await spe("leave",t,e),t.classList.add("hidden")}async function ape(t,e=null){t.classList.contains("hidden")?await Kz(t,e):await Yz(t,e)}async function spe(t,e,r){let n=e.dataset,i=r?`${r}-${t}`:t,o=`transition${t.charAt(0).toUpperCase()+t.slice(1)}`,s=n[o]?n[o].split(" "):[i],l=n[`${o}Start`]?n[`${o}Start`].split(" "):[`${i}-start`],f=n[`${o}End`]?n[`${o}End`].split(" "):[`${i}-end`];$z(e,s),$z(e,l),await ort(),Gz(e,l),$z(e,f),await art(e),Gz(e,f),Gz(e,s)}function $z(t,e){t.classList.add(...e)}function Gz(t,e){t.classList.remove(...e)}function ort(){return new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})})}function art(t){return new Promise(e=>{let r=getComputedStyle(t).transitionDuration.split(",")[0],n=Number(r.replace("s",""))*1e3;setTimeout(()=>{e()},n)})}var lpe=He(()=>{});function iD(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 Zz(t,e){function r(i,o,s){if(!(typeof document>"u")){s=iD({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var f in s)!s[f]||(l+="; "+f,s[f]!==!0&&(l+="="+s[f].split(";")[0]));return document.cookie=i+"="+t.write(o,i)+l}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],s={},l=0;l<o.length;l++){var f=o[l].split("="),m=f.slice(1).join("=");try{var p=decodeURIComponent(f[0]);if(s[p]=t.read(m,p),i===p)break}catch{}}return i?s[i]:s}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",iD({},o,{expires:-1}))},withAttributes:function(i){return Zz(this.converter,iD({},this.attributes,i))},withConverter:function(i){return Zz(iD({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var srt,lrt,gS,upe=He(()=>{srt={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)}};lrt=Zz(srt,{path:"/"}),gS=lrt});var vS,cpe=He(()=>{so();lpe();upe();vS=class extends rn{get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return gS.get(this.cookieKey)==="1"}set cookie(t){gS.set(this.cookieKey,t===!0?1:0)}markSidebarClosed(){gS.set(this.cookieKey,"0"),this.openValue=!1,Yz(this.sidebarTarget),this.mainAreaTarget.classList.remove("sidebar-open")}markSidebarOpen(){gS.set(this.cookieKey,"1"),this.openValue=!0,Kz(this.sidebarTarget),this.mainAreaTarget.classList.add("sidebar-open")}toggleSidebar(){this.openValue?this.markSidebarClosed():this.markSidebarOpen()}toggleSidebarOnMobile(){ape(this.mobileSidebarTarget)}};Vr(vS,"targets",["sidebar","mobileSidebar","mainArea"]),Vr(vS,"values",{open:Boolean})});var dpe=ve((fpe,hpe)=>{(function(t){typeof fpe=="object"&&typeof hpe=="object"?t(So()):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 s=o.listSelections(),l=[],f=0;f<s.length;f++){var m=s[f].head,p=o.getStateAfter(m.line),_=t.innerMode(o.getMode(),p);if(_.mode.name!=="markdown"){o.execCommand("newlineAndIndent");return}else p=_.state;var k=p.list!==!1,T=p.quote!==0,D=o.getLine(m.line),O=e.exec(D),B=/^\s*$/.test(D.slice(0,m.ch));if(!s[f].empty()||!k&&!T||!O||B){o.execCommand("newlineAndIndent");return}if(r.test(D)){var P=T&&/>\s*$/.test(D),q=!/>\s*$/.test(D);(P||q)&&o.replaceRange("",{line:m.line,ch:0},{line:m.line,ch:m.ch+1}),l[f]=`
|
623
623
|
`}else{var j=O[1],g=O[5],$=!(n.test(O[2])||O[2].indexOf(">")>=0),V=$?parseInt(O[3],10)+1+O[4]:O[2].replace("x"," ");l[f]=`
|
624
624
|
`+j+V+g,$&&i(o,m)}}o.replaceSelections(l)};function i(o,s){var l=s.line,f=0,m=0,p=e.exec(o.getLine(l)),_=p[1];do{f+=1;var k=l+f,T=o.getLine(k),D=e.exec(T);if(D){var O=D[1],B=parseInt(p[3],10)+f-m,P=parseInt(D[3],10),q=P;if(_===O&&!isNaN(P))B===P&&(q=P+1),B>P&&(q=B+1),o.replaceRange(T.replace(e,O+q+D[4]+D[5]),{line:k,ch:0},{line:k,ch:T.length});else{if(_.length>O.length||_.length<O.length&&f===1)return;m+=1}}}while(D)}})});var mpe=ve(()=>{var ppe=So();ppe.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)}};ppe.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 ype=ve((gpe,vpe)=>{(function(t){typeof gpe=="object"&&typeof vpe=="object"?t(So()):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 _pe=ve((bpe,xpe)=>{(function(t){typeof bpe=="object"&&typeof xpe=="object"?t(So()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){t.defineOption("placeholder","",function(l,f,m){var p=m&&m!=t.Init;if(f&&!p)l.on("blur",i),l.on("change",o),l.on("swapDoc",o),t.on(l.getInputField(),"compositionupdate",l.state.placeholderCompose=function(){n(l)}),o(l);else if(!f&&p){l.off("blur",i),l.off("change",o),l.off("swapDoc",o),t.off(l.getInputField(),"compositionupdate",l.state.placeholderCompose),e(l);var _=l.getWrapperElement();_.className=_.className.replace(" CodeMirror-empty","")}f&&!l.hasFocus()&&i(l)});function e(l){l.state.placeholder&&(l.state.placeholder.parentNode.removeChild(l.state.placeholder),l.state.placeholder=null)}function r(l){e(l);var f=l.state.placeholder=document.createElement("pre");f.style.cssText="height: 0; overflow: visible",f.style.direction=l.getOption("direction"),f.className="CodeMirror-placeholder CodeMirror-line-like";var m=l.getOption("placeholder");typeof m=="string"&&(m=document.createTextNode(m)),f.appendChild(m),l.display.lineSpace.insertBefore(f,l.display.lineSpace.firstChild)}function n(l){setTimeout(function(){var f=!1;if(l.lineCount()==1){var m=l.getInputField();f=m.nodeName=="TEXTAREA"?!l.getLine(0).length:!/[^\u200b]/.test(m.querySelector(".CodeMirror-line").textContent)}f?r(l):e(l)},20)}function i(l){s(l)&&r(l)}function o(l){var f=l.getWrapperElement(),m=s(l);f.className=f.className.replace(" CodeMirror-empty","")+(m?" CodeMirror-empty":""),m?r(l):e(l)}function s(l){return l.lineCount()===1&&l.getLine(0)===""}})});var Epe=ve((wpe,Spe)=>{(function(t){typeof wpe=="object"&&typeof Spe=="object"?t(So()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)})(function(t){"use strict";t.defineOption("styleSelectedText",!1,function(p,_,k){var T=k&&k!=t.Init;_&&!T?(p.state.markedSelection=[],p.state.markedSelectionStyle=typeof _=="string"?_:"CodeMirror-selectedtext",f(p),p.on("cursorActivity",e),p.on("change",r)):!_&&T&&(p.off("cursorActivity",e),p.off("change",r),l(p),p.state.markedSelection=p.state.markedSelectionStyle=null)});function e(p){p.state.markedSelection&&p.operation(function(){m(p)})}function r(p){p.state.markedSelection&&p.state.markedSelection.length&&p.operation(function(){l(p)})}var n=8,i=t.Pos,o=t.cmpPos;function s(p,_,k,T){if(o(_,k)!=0)for(var D=p.state.markedSelection,O=p.state.markedSelectionStyle,B=_.line;;){var P=B==_.line?_:i(B,0),q=B+n,j=q>=k.line,g=j?k:i(q,0),$=p.markText(P,g,{className:O});if(T==null?D.push($):D.splice(T++,0,$),j)break;B=q}}function l(p){for(var _=p.state.markedSelection,k=0;k<_.length;++k)_[k].clear();_.length=0}function f(p){l(p);for(var _=p.listSelections(),k=0;k<_.length;k++)s(p,_[k].from(),_[k].to())}function m(p){if(!p.somethingSelected())return l(p);if(p.listSelections().length>1)return f(p);var _=p.getCursor("start"),k=p.getCursor("end"),T=p.state.markedSelection;if(!T.length)return s(p,_,k);var D=T[0].find(),O=T[T.length-1].find();if(!D||!O||k.line-_.line<=n||o(_,O.to)>=0||o(k,D.from)<=0)return f(p);for(;o(_,D.from)>0;)T.shift().clear(),D=T[0].find();for(o(_,D.from)<0&&(D.to.line-_.line<n?(T.shift().clear(),s(p,_,D.to,0)):s(p,_,D.from,0));o(k,O.to)<0;)T.pop().clear(),O=T[T.length-1].find();o(k,O.to)>0&&(k.line-O.from.line<n?(T.pop().clear(),s(p,O.from,k)):s(p,O.to,k))}})});var Cpe=ve((kpe,Tpe)=>{(function(t){typeof kpe=="object"&&typeof Tpe=="object"?t(So(),YA(),ZA()):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(m){return m.code=!1,null}var s={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(m){return{code:m.code,codeBlock:m.codeBlock,ateSpace:m.ateSpace}},token:function(m,p){if(p.combineTokens=null,p.codeBlock)return m.match(/^```+/)?(p.codeBlock=!1,null):(m.skipToEnd(),null);if(m.sol()&&(p.code=!1),m.sol()&&m.match(/^```+/))return m.skipToEnd(),p.codeBlock=!0,null;if(m.peek()==="`"){m.next();var _=m.pos;m.eatWhile("`");var k=1+m.pos-_;return p.code?k===i&&(p.code=!1):(i=k,p.code=!0),null}else if(p.code)return m.next(),null;if(m.eatSpace())return p.ateSpace=!0,null;if((m.sol()||p.ateSpace)&&(p.ateSpace=!1,n.gitHubSpice!==!1)){if(m.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return p.combineTokens=!0,"link";if(m.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return p.combineTokens=!0,"link"}return m.match(e)&&m.string.slice(m.start-2,m.start)!="]("&&(m.start==0||/\W/.test(m.string.charAt(m.start-1)))?(p.combineTokens=!0,"link"):(m.next(),null)},blankLine:o},l={taskLists:!0,strikethrough:!0,emoji:!0};for(var f in n)l[f]=n[f];return l.name="markdown",t.overlayMode(t.getMode(r,l),s)},"markdown"),t.defineMIME("text/x-gfm","gfm")})});var Ape=ve(()=>{});var Dpe=ve((qOt,Jz)=>{var Xz;(function(){"use strict";Xz=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,s,l,f,m;t&&(i.dictionary=t,e&&r?T():typeof window<"u"&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension?(n.dictionaryPath?o=n.dictionaryPath:o="typo/dictionaries",e||p(chrome.extension.getURL(o+"/"+t+"/"+t+".aff"),_),r||p(chrome.extension.getURL(o+"/"+t+"/"+t+".dic"),k)):(n.dictionaryPath?o=n.dictionaryPath:typeof __dirname<"u"?o=__dirname+"/dictionaries":o="./dictionaries",e||p(o+"/"+t+"/"+t+".aff",_),r||p(o+"/"+t+"/"+t+".dic",k)));function p(D,O){var B=i._readFile(D,null,n.asyncLoad);n.asyncLoad?B.then(function(P){O(P)}):O(B)}function _(D){e=D,r&&T()}function k(D){r=D,e&&T()}function T(){for(i.rules=i._parseAFF(e),i.compoundRuleCodes={},s=0,f=i.compoundRules.length;s<f;s++){var D=i.compoundRules[s];for(l=0,m=D.length;l<m;l++)i.compoundRuleCodes[D[l]]=[]}"ONLYINCOMPOUND"in i.flags&&(i.compoundRuleCodes[i.flags.ONLYINCOMPOUND]=[]),i.dictionaryTable=i._parseDIC(r);for(s in i.compoundRuleCodes)i.compoundRuleCodes[s].length===0&&delete i.compoundRuleCodes[s];for(s=0,f=i.compoundRules.length;s<f;s++){var O=i.compoundRules[s],B="";for(l=0,m=O.length;l<m;l++){var P=O[l];P in i.compoundRuleCodes?B+="("+i.compoundRuleCodes[P].join("|")+")":B+=P}i.compoundRules[s]=new RegExp(B,"i")}i.loaded=!0,n.asyncLoad&&n.loadedCallback&&n.loadedCallback(i)}return this},Xz.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(s,l){i.onload=function(){i.status===200?s(i.responseText):l(i.statusText)},i.onerror=function(){l(i.statusText)}})),i.overrideMimeType&&i.overrideMimeType("text/plain; charset="+e),i.send(null),r?n:i.responseText}else if(typeof yB<"u"){var o=Ape();try{if(o.existsSync(t))return o.readFileSync(t,e);console.log("Path "+t+" does not exist.")}catch(s){return console.log(s),""}}},_parseAFF:function(t){var e={},r,n,i,o,s,l,f,m;t=this._removeAffixComments(t);var p=t.split(/\r?\n/);for(s=0,f=p.length;s<f;s++){r=p[s];var _=r.split(/\s+/),k=_[0];if(k=="PFX"||k=="SFX"){var T=_[1],D=_[2];i=parseInt(_[3],10);var O=[];for(l=s+1,m=s+1+i;l<m;l++){n=p[l],o=n.split(/\s+/);var B=o[2],P=o[3].split("/"),q=P[0];q==="0"&&(q="");var j=this.parseRuleCodes(P[1]),g=o[4],$={};$.add=q,j.length>0&&($.continuationClasses=j),g!=="."&&(k==="SFX"?$.match=new RegExp(g+"$"):$.match=new RegExp("^"+g)),B!="0"&&(k==="SFX"?$.remove=new RegExp(B+"$"):$.remove=B),O.push($)}e[T]={type:k,combineable:D=="Y",entries:O},s+=i}else if(k==="COMPOUNDRULE"){for(i=parseInt(_[1],10),l=s+1,m=s+1+i;l<m;l++)r=p[l],o=r.split(/\s+/),this.compoundRules.push(o[1]);s+=i}else k==="REP"?(o=r.split(/\s+/),o.length===3&&this.replacementTable.push([o[1],o[2]])):this.flags[k]=_[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,`
|
625
625
|
`),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(he,fe){r.hasOwnProperty(he)||(r[he]=null),fe.length>0&&(r[he]===null&&(r[he]=[]),r[he].push(fe))}for(var i=1,o=e.length;i<o;i++){var s=e[i];if(!!s){var l=s.split("/",2),f=l[0];if(l.length>1){var m=this.parseRuleCodes(l[1]);(!("NEEDAFFIX"in this.flags)||m.indexOf(this.flags.NEEDAFFIX)==-1)&&n(f,m);for(var p=0,_=m.length;p<_;p++){var k=m[p],T=this.rules[k];if(T)for(var D=this._applyRule(f,T),O=0,B=D.length;O<B;O++){var P=D[O];if(n(P,[]),T.combineable)for(var q=p+1;q<_;q++){var j=m[q],g=this.rules[j];if(g&&g.combineable&&T.type!=g.type)for(var $=this._applyRule(P,g),V=0,J=$.length;V<J;V++){var ee=$[V];n(ee,[])}}}k in this.compoundRuleCodes&&this.compoundRuleCodes[k].push(f)}}else n(f.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 s=r[i];if(!s.match||t.match(s.match)){var l=t;if(s.remove&&(l=l.replace(s.remove,"")),e.type==="SFX"?l=l+s.add:l=s.add+l,n.push(l),"continuationClasses"in s)for(var f=0,m=s.continuationClasses.length;f<m;f++){var p=this.rules[s.continuationClasses[f]];p&&(n=n.concat(this._applyRule(l,p)))}}}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 s=t.replace(o[0],o[1]);if(this.check(s))return[s]}}var l=this;l.alphabet="abcdefghijklmnopqrstuvwxyz";function f(p,_){var k={},T,D,O,B,P,q,j=l.alphabet.length;if(typeof p=="string"){var g=p;p={},p[g]=!0}for(var g in p)for(T=0,B=g.length+1;T<B;T++){var $=[g.substring(0,T),g.substring(T)];if($[1]&&(q=$[0]+$[1].substring(1),(!_||l.check(q))&&(q in k?k[q]+=1:k[q]=1)),$[1].length>1&&$[1][1]!==$[1][0]&&(q=$[0]+$[1][1]+$[1][0]+$[1].substring(2),(!_||l.check(q))&&(q in k?k[q]+=1:k[q]=1)),$[1]){var V=$[1].substring(0,1).toUpperCase()===$[1].substring(0,1)?"uppercase":"lowercase";for(D=0;D<j;D++){var J=l.alphabet[D];V==="uppercase"&&(J=J.toUpperCase()),J!=$[1].substring(0,1)&&(q=$[0]+J+$[1].substring(1),(!_||l.check(q))&&(q in k?k[q]+=1:k[q]=1))}}if($[1])for(D=0;D<j;D++){var V=$[0].substring(-1).toUpperCase()===$[0].substring(-1)&&$[1].substring(0,1).toUpperCase()===$[1].substring(0,1)?"uppercase":"lowercase",J=l.alphabet[D];V==="uppercase"&&(J=J.toUpperCase()),q=$[0]+J+$[1],(!_||l.check(q))&&(q in k?k[q]+=1:k[q]=1)}}return k}function m(p){var _=f(p),k=f(_,!0),T=k;for(var D in _)!l.check(D)||(D in T?T[D]+=_[D]:T[D]=_[D]);var O,B,P=[];for(O in T)T.hasOwnProperty(O)&&P.push([O,T[O]]);function q(V,J){var ee=V[1],he=J[1];return ee<he?-1:ee>he?1:J[0].localeCompare(V[0])}P.sort(q).reverse();var j=[],g="lowercase";p.toUpperCase()===p?g="uppercase":p.substr(0,1).toUpperCase()+p.substr(1).toLowerCase()===p&&(g="capitalized");var $=e;for(O=0;O<Math.min($,P.length);O++)g==="uppercase"?P[O][0]=P[O][0].toUpperCase():g==="capitalized"&&(P[O][0]=P[O][0].substr(0,1).toUpperCase()+P[O][0].substr(1)),!l.hasFlag(P[O][0],"NOSUGGEST")&&j.indexOf(P[O][0])==-1?j.push(P[O][0]):$++;return j}return this.memoized[t]={suggestions:m(t),limit:e},this.memoized[t].suggestions}}})();typeof Jz<"u"&&(Jz.exports=Xz)});var Mpe=ve((NOt,Ipe)=>{"use strict";var Ope=Dpe();function qa(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(!qa.aff_loading){qa.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&&(qa.aff_data=r.responseText,qa.num_loaded++,qa.num_loaded==2&&(qa.typo=new Ope("en_US",qa.aff_data,qa.dic_data,{platform:"any"})))},r.send(null)}if(!qa.dic_loading){qa.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&&(qa.dic_data=n.responseText,qa.num_loaded++,qa.num_loaded==2&&(qa.typo=new Ope("en_US",qa.aff_data,qa.dic_data,{platform:"any"})))},n.send(null)}var i='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',o={token:function(l){var f=l.peek(),m="";if(i.includes(f))return l.next(),null;for(;(f=l.peek())!=null&&!i.includes(f);)m+=f,l.next();return qa.typo&&!qa.typo.check(m)?"spell-error":null}},s=t.codeMirrorInstance.getMode(e,e.backdrop||"text/plain");return t.codeMirrorInstance.overlayMode(s,o,!0)})}qa.num_loaded=0;qa.aff_loading=!1;qa.dic_loading=!1;qa.aff_data="";qa.dic_data="";qa.typo;Ipe.exports=qa});var Vpe=ve(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});function Ppe(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 urt(t,e,r){return e&&Ppe(t.prototype,e),r&&Ppe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function crt(t,e){if(!!t){if(typeof t=="string")return Lpe(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 Lpe(t,e)}}function Lpe(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 yS(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=crt(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.
|