alchemy_cms 7.0.0.pre.b → 7.0.0.pre.c
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +21 -1
- data/.github/workflows/{ci.yml → test.yml} +1 -1
- data/.gitignore +0 -5
- data/CHANGELOG.md +4 -0
- data/Gemfile +0 -1
- data/README.md +3 -3
- data/Rakefile +0 -19
- data/alchemy_cms.gemspec +2 -1
- data/app/assets/config/alchemy_manifest.js +1 -0
- data/app/assets/javascripts/alchemy/admin.js +0 -1
- data/app/assets/javascripts/alchemy/alchemy.dirty.js.coffee +1 -1
- data/app/assets/javascripts/alchemy/alchemy.initializer.js.coffee +5 -12
- data/app/assets/stylesheets/alchemy/base.scss +2 -2
- data/app/controllers/alchemy/base_controller.rb +0 -7
- data/{package/src → app/javascript/alchemy_admin}/node_tree.js +2 -2
- data/{package/src → app/javascript/alchemy_admin}/page_publication_fields.js +1 -1
- data/{package/src → app/javascript/alchemy_admin}/page_sorter.js +1 -1
- data/{package/src → app/javascript/alchemy_admin}/picture_editors.js +2 -2
- data/{package/src → app/javascript/alchemy_admin}/sitemap.js +4 -4
- data/app/javascript/alchemy_admin.js +34 -0
- data/app/views/alchemy/_menubar.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/_replace_button.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/destroy.js.erb +1 -1
- data/app/views/alchemy/admin/nodes/index.html.erb +4 -2
- data/app/views/alchemy/admin/pages/_page_layout_filter.html.erb +1 -1
- data/app/views/alchemy/admin/pages/edit.html.erb +3 -4
- data/app/views/alchemy/admin/pages/index.html.erb +1 -1
- data/app/views/alchemy/admin/pages/update.js.erb +2 -2
- data/app/views/alchemy/admin/resources/_filter_bar.html.erb +1 -1
- data/app/views/alchemy/admin/styleguide/index.html.erb +1 -1
- data/app/views/alchemy/admin/uploader/_button.html.erb +1 -1
- data/app/views/alchemy/base/permission_denied.js.erb +1 -1
- data/app/views/alchemy/base/redirect.js.erb +1 -1
- data/app/views/layouts/alchemy/admin.html.erb +4 -8
- data/bin/importmap +4 -0
- data/bin/setup +0 -9
- data/bin/start +1 -1
- data/config/brakeman.ignore +0 -46
- data/config/importmap.rb +8 -0
- data/lib/alchemy/engine.rb +14 -0
- data/lib/alchemy/upgrader/seven_point_zero.rb +13 -23
- data/lib/alchemy/upgrader.rb +0 -11
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy.rb +5 -0
- data/lib/alchemy_cms.rb +2 -1
- data/lib/generators/alchemy/install/files/application.html.erb +2 -2
- data/lib/generators/alchemy/install/install_generator.rb +0 -24
- data/lib/tasks/alchemy/upgrade.rake +6 -12
- data/package.json +6 -26
- metadata +44 -27
- data/package/admin.js +0 -34
- data/package/dist/admin.js +0 -16
- data/package/dist/admin.js.map +0 -7
- data/package/src/__tests__/i18n.spec.js +0 -93
- data/package/src/utils/__tests__/ajax.spec.js +0 -168
- data/package/src/utils/__tests__/events.spec.js +0 -38
- /data/{package/src → app/javascript/alchemy_admin}/datepicker.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/file_editors.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/i18n.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/image_cropper.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/image_loader.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/ingredient_anchor_link.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/tinymce.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/translations.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/utils/ajax.js +0 -0
- /data/{package/src → app/javascript/alchemy_admin}/utils/events.js +0 -0
data/package/dist/admin.js
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
(()=>{var Qn=/\./;function wr(){if(Alchemy.locale==null)throw"Alchemy.locale is not set! Please set Alchemy.locale to a locale string in order to translate something.";return Alchemy.locale}function Er(){let n=wr(),t=Alchemy.translations&&Alchemy.translations[n];return t||(console.warn(`Translations for locale ${n} not found!`),{})}function Cr(n,t){let e=t.split(Qn),i=n[e[0]];return i&&i[e[1]]||t}function Sr(n){let t=Er();return Qn.test(n)?Cr(t,n):t[n]||n}function dn(n,t){let e=Sr(n);return t?e.replace(/%\{.+\}/,t):e}var Mr={en:{allowed_chars:"of %{count} chars",cancel:"Cancel",cancelled:"Cancelled",click_to_edit:"click to edit",complete:"Complete",element_dirty_notice:"This element has unsaved changes. Do you really want to fold it?",help:"Help",ok:"Ok",page_dirty_notice:"You have unsaved changes on this page. They will be lost if you continue.",page_found:"Page found",pages_found:"Pages found",url_validation_failed:"The url has no valid format.",warning:"Warning!","File is too large":"File is too large","File is too small":"File is too small","File type not allowed":"File type not allowed","Maximum number of files exceeded":"Maximum number of files exceeded.","Uploaded bytes exceed file size":"Uploaded bytes exceed file size",formats:{datetime:"Y-m-d H:i",date:"Y-m-d",time:"H:i",time_24hr:!1}}},ei=Mr;function ti(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),e.push.apply(e,i)}return e}function Ce(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?ti(Object(e),!0).forEach(function(i){_r(n,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):ti(Object(e)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(e,i))})}return n}function kt(n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?kt=function(t){return typeof t}:kt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(n)}function _r(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function xe(){return xe=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},xe.apply(this,arguments)}function xr(n,t){if(n==null)return{};var e={},i=Object.keys(n),o,l;for(l=0;l<i.length;l++)o=i[l],!(t.indexOf(o)>=0)&&(e[o]=n[o]);return e}function Tr(n,t){if(n==null)return{};var e=xr(n,t),i,o;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(n);for(o=0;o<l.length;o++)i=l[o],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(e[i]=n[i])}return e}var Ir="1.15.0";function _e(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var Te=_e(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),dt=_e(/Edge/i),ni=_e(/firefox/i),at=_e(/safari/i)&&!_e(/chrome/i)&&!_e(/android/i),ui=_e(/iP(ad|od|hone)/i),di=_e(/chrome/i)&&_e(/android/i),fi={capture:!1,passive:!1};function N(n,t,e){n.addEventListener(t,e,!Te&&fi)}function k(n,t,e){n.removeEventListener(t,e,!Te&&fi)}function Ht(n,t){if(t){if(t[0]===">"&&(t=t.substring(1)),n)try{if(n.matches)return n.matches(t);if(n.msMatchesSelector)return n.msMatchesSelector(t);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(t)}catch{return!1}return!1}}function Ar(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function we(n,t,e,i){if(n){e=e||document;do{if(t!=null&&(t[0]===">"?n.parentNode===e&&Ht(n,t):Ht(n,t))||i&&n===e)return n;if(n===e)break}while(n=Ar(n))}return null}var ii=/\s+/g;function de(n,t,e){if(n&&t)if(n.classList)n.classList[e?"add":"remove"](t);else{var i=(" "+n.className+" ").replace(ii," ").replace(" "+t+" "," ");n.className=(i+(e?" "+t:"")).replace(ii," ")}}function C(n,t,e){var i=n&&n.style;if(i){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),t===void 0?e:e[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=e+(typeof e=="string"?"":"px")}}function Ue(n,t){var e="";if(typeof n=="string")e=n;else do{var i=C(n,"transform");i&&i!=="none"&&(e=i+" "+e)}while(!t&&(n=n.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(e)}function pi(n,t,e){if(n){var i=n.getElementsByTagName(t),o=0,l=i.length;if(e)for(;o<l;o++)e(i[o],o);return i}return[]}function Ee(){var n=document.scrollingElement;return n||document.documentElement}function U(n,t,e,i,o){if(!(!n.getBoundingClientRect&&n!==window)){var l,c,u,f,p,v,g;if(n!==window&&n.parentNode&&n!==Ee()?(l=n.getBoundingClientRect(),c=l.top,u=l.left,f=l.bottom,p=l.right,v=l.height,g=l.width):(c=0,u=0,f=window.innerHeight,p=window.innerWidth,v=window.innerHeight,g=window.innerWidth),(t||e)&&n!==window&&(o=o||n.parentNode,!Te))do if(o&&o.getBoundingClientRect&&(C(o,"transform")!=="none"||e&&C(o,"position")!=="static")){var E=o.getBoundingClientRect();c-=E.top+parseInt(C(o,"border-top-width")),u-=E.left+parseInt(C(o,"border-left-width")),f=c+l.height,p=u+l.width;break}while(o=o.parentNode);if(i&&n!==window){var _=Ue(o||n),I=_&&_.a,y=_&&_.d;_&&(c/=y,u/=I,g/=I,v/=y,f=c+v,p=u+g)}return{top:c,left:u,bottom:f,right:p,width:g,height:v}}}function ri(n,t,e){for(var i=Ne(n,!0),o=U(n)[t];i;){var l=U(i)[e],c=void 0;if(e==="top"||e==="left"?c=o>=l:c=o<=l,!c)return i;if(i===Ee())break;i=Ne(i,!1)}return!1}function Je(n,t,e,i){for(var o=0,l=0,c=n.children;l<c.length;){if(c[l].style.display!=="none"&&c[l]!==S.ghost&&(i||c[l]!==S.dragged)&&we(c[l],e.draggable,n,!1)){if(o===t)return c[l];o++}l++}return null}function Mn(n,t){for(var e=n.lastElementChild;e&&(e===S.ghost||C(e,"display")==="none"||t&&!Ht(e,t));)e=e.previousElementSibling;return e||null}function he(n,t){var e=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==S.clone&&(!t||Ht(n,t))&&e++;return e}function oi(n){var t=0,e=0,i=Ee();if(n)do{var o=Ue(n),l=o.a,c=o.d;t+=n.scrollLeft*l,e+=n.scrollTop*c}while(n!==i&&(n=n.parentNode));return[t,e]}function Or(n,t){for(var e in n)if(n.hasOwnProperty(e)){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===n[e][i])return Number(e)}return-1}function Ne(n,t){if(!n||!n.getBoundingClientRect)return Ee();var e=n,i=!1;do if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var o=C(e);if(e.clientWidth<e.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||e.clientHeight<e.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!e.getBoundingClientRect||e===document.body)return Ee();if(i||t)return e;i=!0}}while(e=e.parentNode);return Ee()}function kr(n,t){if(n&&t)for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}function fn(n,t){return Math.round(n.top)===Math.round(t.top)&&Math.round(n.left)===Math.round(t.left)&&Math.round(n.height)===Math.round(t.height)&&Math.round(n.width)===Math.round(t.width)}var lt;function hi(n,t){return function(){if(!lt){var e=arguments,i=this;e.length===1?n.call(i,e[0]):n.apply(i,e),lt=setTimeout(function(){lt=void 0},t)}}}function Fr(){clearTimeout(lt),lt=void 0}function mi(n,t,e){n.scrollLeft+=t,n.scrollTop+=e}function gi(n){var t=window.Polymer,e=window.jQuery||window.Zepto;return t&&t.dom?t.dom(n).cloneNode(!0):e?e(n).clone(!0)[0]:n.cloneNode(!0)}var pe="Sortable"+new Date().getTime();function Nr(){var n=[],t;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var i=[].slice.call(this.el.children);i.forEach(function(o){if(!(C(o,"display")==="none"||o===S.ghost)){n.push({target:o,rect:U(o)});var l=Ce({},n[n.length-1].rect);if(o.thisAnimationDuration){var c=Ue(o,!0);c&&(l.top-=c.f,l.left-=c.e)}o.fromRect=l}})}},addAnimationState:function(i){n.push(i)},removeAnimationState:function(i){n.splice(Or(n,{target:i}),1)},animateAll:function(i){var o=this;if(!this.options.animation){clearTimeout(t),typeof i=="function"&&i();return}var l=!1,c=0;n.forEach(function(u){var f=0,p=u.target,v=p.fromRect,g=U(p),E=p.prevFromRect,_=p.prevToRect,I=u.rect,y=Ue(p,!0);y&&(g.top-=y.f,g.left-=y.e),p.toRect=g,p.thisAnimationDuration&&fn(E,g)&&!fn(v,g)&&(I.top-g.top)/(I.left-g.left)===(v.top-g.top)/(v.left-g.left)&&(f=Lr(I,E,_,o.options)),fn(g,v)||(p.prevFromRect=v,p.prevToRect=g,f||(f=o.options.animation),o.animate(p,I,g,f)),f&&(l=!0,c=Math.max(c,f),clearTimeout(p.animationResetTimer),p.animationResetTimer=setTimeout(function(){p.animationTime=0,p.prevFromRect=null,p.fromRect=null,p.prevToRect=null,p.thisAnimationDuration=null},f),p.thisAnimationDuration=f)}),clearTimeout(t),l?t=setTimeout(function(){typeof i=="function"&&i()},c):typeof i=="function"&&i(),n=[]},animate:function(i,o,l,c){if(c){C(i,"transition",""),C(i,"transform","");var u=Ue(this.el),f=u&&u.a,p=u&&u.d,v=(o.left-l.left)/(f||1),g=(o.top-l.top)/(p||1);i.animatingX=!!v,i.animatingY=!!g,C(i,"transform","translate3d("+v+"px,"+g+"px,0)"),this.forRepaintDummy=Pr(i),C(i,"transition","transform "+c+"ms"+(this.options.easing?" "+this.options.easing:"")),C(i,"transform","translate3d(0,0,0)"),typeof i.animated=="number"&&clearTimeout(i.animated),i.animated=setTimeout(function(){C(i,"transition",""),C(i,"transform",""),i.animated=!1,i.animatingX=!1,i.animatingY=!1},c)}}}}function Pr(n){return n.offsetWidth}function Lr(n,t,e,i){return Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))/Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))*i.animation}var Ke=[],pn={initializeByDefault:!0},ft={mount:function(t){for(var e in pn)pn.hasOwnProperty(e)&&!(e in t)&&(t[e]=pn[e]);Ke.forEach(function(i){if(i.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Ke.push(t)},pluginEvent:function(t,e,i){var o=this;this.eventCanceled=!1,i.cancel=function(){o.eventCanceled=!0};var l=t+"Global";Ke.forEach(function(c){e[c.pluginName]&&(e[c.pluginName][l]&&e[c.pluginName][l](Ce({sortable:e},i)),e.options[c.pluginName]&&e[c.pluginName][t]&&e[c.pluginName][t](Ce({sortable:e},i)))})},initializePlugins:function(t,e,i,o){Ke.forEach(function(u){var f=u.pluginName;if(!(!t.options[f]&&!u.initializeByDefault)){var p=new u(t,e,t.options);p.sortable=t,p.options=t.options,t[f]=p,xe(i,p.defaults)}});for(var l in t.options)if(t.options.hasOwnProperty(l)){var c=this.modifyOption(t,l,t.options[l]);typeof c<"u"&&(t.options[l]=c)}},getEventProperties:function(t,e){var i={};return Ke.forEach(function(o){typeof o.eventProperties=="function"&&xe(i,o.eventProperties.call(e[o.pluginName],t))}),i},modifyOption:function(t,e,i){var o;return Ke.forEach(function(l){t[l.pluginName]&&l.optionListeners&&typeof l.optionListeners[e]=="function"&&(o=l.optionListeners[e].call(t[l.pluginName],i))}),o}};function Hr(n){var t=n.sortable,e=n.rootEl,i=n.name,o=n.targetEl,l=n.cloneEl,c=n.toEl,u=n.fromEl,f=n.oldIndex,p=n.newIndex,v=n.oldDraggableIndex,g=n.newDraggableIndex,E=n.originalEvent,_=n.putSortable,I=n.extraEventProperties;if(t=t||e&&e[pe],!!t){var y,B=t.options,J="on"+i.charAt(0).toUpperCase()+i.substr(1);window.CustomEvent&&!Te&&!dt?y=new CustomEvent(i,{bubbles:!0,cancelable:!0}):(y=document.createEvent("Event"),y.initEvent(i,!0,!0)),y.to=c||e,y.from=u||e,y.item=o||e,y.clone=l,y.oldIndex=f,y.newIndex=p,y.oldDraggableIndex=v,y.newDraggableIndex=g,y.originalEvent=E,y.pullMode=_?_.lastPutMode:void 0;var P=Ce(Ce({},I),ft.getEventProperties(i,t));for(var q in P)y[q]=P[q];e&&e.dispatchEvent(y),B[J]&&B[J].call(t,y)}}var Yr=["evt"],ae=function(t,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.evt,l=Tr(i,Yr);ft.pluginEvent.bind(S)(t,e,Ce({dragEl:m,parentEl:z,ghostEl:x,rootEl:H,nextEl:Re,lastDownEl:Ft,cloneEl:R,cloneHidden:Fe,dragStarted:it,putSortable:Z,activeSortable:S.active,originalEvent:o,oldIndex:$e,oldDraggableIndex:st,newIndex:fe,newDraggableIndex:ke,hideGhostForTarget:Di,unhideGhostForTarget:wi,cloneNowHidden:function(){Fe=!0},cloneNowShown:function(){Fe=!1},dispatchSortableEvent:function(u){oe({sortable:e,name:u,originalEvent:o})}},l))};function oe(n){Hr(Ce({putSortable:Z,cloneEl:R,targetEl:m,rootEl:H,oldIndex:$e,oldDraggableIndex:st,newIndex:fe,newDraggableIndex:ke},n))}var m,z,x,H,Re,Ft,R,Fe,$e,fe,st,ke,Tt,Z,Ge=!1,Yt=!1,jt=[],Ye,ge,hn,mn,ai,li,it,Xe,ct,ut=!1,It=!1,Nt,ee,gn=[],wn=!1,Rt=[],Wt=typeof document<"u",At=ui,si=dt||Te?"cssFloat":"float",jr=Wt&&!di&&!ui&&"draggable"in document.createElement("div"),vi=function(){if(Wt){if(Te)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),bi=function(t,e){var i=C(t),o=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),l=Je(t,0,e),c=Je(t,1,e),u=l&&C(l),f=c&&C(c),p=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+U(l).width,v=f&&parseInt(f.marginLeft)+parseInt(f.marginRight)+U(c).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(l&&u.float&&u.float!=="none"){var g=u.float==="left"?"left":"right";return c&&(f.clear==="both"||f.clear===g)?"vertical":"horizontal"}return l&&(u.display==="block"||u.display==="flex"||u.display==="table"||u.display==="grid"||p>=o&&i[si]==="none"||c&&i[si]==="none"&&p+v>o)?"vertical":"horizontal"},Rr=function(t,e,i){var o=i?t.left:t.top,l=i?t.right:t.bottom,c=i?t.width:t.height,u=i?e.left:e.top,f=i?e.right:e.bottom,p=i?e.width:e.height;return o===u||l===f||o+c/2===u+p/2},Br=function(t,e){var i;return jt.some(function(o){var l=o[pe].options.emptyInsertThreshold;if(!(!l||Mn(o))){var c=U(o),u=t>=c.left-l&&t<=c.right+l,f=e>=c.top-l&&e<=c.bottom+l;if(u&&f)return i=o}}),i},yi=function(t){function e(l,c){return function(u,f,p,v){var g=u.options.group.name&&f.options.group.name&&u.options.group.name===f.options.group.name;if(l==null&&(c||g))return!0;if(l==null||l===!1)return!1;if(c&&l==="clone")return l;if(typeof l=="function")return e(l(u,f,p,v),c)(u,f,p,v);var E=(c?u:f).options.group.name;return l===!0||typeof l=="string"&&l===E||l.join&&l.indexOf(E)>-1}}var i={},o=t.group;(!o||kt(o)!="object")&&(o={name:o}),i.name=o.name,i.checkPull=e(o.pull,!0),i.checkPut=e(o.put),i.revertClone=o.revertClone,t.group=i},Di=function(){!vi&&x&&C(x,"display","none")},wi=function(){!vi&&x&&C(x,"display","")};Wt&&!di&&document.addEventListener("click",function(n){if(Yt)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Yt=!1,!1},!0);var je=function(t){if(m){t=t.touches?t.touches[0]:t;var e=Br(t.clientX,t.clientY);if(e){var i={};for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[pe]._onDragOver(i)}}},Wr=function(t){m&&m.parentNode[pe]._isOutsideThisEl(t.target)};function S(n,t){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=t=xe({},t),n[pe]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return bi(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(c,u){c.setData("Text",u.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:S.supportPointer!==!1&&"PointerEvent"in window&&!at,emptyInsertThreshold:5};ft.initializePlugins(this,n,e);for(var i in e)!(i in t)&&(t[i]=e[i]);yi(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:jr,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?N(n,"pointerdown",this._onTapStart):(N(n,"mousedown",this._onTapStart),N(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(N(n,"dragover",this),N(n,"dragenter",this)),jt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),xe(this,Nr())}S.prototype={constructor:S,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Xe=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,m):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,o=this.options,l=o.preventOnFilter,c=t.type,u=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,f=(u||t).target,p=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||f,v=o.filter;if(Jr(i),!m&&!(/mousedown|pointerdown/.test(c)&&t.button!==0||o.disabled)&&!p.isContentEditable&&!(!this.nativeDraggable&&at&&f&&f.tagName.toUpperCase()==="SELECT")&&(f=we(f,o.draggable,i,!1),!(f&&f.animated)&&Ft!==f)){if($e=he(f),st=he(f,o.draggable),typeof v=="function"){if(v.call(this,t,f,this)){oe({sortable:e,rootEl:p,name:"filter",targetEl:f,toEl:i,fromEl:i}),ae("filter",e,{evt:t}),l&&t.cancelable&&t.preventDefault();return}}else if(v&&(v=v.split(",").some(function(g){if(g=we(p,g.trim(),i,!1),g)return oe({sortable:e,rootEl:g,name:"filter",targetEl:f,fromEl:i,toEl:i}),ae("filter",e,{evt:t}),!0}),v)){l&&t.cancelable&&t.preventDefault();return}o.handle&&!we(p,o.handle,i,!1)||this._prepareDragStart(t,u,f)}}},_prepareDragStart:function(t,e,i){var o=this,l=o.el,c=o.options,u=l.ownerDocument,f;if(i&&!m&&i.parentNode===l){var p=U(i);if(H=l,m=i,z=m.parentNode,Re=m.nextSibling,Ft=i,Tt=c.group,S.dragged=m,Ye={target:m,clientX:(e||t).clientX,clientY:(e||t).clientY},ai=Ye.clientX-p.left,li=Ye.clientY-p.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,m.style["will-change"]="all",f=function(){if(ae("delayEnded",o,{evt:t}),S.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!ni&&o.nativeDraggable&&(m.draggable=!0),o._triggerDragStart(t,e),oe({sortable:o,name:"choose",originalEvent:t}),de(m,c.chosenClass,!0)},c.ignore.split(",").forEach(function(v){pi(m,v.trim(),vn)}),N(u,"dragover",je),N(u,"mousemove",je),N(u,"touchmove",je),N(u,"mouseup",o._onDrop),N(u,"touchend",o._onDrop),N(u,"touchcancel",o._onDrop),ni&&this.nativeDraggable&&(this.options.touchStartThreshold=4,m.draggable=!0),ae("delayStart",this,{evt:t}),c.delay&&(!c.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(dt||Te))){if(S.eventCanceled){this._onDrop();return}N(u,"mouseup",o._disableDelayedDrag),N(u,"touchend",o._disableDelayedDrag),N(u,"touchcancel",o._disableDelayedDrag),N(u,"mousemove",o._delayedDragTouchMoveHandler),N(u,"touchmove",o._delayedDragTouchMoveHandler),c.supportPointer&&N(u,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(f,c.delay)}else f()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){m&&vn(m),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;k(t,"mouseup",this._disableDelayedDrag),k(t,"touchend",this._disableDelayedDrag),k(t,"touchcancel",this._disableDelayedDrag),k(t,"mousemove",this._delayedDragTouchMoveHandler),k(t,"touchmove",this._delayedDragTouchMoveHandler),k(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?N(document,"pointermove",this._onTouchMove):e?N(document,"touchmove",this._onTouchMove):N(document,"mousemove",this._onTouchMove):(N(m,"dragend",this),N(H,"dragstart",this._onDragStart));try{document.selection?Pt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Ge=!1,H&&m){ae("dragStarted",this,{evt:e}),this.nativeDraggable&&N(document,"dragover",Wr);var i=this.options;!t&&de(m,i.dragClass,!1),de(m,i.ghostClass,!0),S.active=this,t&&this._appendGhost(),oe({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(ge){this._lastX=ge.clientX,this._lastY=ge.clientY,Di();for(var t=document.elementFromPoint(ge.clientX,ge.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ge.clientX,ge.clientY),t!==e);)e=t;if(m.parentNode[pe]._isOutsideThisEl(t),e)do{if(e[pe]){var i=void 0;if(i=e[pe]._onDragOver({clientX:ge.clientX,clientY:ge.clientY,target:t,rootEl:e}),i&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);wi()}},_onTouchMove:function(t){if(Ye){var e=this.options,i=e.fallbackTolerance,o=e.fallbackOffset,l=t.touches?t.touches[0]:t,c=x&&Ue(x,!0),u=x&&c&&c.a,f=x&&c&&c.d,p=At&&ee&&oi(ee),v=(l.clientX-Ye.clientX+o.x)/(u||1)+(p?p[0]-gn[0]:0)/(u||1),g=(l.clientY-Ye.clientY+o.y)/(f||1)+(p?p[1]-gn[1]:0)/(f||1);if(!S.active&&!Ge){if(i&&Math.max(Math.abs(l.clientX-this._lastX),Math.abs(l.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(x){c?(c.e+=v-(hn||0),c.f+=g-(mn||0)):c={a:1,b:0,c:0,d:1,e:v,f:g};var E="matrix(".concat(c.a,",").concat(c.b,",").concat(c.c,",").concat(c.d,",").concat(c.e,",").concat(c.f,")");C(x,"webkitTransform",E),C(x,"mozTransform",E),C(x,"msTransform",E),C(x,"transform",E),hn=v,mn=g,ge=l}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!x){var t=this.options.fallbackOnBody?document.body:H,e=U(m,!0,At,!0,t),i=this.options;if(At){for(ee=t;C(ee,"position")==="static"&&C(ee,"transform")==="none"&&ee!==document;)ee=ee.parentNode;ee!==document.body&&ee!==document.documentElement?(ee===document&&(ee=Ee()),e.top+=ee.scrollTop,e.left+=ee.scrollLeft):ee=Ee(),gn=oi(ee)}x=m.cloneNode(!0),de(x,i.ghostClass,!1),de(x,i.fallbackClass,!0),de(x,i.dragClass,!0),C(x,"transition",""),C(x,"transform",""),C(x,"box-sizing","border-box"),C(x,"margin",0),C(x,"top",e.top),C(x,"left",e.left),C(x,"width",e.width),C(x,"height",e.height),C(x,"opacity","0.8"),C(x,"position",At?"absolute":"fixed"),C(x,"zIndex","100000"),C(x,"pointerEvents","none"),S.ghost=x,t.appendChild(x),C(x,"transform-origin",ai/parseInt(x.style.width)*100+"% "+li/parseInt(x.style.height)*100+"%")}},_onDragStart:function(t,e){var i=this,o=t.dataTransfer,l=i.options;if(ae("dragStart",this,{evt:t}),S.eventCanceled){this._onDrop();return}ae("setupClone",this),S.eventCanceled||(R=gi(m),R.removeAttribute("id"),R.draggable=!1,R.style["will-change"]="",this._hideClone(),de(R,this.options.chosenClass,!1),S.clone=R),i.cloneId=Pt(function(){ae("clone",i),!S.eventCanceled&&(i.options.removeCloneOnHide||H.insertBefore(R,m),i._hideClone(),oe({sortable:i,name:"clone"}))}),!e&&de(m,l.dragClass,!0),e?(Yt=!0,i._loopId=setInterval(i._emulateDragOver,50)):(k(document,"mouseup",i._onDrop),k(document,"touchend",i._onDrop),k(document,"touchcancel",i._onDrop),o&&(o.effectAllowed="move",l.setData&&l.setData.call(i,o,m)),N(document,"drop",i),C(m,"transform","translateZ(0)")),Ge=!0,i._dragStartId=Pt(i._dragStarted.bind(i,e,t)),N(document,"selectstart",i),it=!0,at&&C(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,i=t.target,o,l,c,u=this.options,f=u.group,p=S.active,v=Tt===f,g=u.sort,E=Z||p,_,I=this,y=!1;if(wn)return;function B(Oe,wt){ae(Oe,I,Ce({evt:t,isOwner:v,axis:_?"vertical":"horizontal",revert:c,dragRect:o,targetRect:l,canSort:g,fromSortable:E,target:i,completed:P,onMove:function(ze,rn){return Ot(H,e,m,o,ze,U(ze),t,rn)},changed:q},wt))}function J(){B("dragOverAnimationCapture"),I.captureAnimationState(),I!==E&&E.captureAnimationState()}function P(Oe){return B("dragOverCompleted",{insertion:Oe}),Oe&&(v?p._hideClone():p._showClone(I),I!==E&&(de(m,Z?Z.options.ghostClass:p.options.ghostClass,!1),de(m,u.ghostClass,!0)),Z!==I&&I!==S.active?Z=I:I===S.active&&Z&&(Z=null),E===I&&(I._ignoreWhileAnimating=i),I.animateAll(function(){B("dragOverAnimationComplete"),I._ignoreWhileAnimating=null}),I!==E&&(E.animateAll(),E._ignoreWhileAnimating=null)),(i===m&&!m.animated||i===e&&!i.animated)&&(Xe=null),!u.dragoverBubble&&!t.rootEl&&i!==document&&(m.parentNode[pe]._isOutsideThisEl(t.target),!Oe&&je(t)),!u.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),y=!0}function q(){fe=he(m),ke=he(m,u.draggable),oe({sortable:I,name:"change",toEl:e,newIndex:fe,newDraggableIndex:ke,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),i=we(i,u.draggable,e,!0),B("dragOver"),S.eventCanceled)return y;if(m.contains(t.target)||i.animated&&i.animatingX&&i.animatingY||I._ignoreWhileAnimating===i)return P(!1);if(Yt=!1,p&&!u.disabled&&(v?g||(c=z!==H):Z===this||(this.lastPutMode=Tt.checkPull(this,p,m,t))&&f.checkPut(this,p,m,t))){if(_=this._getDirection(t,i)==="vertical",o=U(m),B("dragOverValid"),S.eventCanceled)return y;if(c)return z=H,J(),this._hideClone(),B("revert"),S.eventCanceled||(Re?H.insertBefore(m,Re):H.appendChild(m)),P(!0);var W=Mn(e,u.draggable);if(!W||Xr(t,_,this)&&!W.animated){if(W===m)return P(!1);if(W&&e===t.target&&(i=W),i&&(l=U(i)),Ot(H,e,m,o,i,l,t,!!i)!==!1)return J(),W&&W.nextSibling?e.insertBefore(m,W.nextSibling):e.appendChild(m),z=e,q(),P(!0)}else if(W&&Kr(t,_,this)){var re=Je(e,0,u,!0);if(re===m)return P(!1);if(i=re,l=U(i),Ot(H,e,m,o,i,l,t,!1)!==!1)return J(),e.insertBefore(m,re),z=e,q(),P(!0)}else if(i.parentNode===e){l=U(i);var A=0,Y,V=m.parentNode!==e,K=!Rr(m.animated&&m.toRect||o,i.animated&&i.toRect||l,_),me=_?"top":"left",ve=ri(i,"top","top")||ri(m,"top","top"),be=ve?ve.scrollTop:void 0;Xe!==i&&(Y=l[me],ut=!1,It=!K&&u.invertSwap||V),A=Gr(t,i,l,_,K?1:u.swapThreshold,u.invertedSwapThreshold==null?u.swapThreshold:u.invertedSwapThreshold,It,Xe===i);var Q;if(A!==0){var Se=he(m);do Se-=A,Q=z.children[Se];while(Q&&(C(Q,"display")==="none"||Q===x))}if(A===0||Q===i)return P(!1);Xe=i,ct=A;var Ae=i.nextElementSibling,ye=!1;ye=A===1;var We=Ot(H,e,m,o,i,l,t,ye);if(We!==!1)return(We===1||We===-1)&&(ye=We===1),wn=!0,setTimeout(qr,30),J(),ye&&!Ae?e.appendChild(m):i.parentNode.insertBefore(m,ye?Ae:i),ve&&mi(ve,0,be-ve.scrollTop),z=m.parentNode,Y!==void 0&&!It&&(Nt=Math.abs(Y-U(i)[me])),q(),P(!0)}if(e.contains(m))return P(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){k(document,"mousemove",this._onTouchMove),k(document,"touchmove",this._onTouchMove),k(document,"pointermove",this._onTouchMove),k(document,"dragover",je),k(document,"mousemove",je),k(document,"touchmove",je)},_offUpEvents:function(){var t=this.el.ownerDocument;k(t,"mouseup",this._onDrop),k(t,"touchend",this._onDrop),k(t,"pointerup",this._onDrop),k(t,"touchcancel",this._onDrop),k(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;if(fe=he(m),ke=he(m,i.draggable),ae("drop",this,{evt:t}),z=m&&m.parentNode,fe=he(m),ke=he(m,i.draggable),S.eventCanceled){this._nulling();return}Ge=!1,It=!1,ut=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),En(this.cloneId),En(this._dragStartId),this.nativeDraggable&&(k(document,"drop",this),k(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),at&&C(document.body,"user-select",""),C(m,"transform",""),t&&(it&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),x&&x.parentNode&&x.parentNode.removeChild(x),(H===z||Z&&Z.lastPutMode!=="clone")&&R&&R.parentNode&&R.parentNode.removeChild(R),m&&(this.nativeDraggable&&k(m,"dragend",this),vn(m),m.style["will-change"]="",it&&!Ge&&de(m,Z?Z.options.ghostClass:this.options.ghostClass,!1),de(m,this.options.chosenClass,!1),oe({sortable:this,name:"unchoose",toEl:z,newIndex:null,newDraggableIndex:null,originalEvent:t}),H!==z?(fe>=0&&(oe({rootEl:z,name:"add",toEl:z,fromEl:H,originalEvent:t}),oe({sortable:this,name:"remove",toEl:z,originalEvent:t}),oe({rootEl:z,name:"sort",toEl:z,fromEl:H,originalEvent:t}),oe({sortable:this,name:"sort",toEl:z,originalEvent:t})),Z&&Z.save()):fe!==$e&&fe>=0&&(oe({sortable:this,name:"update",toEl:z,originalEvent:t}),oe({sortable:this,name:"sort",toEl:z,originalEvent:t})),S.active&&((fe==null||fe===-1)&&(fe=$e,ke=st),oe({sortable:this,name:"end",toEl:z,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){ae("nulling",this),H=m=z=x=Re=R=Ft=Fe=Ye=ge=it=fe=ke=$e=st=Xe=ct=Z=Tt=S.dragged=S.ghost=S.clone=S.active=null,Rt.forEach(function(t){t.checked=!0}),Rt.length=hn=mn=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":m&&(this._onDragOver(t),zr(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,i=this.el.children,o=0,l=i.length,c=this.options;o<l;o++)e=i[o],we(e,c.draggable,this.el,!1)&&t.push(e.getAttribute(c.dataIdAttr)||Ur(e));return t},sort:function(t,e){var i={},o=this.el;this.toArray().forEach(function(l,c){var u=o.children[c];we(u,this.options.draggable,o,!1)&&(i[l]=u)},this),e&&this.captureAnimationState(),t.forEach(function(l){i[l]&&(o.removeChild(i[l]),o.appendChild(i[l]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return we(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var i=this.options;if(e===void 0)return i[t];var o=ft.modifyOption(this,t,e);typeof o<"u"?i[t]=o:i[t]=e,t==="group"&&yi(i)},destroy:function(){ae("destroy",this);var t=this.el;t[pe]=null,k(t,"mousedown",this._onTapStart),k(t,"touchstart",this._onTapStart),k(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(k(t,"dragover",this),k(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),jt.splice(jt.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Fe){if(ae("hideClone",this),S.eventCanceled)return;C(R,"display","none"),this.options.removeCloneOnHide&&R.parentNode&&R.parentNode.removeChild(R),Fe=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Fe){if(ae("showClone",this),S.eventCanceled)return;m.parentNode==H&&!this.options.group.revertClone?H.insertBefore(R,m):Re?H.insertBefore(R,Re):H.appendChild(R),this.options.group.revertClone&&this.animate(m,R),C(R,"display",""),Fe=!1}}};function zr(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function Ot(n,t,e,i,o,l,c,u){var f,p=n[pe],v=p.options.onMove,g;return window.CustomEvent&&!Te&&!dt?f=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(f=document.createEvent("Event"),f.initEvent("move",!0,!0)),f.to=t,f.from=n,f.dragged=e,f.draggedRect=i,f.related=o||t,f.relatedRect=l||U(t),f.willInsertAfter=u,f.originalEvent=c,n.dispatchEvent(f),v&&(g=v.call(p,f,c)),g}function vn(n){n.draggable=!1}function qr(){wn=!1}function Kr(n,t,e){var i=U(Je(e.el,0,e.options,!0)),o=10;return t?n.clientX<i.left-o||n.clientY<i.top&&n.clientX<i.right:n.clientY<i.top-o||n.clientY<i.bottom&&n.clientX<i.left}function Xr(n,t,e){var i=U(Mn(e.el,e.options.draggable)),o=10;return t?n.clientX>i.right+o||n.clientX<=i.right&&n.clientY>i.bottom&&n.clientX>=i.left:n.clientX>i.right&&n.clientY>i.top||n.clientX<=i.right&&n.clientY>i.bottom+o}function Gr(n,t,e,i,o,l,c,u){var f=i?n.clientY:n.clientX,p=i?e.height:e.width,v=i?e.top:e.left,g=i?e.bottom:e.right,E=!1;if(!c){if(u&&Nt<p*o){if(!ut&&(ct===1?f>v+p*l/2:f<g-p*l/2)&&(ut=!0),ut)E=!0;else if(ct===1?f<v+Nt:f>g-Nt)return-ct}else if(f>v+p*(1-o)/2&&f<g-p*(1-o)/2)return $r(t)}return E=E||c,E&&(f<v+p*l/2||f>g-p*l/2)?f>v+p/2?1:-1:0}function $r(n){return he(m)<he(n)?1:-1}function Ur(n){for(var t=n.tagName+n.className+n.src+n.href+n.textContent,e=t.length,i=0;e--;)i+=t.charCodeAt(e);return i.toString(36)}function Jr(n){Rt.length=0;for(var t=n.getElementsByTagName("input"),e=t.length;e--;){var i=t[e];i.checked&&Rt.push(i)}}function Pt(n){return setTimeout(n,0)}function En(n){return clearTimeout(n)}Wt&&N(document,"touchmove",function(n){(S.active||Ge)&&n.cancelable&&n.preventDefault()});S.utils={on:N,off:k,css:C,find:pi,is:function(t,e){return!!we(t,e,t,!1)},extend:kr,throttle:hi,closest:we,toggleClass:de,clone:gi,index:he,nextTick:Pt,cancelNextTick:En,detectDirection:bi,getChild:Je};S.get=function(n){return n[pe]};S.mount=function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];t[0].constructor===Array&&(t=t[0]),t.forEach(function(i){if(!i.prototype||!i.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(i));i.utils&&(S.utils=Ce(Ce({},S.utils),i.utils)),ft.mount(i)})};S.create=function(n,t){return new S(n,t)};S.version=Ir;var X=[],rt,Cn,Sn=!1,bn,yn,Bt,ot;function Vr(){function n(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return n.prototype={dragStarted:function(e){var i=e.originalEvent;this.sortable.nativeDraggable?N(document,"dragover",this._handleAutoScroll):this.options.supportPointer?N(document,"pointermove",this._handleFallbackAutoScroll):i.touches?N(document,"touchmove",this._handleFallbackAutoScroll):N(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var i=e.originalEvent;!this.options.dragOverBubble&&!i.rootEl&&this._handleAutoScroll(i)},drop:function(){this.sortable.nativeDraggable?k(document,"dragover",this._handleAutoScroll):(k(document,"pointermove",this._handleFallbackAutoScroll),k(document,"touchmove",this._handleFallbackAutoScroll),k(document,"mousemove",this._handleFallbackAutoScroll)),ci(),Lt(),Fr()},nulling:function(){Bt=Cn=rt=Sn=ot=bn=yn=null,X.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,i){var o=this,l=(e.touches?e.touches[0]:e).clientX,c=(e.touches?e.touches[0]:e).clientY,u=document.elementFromPoint(l,c);if(Bt=e,i||this.options.forceAutoScrollFallback||dt||Te||at){Dn(e,this.options,u,i);var f=Ne(u,!0);Sn&&(!ot||l!==bn||c!==yn)&&(ot&&ci(),ot=setInterval(function(){var p=Ne(document.elementFromPoint(l,c),!0);p!==f&&(f=p,Lt()),Dn(e,o.options,p,i)},10),bn=l,yn=c)}else{if(!this.options.bubbleScroll||Ne(u,!0)===Ee()){Lt();return}Dn(e,this.options,Ne(u,!1),!1)}}},xe(n,{pluginName:"scroll",initializeByDefault:!0})}function Lt(){X.forEach(function(n){clearInterval(n.pid)}),X=[]}function ci(){clearInterval(ot)}var Dn=hi(function(n,t,e,i){if(t.scroll){var o=(n.touches?n.touches[0]:n).clientX,l=(n.touches?n.touches[0]:n).clientY,c=t.scrollSensitivity,u=t.scrollSpeed,f=Ee(),p=!1,v;Cn!==e&&(Cn=e,Lt(),rt=t.scroll,v=t.scrollFn,rt===!0&&(rt=Ne(e,!0)));var g=0,E=rt;do{var _=E,I=U(_),y=I.top,B=I.bottom,J=I.left,P=I.right,q=I.width,W=I.height,re=void 0,A=void 0,Y=_.scrollWidth,V=_.scrollHeight,K=C(_),me=_.scrollLeft,ve=_.scrollTop;_===f?(re=q<Y&&(K.overflowX==="auto"||K.overflowX==="scroll"||K.overflowX==="visible"),A=W<V&&(K.overflowY==="auto"||K.overflowY==="scroll"||K.overflowY==="visible")):(re=q<Y&&(K.overflowX==="auto"||K.overflowX==="scroll"),A=W<V&&(K.overflowY==="auto"||K.overflowY==="scroll"));var be=re&&(Math.abs(P-o)<=c&&me+q<Y)-(Math.abs(J-o)<=c&&!!me),Q=A&&(Math.abs(B-l)<=c&&ve+W<V)-(Math.abs(y-l)<=c&&!!ve);if(!X[g])for(var Se=0;Se<=g;Se++)X[Se]||(X[Se]={});(X[g].vx!=be||X[g].vy!=Q||X[g].el!==_)&&(X[g].el=_,X[g].vx=be,X[g].vy=Q,clearInterval(X[g].pid),(be!=0||Q!=0)&&(p=!0,X[g].pid=setInterval(function(){i&&this.layer===0&&S.active._onTouchMove(Bt);var Ae=X[this.layer].vy?X[this.layer].vy*u:0,ye=X[this.layer].vx?X[this.layer].vx*u:0;typeof v=="function"&&v.call(S.dragged.parentNode[pe],ye,Ae,n,Bt,X[this.layer].el)!=="continue"||mi(X[this.layer].el,ye,Ae)}.bind({layer:g}),24))),g++}while(t.bubbleScroll&&E!==f&&(E=Ne(E,!1)));Sn=p}},30),Ei=function(t){var e=t.originalEvent,i=t.putSortable,o=t.dragEl,l=t.activeSortable,c=t.dispatchSortableEvent,u=t.hideGhostForTarget,f=t.unhideGhostForTarget;if(e){var p=i||l;u();var v=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,g=document.elementFromPoint(v.clientX,v.clientY);f(),p&&!p.el.contains(g)&&(c("spill"),this.onSpill({dragEl:o,putSortable:i}))}};function _n(){}_n.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var o=Je(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(e,o):this.sortable.el.appendChild(e),this.sortable.animateAll(),i&&i.animateAll()},drop:Ei};xe(_n,{pluginName:"revertOnSpill"});function xn(){}xn.prototype={onSpill:function(t){var e=t.dragEl,i=t.putSortable,o=i||this.sortable;o.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),o.animateAll()},drop:Ei};xe(xn,{pluginName:"removeOnSpill"});S.mount(new Vr);S.mount(xn,_n);var zt=S;function Zr(n){return new Promise((t,e)=>{n.onload=()=>{if(n.status>=200&&n.status<400)try{t({data:JSON.parse(n.responseText),status:n.status})}catch(i){e(i)}else try{e(JSON.parse(n.responseText))}catch(i){e(i)}},n.onerror=()=>{e(new Error("An error occurred during the transaction"))}})}function Qr(){return document.querySelector('meta[name="csrf-token"]').attributes.content.textContent}function qt(n,t){return Tn("GET",n,t)}function Be(n,t){return Tn("PATCH",n,t)}function Tn(n,t,e){let i=new XMLHttpRequest,o=Zr(i),l=new URL(window.location.origin+t);return e&&n.toLowerCase()==="get"&&(l.search=new URLSearchParams(e).toString()),i.open(n,l.toString()),i.setRequestHeader("Content-type","application/json; charset=utf-8"),i.setRequestHeader("Accept","application/json"),i.setRequestHeader("X-CSRF-Token",Qr()),e&&n.toLowerCase()!=="get"?i.send(JSON.stringify(e)):i.send(),o}function Kt(n,t,e,i){document.querySelectorAll(t).forEach(o=>{o.addEventListener(n,l=>{let c=Array.from(o.querySelectorAll(e)),u=l.target;for(;u!==o;){if(c.includes(u)){i.call(u,l);return}u=u.parentElement}})})}function In(){document.querySelectorAll("li.menu-item").forEach(n=>{let t=n.querySelector(".nodes_tree-left_images"),e=n.querySelector(".children"),i={folded:n.dataset.folded==="true",id:n.dataset.id,type:n.dataset.type};e.children.length>0||i.folded?t.innerHTML=HandlebarsTemplates.node_folder({node:i}):t.innerHTML=" "})}function eo(n){let t=Alchemy.routes[n.item.dataset.type].move_api_path(n.item.dataset.id),e={target_parent_id:n.to.dataset.recordId,new_position:n.newIndex};Be(t,e).then(()=>{let i=Alchemy.t("Successfully moved menu item");Alchemy.growl(i),In()}).catch(i=>{Alchemy.growl(i.message||i,"error")})}function to(){Kt("click",".nodes_tree",".node_folder",function(){let n=this.dataset.recordId,t=this.closest("li.menu-item"),e=Alchemy.routes[this.dataset.recordType].toggle_folded_api_path(n),i=t.querySelector(".children");Be(e).then(()=>{i.classList.toggle("folded"),t.dataset.folded=t.dataset.folded=="true"?"false":"true",In()}).catch(o=>{Alchemy.growl(o.message||o)})})}function An(){to(),In(),document.querySelectorAll(".nodes_tree ul.children").forEach(n=>{new zt(n,{group:"nodes",animation:150,fallbackOnBody:!0,swapThreshold:.65,handle:".node_name",invertSwap:!0,onEnd:eo})})}var On=class{constructor(t){this.container=t,this.deleteLink=t.querySelector(".remove_file_link"),this.fileIcon=t.querySelector(".file_icon"),this.fileName=t.querySelector(".file_name"),this.deleteLink.addEventListener("click",this.removeFile.bind(this)),this.formFieldId=this.deleteLink.dataset.formFieldId,this.formField=t.querySelector(`#${this.formFieldId}`),this.assignFileText=this.deleteLink.dataset.assignFileText}removeFile(t){return t.stopPropagation(),this.formField.value="",this.fileIcon.innerHTML="",this.fileName.innerHTML="",this.deleteLink.classList.add("hidden"),Alchemy.setElementDirty(this.container.closest(".element-editor")),!1}};function kn(n){document.querySelectorAll(n).forEach(t=>{new On(t)})}var pt=class{static updateIcon(t,e=!1){let i=document.querySelector(`[data-ingredient-id="${t}"]`);if(i){let o=i.querySelector(".edit-ingredient-anchor-link > a > .icon");o&&(e?o.classList.replace("far","fas"):o.classList.replace("fas","far"))}}};function no(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}var ht=no;var io=typeof global=="object"&&global&&global.Object===Object&&global,Ci=io;var ro=typeof self=="object"&&self&&self.Object===Object&&self,oo=Ci||ro||Function("return this")(),Xt=oo;var ao=function(){return Xt.Date.now()},Gt=ao;var lo=/\s/;function so(n){for(var t=n.length;t--&&lo.test(n.charAt(t)););return t}var Si=so;var co=/^\s+/;function uo(n){return n&&n.slice(0,Si(n)+1).replace(co,"")}var Mi=uo;var fo=Xt.Symbol,Ve=fo;var _i=Object.prototype,po=_i.hasOwnProperty,ho=_i.toString,mt=Ve?Ve.toStringTag:void 0;function mo(n){var t=po.call(n,mt),e=n[mt];try{n[mt]=void 0;var i=!0}catch{}var o=ho.call(n);return i&&(t?n[mt]=e:delete n[mt]),o}var xi=mo;var go=Object.prototype,vo=go.toString;function bo(n){return vo.call(n)}var Ti=bo;var yo="[object Null]",Do="[object Undefined]",Ii=Ve?Ve.toStringTag:void 0;function wo(n){return n==null?n===void 0?Do:yo:Ii&&Ii in Object(n)?xi(n):Ti(n)}var Ai=wo;function Eo(n){return n!=null&&typeof n=="object"}var Oi=Eo;var Co="[object Symbol]";function So(n){return typeof n=="symbol"||Oi(n)&&Ai(n)==Co}var $t=So;var ki=0/0,Mo=/^[-+]0x[0-9a-f]+$/i,_o=/^0b[01]+$/i,xo=/^0o[0-7]+$/i,To=parseInt;function Io(n){if(typeof n=="number")return n;if($t(n))return ki;if(ht(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=ht(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=Mi(n);var e=_o.test(n);return e||xo.test(n)?To(n.slice(2),e?2:8):Mo.test(n)?ki:+n}var Fn=Io;var Ao="Expected a function",Oo=Math.max,ko=Math.min;function Fo(n,t,e){var i,o,l,c,u,f,p=0,v=!1,g=!1,E=!0;if(typeof n!="function")throw new TypeError(Ao);t=Fn(t)||0,ht(e)&&(v=!!e.leading,g="maxWait"in e,l=g?Oo(Fn(e.maxWait)||0,t):l,E="trailing"in e?!!e.trailing:E);function _(A){var Y=i,V=o;return i=o=void 0,p=A,c=n.apply(V,Y),c}function I(A){return p=A,u=setTimeout(J,t),v?_(A):c}function y(A){var Y=A-f,V=A-p,K=t-Y;return g?ko(K,l-V):K}function B(A){var Y=A-f,V=A-p;return f===void 0||Y>=t||Y<0||g&&V>=l}function J(){var A=Gt();if(B(A))return P(A);u=setTimeout(J,y(A))}function P(A){return u=void 0,E&&i?_(A):(i=o=void 0,c)}function q(){u!==void 0&&clearTimeout(u),p=0,i=f=o=u=void 0}function W(){return u===void 0?c:P(Gt())}function re(){var A=Gt(),Y=B(A);if(i=arguments,o=this,f=A,Y){if(u===void 0)return I(f);if(g)return clearTimeout(u),u=setTimeout(J,t),_(f)}return u===void 0&&(u=setTimeout(J,t)),c}return re.cancel=q,re.flush=W,re}var Fi=Fo;function No(n,t,e){for(var i=-1,o=n.length;++i<o;){var l=n[i],c=t(l);if(c!=null&&(u===void 0?c===c&&!$t(c):e(c,u)))var u=c,f=l}return f}var Ni=No;function Po(n,t){return n>t}var Pi=Po;function Lo(n){return n}var Li=Lo;function Ho(n){return n&&n.length?Ni(n,Li,Pi):void 0}var Hi=Ho;var Yi={fill:"#fff"},Pe=class n{static init(t=document,e=Yi){typeof t=="string"&&(t=document.querySelector(t)),t.querySelectorAll("img").forEach(i=>{new n(i,e).load()})}constructor(t,e=Yi){this.image=t,this.parent=t.parentNode,this.spinner=new Alchemy.Spinner("small",e),this.bind()}bind(){this.image.addEventListener("load",this.onLoaded.bind(this)),this.image.addEventListener("error",this.onError.bind(this))}load(t=!1){!t&&this.image.complete||(this.image.classList.add("loading"),this.spinner.spin(this.image.parentElement))}onLoaded(){this.removeSpinner(),this.image.classList.remove("loading"),this.unbind()}onError(t){let e=`Could not load "${this.image.src}"`;this.removeSpinner(),this.parent.innerHTML=`<span class="icon error fas fa-exclamation-triangle" title="${e}" />`,console.error(e,t),this.unbind()}unbind(){this.image.removeEventListener("load",this.onLoaded),this.image.removeEventListener("error",this.onError)}removeSpinner(){this.parent.querySelectorAll(".spinner").forEach(t=>{t.remove()})}};var Yo=125,jo='<i class="icon far fa-image fa-fw"></i>',Ro="160x120",Nn=class{constructor(t){this.container=t,this.cropFromField=t.querySelector("[data-crop-from]"),this.cropSizeField=t.querySelector("[data-crop-size]"),this.pictureIdField=t.querySelector("[data-picture-id]"),this.targetSizeField=t.querySelector("[data-target-size]"),this.imageCropperField=t.querySelector("[data-image-cropper]"),this.image=t.querySelector("img"),this.thumbnailBackground=t.querySelector(".thumbnail_background"),this.deleteButton=t.querySelector(".picture_tool.delete"),this.cropLink=t.querySelector(".crop_link"),this.targetSize=this.targetSizeField.dataset.targetSize,this.pictureId=this.pictureIdField.value,this.image&&(this.imageLoader=new Pe(this.image)),this.update=Fi(()=>{this.updateImage(),this.updateCropLink()},Yo),this.deleteButton.addEventListener("click",this.removeImage.bind(this))}observe(){let t=new MutationObserver(this.mutationCallback.bind(this));t.observe(this.cropFromField,{attributes:!0}),t.observe(this.cropSizeField,{attributes:!0}),t.observe(this.pictureIdField,{attributes:!0})}mutationCallback(t){for(let e of t)"pictureId"in e.target.dataset&&(this.cropFromField.value="",this.cropSizeField.value="",this.pictureId=e.target.value),this.update()}updateImage(){this.pictureId&&(this.ensureImage(),this.image.removeAttribute("alt"),this.image.removeAttribute("src"),this.imageLoader.load(!0),qt(Alchemy.routes.url_admin_picture_path(this.pictureId),{crop:this.imageCropperEnabled,crop_from:this.cropFrom,crop_size:this.cropSize,flatten:!0,size:Ro}).then(({data:t})=>{this.image.src=t.url,this.image.alt=t.alt,this.image.title=t.title}).catch(t=>{console.error(t.message||t),Alchemy.growl(t.message||t,"error")}))}ensureImage(){if(this.image)return;let t=new Image;this.thumbnailBackground.replaceChildren(t),this.image=t,this.imageLoader=new Pe(t)}removeImage(){this.thumbnailBackground.innerHTML=jo,this.pictureIdField.value="",this.image=null,this.cropLink.classList.add("disabled"),Alchemy.setElementDirty(this.container.closest(".element-editor"))}updateCropLink(){!this.pictureId||!this.imageCropperEnabled||(this.cropLink.classList.remove("disabled"),this.cropLink.href.match(/(picture_id=)\d+/)?this.cropLink.href=this.cropLink.href.replace(/(picture_id=)\d+/,"$1"+this.pictureId):this.cropLink.href=this.cropLink.href+`&picture_id=${this.pictureId}`)}get cropFrom(){return this.cropFromField.value===""?this.defaultCropFrom.join("x"):this.cropFromField.value}get cropSize(){return this.cropSizeField.value===""?this.defaultCropSize.join("x"):this.cropSizeField.value}get defaultCropSize(){if(!this.imageCropperEnabled)return[];let t=this.targetSize.split("x").map(i=>parseInt(i)),e=Hi([t[0]/this.imageFileWidth,t[1]/this.imageFileHeight]);return[Math.round(t[0]/e),Math.round(t[1]/e)]}get defaultCropFrom(){if(!this.imageCropperEnabled)return[];let t=this.defaultCropSize;return[Math.round((this.imageFileWidth-t[0])/2),Math.round((this.imageFileHeight-t[1])/2)]}get imageFileWidth(){return parseInt(this.pictureIdField.dataset.imageFileWidth)}get imageFileHeight(){return parseInt(this.pictureIdField.dataset.imageFileHeight)}get imageCropperEnabled(){return this.targetSizeField.dataset.imageCropper==="true"}};function Pn(n){document.querySelectorAll(n).forEach(t=>{new Nn(t).observe()})}var gt=class{constructor(t,e,i,o,l,c){this.initialized=!1,this.minSize=t,this.defaultBox=e,this.aspectRatio=i,this.trueSize=o,this.cropFromField=document.getElementById(l[0]),this.cropSizeField=document.getElementById(l[1]),this.elementId=c,this.dialog=Alchemy.currentDialog(),this.dialog.options.closed=this.destroy,this.init(),this.bind()}get jcropOptions(){return{onSelect:this.update.bind(this),setSelect:this.box,aspectRatio:this.aspectRatio,minSize:this.minSize,boxWidth:800,boxHeight:600,trueSize:this.trueSize,closed:this.destroy.bind(this)}}get cropFrom(){if(this.cropFromField.value)return this.cropFromField.value.split("x").map(t=>parseInt(t))}get cropSize(){if(this.cropSizeField.value)return this.cropSizeField.value.split("x").map(t=>parseInt(t))}get box(){return this.cropFrom&&this.cropSize?[this.cropFrom[0],this.cropFrom[1],this.cropFrom[0]+this.cropSize[0],this.cropFrom[1]+this.cropSize[1]]:this.defaultBox}init(){this.initialized||(this.api=$.Jcrop("#imageToCrop",this.jcropOptions),this.initialized=!0)}update(t){this.cropFromField.value=Math.round(t.x)+"x"+Math.round(t.y),this.cropFromField.dispatchEvent(new Event("change")),this.cropSizeField.value=Math.round(t.w)+"x"+Math.round(t.h),this.cropFromField.dispatchEvent(new Event("change"))}reset(){this.api.setSelect(this.defaultBox),this.cropFromField.value=`${this.box[0]}x${this.box[1]}`,this.cropSizeField.value=`${this.box[2]}x${this.box[3]-this.box[1]}`}destroy(){return this.api&&this.api.destroy(),this.initialized=!1,!0}bind(){this.dialog.dialog_body.find('button[type="submit"]').click(()=>(Alchemy.setElementDirty(`[data-element-id='${this.elementId}']`),this.dialog.close(),!1)),this.dialog.dialog_body.find('button[type="reset"]').click(()=>(this.reset(),!1))}};var Ut=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Le={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var t=new Date(n.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var e=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var Jt={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var t=n%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Vt=Jt;var te=function(n,t){return t===void 0&&(t=2),("000"+n).slice(t*-1)},le=function(n){return n===!0?1:0};function Ln(n,t){var e;return function(){var i=this,o=arguments;clearTimeout(e),e=setTimeout(function(){return n.apply(i,o)},t)}}var Zt=function(n){return n instanceof Array?n:[n]};function ne(n,t,e){if(e===!0)return n.classList.add(t);n.classList.remove(t)}function F(n,t,e){var i=window.document.createElement(n);return t=t||"",e=e||"",i.className=t,e!==void 0&&(i.textContent=e),i}function vt(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Hn(n,t){if(t(n))return n;if(n.parentNode)return Hn(n.parentNode,t)}function bt(n,t){var e=F("div","numInputWrapper"),i=F("input","numInput "+n),o=F("span","arrowUp"),l=F("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),t!==void 0)for(var c in t)i.setAttribute(c,t[c]);return e.appendChild(i),e.appendChild(o),e.appendChild(l),e}function se(n){try{if(typeof n.composedPath=="function"){var t=n.composedPath();return t[0]}return n.target}catch{return n.target}}var Yn=function(){},yt=function(n,t,e){return e.months[t?"shorthand":"longhand"][n]},ji={D:Yn,F:function(n,t,e){n.setMonth(e.months.longhand.indexOf(t))},G:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},H:function(n,t){n.setHours(parseFloat(t))},J:function(n,t){n.setDate(parseFloat(t))},K:function(n,t,e){n.setHours(n.getHours()%12+12*le(new RegExp(e.amPM[1],"i").test(t)))},M:function(n,t,e){n.setMonth(e.months.shorthand.indexOf(t))},S:function(n,t){n.setSeconds(parseFloat(t))},U:function(n,t){return new Date(parseFloat(t)*1e3)},W:function(n,t,e){var i=parseInt(t),o=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return o.setDate(o.getDate()-o.getDay()+e.firstDayOfWeek),o},Y:function(n,t){n.setFullYear(parseFloat(t))},Z:function(n,t){return new Date(t)},d:function(n,t){n.setDate(parseFloat(t))},h:function(n,t){n.setHours((n.getHours()>=12?12:0)+parseFloat(t))},i:function(n,t){n.setMinutes(parseFloat(t))},j:function(n,t){n.setDate(parseFloat(t))},l:Yn,m:function(n,t){n.setMonth(parseFloat(t)-1)},n:function(n,t){n.setMonth(parseFloat(t)-1)},s:function(n,t){n.setSeconds(parseFloat(t))},u:function(n,t){return new Date(parseFloat(t))},w:Yn,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},Ie={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Ze={Z:function(n){return n.toISOString()},D:function(n,t,e){return t.weekdays.shorthand[Ze.w(n,t,e)]},F:function(n,t,e){return yt(Ze.n(n,t,e)-1,!1,t)},G:function(n,t,e){return te(Ze.h(n,t,e))},H:function(n){return te(n.getHours())},J:function(n,t){return t.ordinal!==void 0?n.getDate()+t.ordinal(n.getDate()):n.getDate()},K:function(n,t){return t.amPM[le(n.getHours()>11)]},M:function(n,t){return yt(n.getMonth(),!0,t)},S:function(n){return te(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,e){return e.getWeek(n)},Y:function(n){return te(n.getFullYear(),4)},d:function(n){return te(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return te(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return te(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}};var jn=function(n){var t=n.config,e=t===void 0?Le:t,i=n.l10n,o=i===void 0?Jt:i,l=n.isMobile,c=l===void 0?!1:l;return function(u,f,p){var v=p||o;return e.formatDate!==void 0&&!c?e.formatDate(u,f,v):f.split("").map(function(g,E,_){return Ze[g]&&_[E-1]!=="\\"?Ze[g](u,v,e):g!=="\\"?g:""}).join("")}},Qt=function(n){var t=n.config,e=t===void 0?Le:t,i=n.l10n,o=i===void 0?Jt:i;return function(l,c,u,f){if(!(l!==0&&!l)){var p=f||o,v,g=l;if(l instanceof Date)v=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)v=new Date(l);else if(typeof l=="string"){var E=c||(e||Le).dateFormat,_=String(l).trim();if(_==="today")v=new Date,u=!0;else if(e&&e.parseDate)v=e.parseDate(l,E);else if(/Z$/.test(_)||/GMT$/.test(_))v=new Date(l);else{for(var I=void 0,y=[],B=0,J=0,P="";B<E.length;B++){var q=E[B],W=q==="\\",re=E[B-1]==="\\"||W;if(Ie[q]&&!re){P+=Ie[q];var A=new RegExp(P).exec(l);A&&(I=!0)&&y[q!=="Y"?"push":"unshift"]({fn:ji[q],val:A[++J]})}else W||(P+=".")}v=!e||!e.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),y.forEach(function(Y){var V=Y.fn,K=Y.val;return v=V(v,K,p)||v}),v=I?v:void 0}}if(!(v instanceof Date&&!isNaN(v.getTime()))){e.errorHandler(new Error("Invalid date provided: "+g));return}return u===!0&&v.setHours(0,0,0,0),v}}};function ce(n,t,e){return e===void 0&&(e=!0),e!==!1?new Date(n.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):n.getTime()-t.getTime()}var Ri=function(n,t,e){return n>Math.min(t,e)&&n<Math.max(t,e)},en=function(n,t,e){return n*3600+t*60+e},Bi=function(n){var t=Math.floor(n/3600),e=(n-t*3600)/60;return[t,e,n-t*3600-e*60]},Wi={DAY:864e5};function tn(n){var t=n.defaultHour,e=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var o=n.minDate.getHours(),l=n.minDate.getMinutes(),c=n.minDate.getSeconds();t<o&&(t=o),t===o&&e<l&&(e=l),t===o&&e===l&&i<c&&(i=n.minDate.getSeconds())}if(n.maxDate!==void 0){var u=n.maxDate.getHours(),f=n.maxDate.getMinutes();t=Math.min(t,u),t===u&&(e=Math.min(f,e)),t===u&&e===f&&(i=n.maxDate.getSeconds())}return{hours:t,minutes:e,seconds:i}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=function(u){u&&Object.keys(u).forEach(function(f){return n[f]=u[f]})},o=0,l=t;o<l.length;o++){var c=l[o];i(c)}return n});var ie=function(){return ie=Object.assign||function(n){for(var t,e=1,i=arguments.length;e<i;e++){t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},ie.apply(this,arguments)},zi=function(){for(var n=0,t=0,e=arguments.length;t<e;t++)n+=arguments[t].length;for(var i=Array(n),o=0,t=0;t<e;t++)for(var l=arguments[t],c=0,u=l.length;c<u;c++,o++)i[o]=l[c];return i},Bo=300;function Wo(n,t){var e={config:ie(ie({},Le),G.defaultConfig),l10n:Vt};e.parseDate=Qt({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=y,e._setHoursFromDate=E,e._positionCalendar=Mt,e.changeMonth=ze,e.changeYear=Et,e.clear=rn,e.close=Ui,e.onMouseOver=St,e._createElement=F,e.createDay=A,e.destroy=Ji,e.isEnabled=He,e.jumpToDate=P,e.updateValue=Me,e.open=Qi,e.redraw=$n,e.set=ir,e.setDate=rr,e.toggle=sr;function i(){e.utils={getDaysInMonth:function(r,a){return r===void 0&&(r=e.currentMonth),a===void 0&&(a=e.currentYear),r===1&&(a%4===0&&a%100!==0||a%400===0)?29:e.l10n.daysInMonth[r]}}}function o(){e.element=e.input=n,e.isOpen=!1,er(),Gn(),ar(),or(),i(),e.isMobile||re(),J(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&E(e.config.noCalendar?e.latestSelectedDateObj:void 0),Me(!1)),u();var r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&r&&Mt(),j("onReady")}function l(){var r;return((r=e.calendarContainer)===null||r===void 0?void 0:r.getRootNode()).activeElement||document.activeElement}function c(r){return r.bind(e)}function u(){var r=e.config;r.weekNumbers===!1&&r.showMonths===1||r.noCalendar!==!0&&window.requestAnimationFrame(function(){if(e.calendarContainer!==void 0&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),e.daysContainer!==void 0){var a=(e.days.offsetWidth+1)*r.showMonths;e.daysContainer.style.width=a+"px",e.calendarContainer.style.width=a+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function f(r){if(e.selectedDates.length===0){var a=e.config.minDate===void 0||ce(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),s=tn(e.config);a.setHours(s.hours,s.minutes,s.seconds,a.getMilliseconds()),e.selectedDates=[a],e.latestSelectedDateObj=a}r!==void 0&&r.type!=="blur"&&dr(r);var d=e._input.value;g(),Me(),e._input.value!==d&&e._debouncedChange()}function p(r,a){return r%12+12*le(a===e.l10n.amPM[1])}function v(r){switch(r%24){case 0:case 12:return 12;default:return r%12}}function g(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var r=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(e.minuteElement.value,10)||0)%60,s=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(r=p(r,e.amPM.textContent));var d=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&ce(e.latestSelectedDateObj,e.config.minDate,!0)===0,h=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&ce(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var b=en(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),T=en(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),w=en(r,a,s);if(w>T&&w<b){var O=Bi(b);r=O[0],a=O[1],s=O[2]}}else{if(h){var D=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;r=Math.min(r,D.getHours()),r===D.getHours()&&(a=Math.min(a,D.getMinutes())),a===D.getMinutes()&&(s=Math.min(s,D.getSeconds()))}if(d){var M=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;r=Math.max(r,M.getHours()),r===M.getHours()&&a<M.getMinutes()&&(a=M.getMinutes()),a===M.getMinutes()&&(s=Math.max(s,M.getSeconds()))}}_(r,a,s)}}function E(r){var a=r||e.latestSelectedDateObj;a&&a instanceof Date&&_(a.getHours(),a.getMinutes(),a.getSeconds())}function _(r,a,s){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(r%24,a,s||0,0),!(!e.hourElement||!e.minuteElement||e.isMobile)&&(e.hourElement.value=te(e.config.time_24hr?r:(12+r)%12+12*le(r%12===0)),e.minuteElement.value=te(a),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[le(r>=12)]),e.secondElement!==void 0&&(e.secondElement.value=te(s)))}function I(r){var a=se(r),s=parseInt(a.value)+(r.delta||0);(s/1e3>1||r.key==="Enter"&&!/[^\d]/.test(s.toString()))&&Et(s)}function y(r,a,s,d){if(a instanceof Array)return a.forEach(function(h){return y(r,h,s,d)});if(r instanceof Array)return r.forEach(function(h){return y(h,a,s,d)});r.addEventListener(a,s,d),e._handlers.push({remove:function(){return r.removeEventListener(a,s,d)}})}function B(){j("onChange")}function J(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(s){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+s+"]"),function(d){return y(d,"click",e[s])})}),e.isMobile){lr();return}var r=Ln(Zi,50);if(e._debouncedChange=Ln(B,Bo),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&y(e.daysContainer,"mouseover",function(s){e.config.mode==="range"&&St(se(s))}),y(e._input,"keydown",qn),e.calendarContainer!==void 0&&y(e.calendarContainer,"keydown",qn),!e.config.inline&&!e.config.static&&y(window,"resize",r),window.ontouchstart!==void 0?y(window.document,"touchstart",on):y(window.document,"mousedown",on),y(window.document,"focus",on,{capture:!0}),e.config.clickOpens===!0&&(y(e._input,"focus",e.open),y(e._input,"click",e.open)),e.daysContainer!==void 0&&(y(e.monthNav,"click",ur),y(e.monthNav,["keyup","increment"],I),y(e.daysContainer,"click",Un)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var a=function(s){return se(s).select()};y(e.timeContainer,["increment"],f),y(e.timeContainer,"blur",f,{capture:!0}),y(e.timeContainer,"click",q),y([e.hourElement,e.minuteElement],["focus","click"],a),e.secondElement!==void 0&&y(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&y(e.amPM,"click",function(s){f(s)})}e.config.allowInput&&y(e._input,"blur",Vi)}function P(r,a){var s=r!==void 0?e.parseDate(r):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),d=e.currentYear,h=e.currentMonth;try{s!==void 0&&(e.currentYear=s.getFullYear(),e.currentMonth=s.getMonth())}catch(b){b.message="Invalid date supplied: "+s,e.config.errorHandler(b)}a&&e.currentYear!==d&&(j("onYearChange"),Q()),a&&(e.currentYear!==d||e.currentMonth!==h)&&j("onMonthChange"),e.redraw()}function q(r){var a=se(r);~a.className.indexOf("arrow")&&W(r,a.classList.contains("arrowUp")?1:-1)}function W(r,a,s){var d=r&&se(r),h=s||d&&d.parentNode&&d.parentNode.firstChild,b=ln("increment");b.delta=a,h&&h.dispatchEvent(b)}function re(){var r=window.document.createDocumentFragment();if(e.calendarContainer=F("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(r.appendChild(ye()),e.innerContainer=F("div","flatpickr-innerContainer"),e.config.weekNumbers){var a=zn(),s=a.weekWrapper,d=a.weekNumbers;e.innerContainer.appendChild(s),e.weekNumbers=d,e.weekWrapper=s}e.rContainer=F("div","flatpickr-rContainer"),e.rContainer.appendChild(Oe()),e.daysContainer||(e.daysContainer=F("div","flatpickr-days"),e.daysContainer.tabIndex=-1),be(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),r.appendChild(e.innerContainer)}e.config.enableTime&&r.appendChild(We()),ne(e.calendarContainer,"rangeMode",e.config.mode==="range"),ne(e.calendarContainer,"animate",e.config.animate===!0),ne(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(r);var h=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!h&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var b=F("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(b,e.element),b.appendChild(e.element),e.altInput&&b.appendChild(e.altInput),b.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function A(r,a,s,d){var h=He(a,!0),b=F("span",r,a.getDate().toString());return b.dateObj=a,b.$i=d,b.setAttribute("aria-label",e.formatDate(a,e.config.ariaDateFormat)),r.indexOf("hidden")===-1&&ce(a,e.now)===0&&(e.todayDateElem=b,b.classList.add("today"),b.setAttribute("aria-current","date")),h?(b.tabIndex=-1,sn(a)&&(b.classList.add("selected"),e.selectedDateElem=b,e.config.mode==="range"&&(ne(b,"startRange",e.selectedDates[0]&&ce(a,e.selectedDates[0],!0)===0),ne(b,"endRange",e.selectedDates[1]&&ce(a,e.selectedDates[1],!0)===0),r==="nextMonthDay"&&b.classList.add("inRange")))):b.classList.add("flatpickr-disabled"),e.config.mode==="range"&&cr(a)&&!sn(a)&&b.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&r!=="prevMonthDay"&&d%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(a)+"</span>"),j("onDayCreate",b),b}function Y(r){r.focus(),e.config.mode==="range"&&St(r)}function V(r){for(var a=r>0?0:e.config.showMonths-1,s=r>0?e.config.showMonths:-1,d=a;d!=s;d+=r)for(var h=e.daysContainer.children[d],b=r>0?0:h.children.length-1,T=r>0?h.children.length:-1,w=b;w!=T;w+=r){var O=h.children[w];if(O.className.indexOf("hidden")===-1&&He(O.dateObj))return O}}function K(r,a){for(var s=r.className.indexOf("Month")===-1?r.dateObj.getMonth():e.currentMonth,d=a>0?e.config.showMonths:-1,h=a>0?1:-1,b=s-e.currentMonth;b!=d;b+=h)for(var T=e.daysContainer.children[b],w=s-e.currentMonth===b?r.$i+a:a<0?T.children.length-1:0,O=T.children.length,D=w;D>=0&&D<O&&D!=(a>0?O:-1);D+=h){var M=T.children[D];if(M.className.indexOf("hidden")===-1&&He(M.dateObj)&&Math.abs(r.$i-D)>=Math.abs(a))return Y(M)}e.changeMonth(h),me(V(h),0)}function me(r,a){var s=l(),d=Ct(s||document.body),h=r!==void 0?r:d?s:e.selectedDateElem!==void 0&&Ct(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&Ct(e.todayDateElem)?e.todayDateElem:V(a>0?1:-1);h===void 0?e._input.focus():d?K(h,a):Y(h)}function ve(r,a){for(var s=(new Date(r,a,1).getDay()-e.l10n.firstDayOfWeek+7)%7,d=e.utils.getDaysInMonth((a-1+12)%12,r),h=e.utils.getDaysInMonth(a,r),b=window.document.createDocumentFragment(),T=e.config.showMonths>1,w=T?"prevMonthDay hidden":"prevMonthDay",O=T?"nextMonthDay hidden":"nextMonthDay",D=d+1-s,M=0;D<=d;D++,M++)b.appendChild(A("flatpickr-day "+w,new Date(r,a-1,D),D,M));for(D=1;D<=h;D++,M++)b.appendChild(A("flatpickr-day",new Date(r,a,D),D,M));for(var L=h+1;L<=42-s&&(e.config.showMonths===1||M%7!==0);L++,M++)b.appendChild(A("flatpickr-day "+O,new Date(r,a+1,L%h),L,M));var De=F("div","dayContainer");return De.appendChild(b),De}function be(){if(e.daysContainer!==void 0){vt(e.daysContainer),e.weekNumbers&&vt(e.weekNumbers);for(var r=document.createDocumentFragment(),a=0;a<e.config.showMonths;a++){var s=new Date(e.currentYear,e.currentMonth,1);s.setMonth(e.currentMonth+a),r.appendChild(ve(s.getFullYear(),s.getMonth()))}e.daysContainer.appendChild(r),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&St()}}function Q(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var r=function(d){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&d<e.config.minDate.getMonth()?!1:!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&d>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var a=0;a<12;a++)if(r(a)){var s=F("option","flatpickr-monthDropdown-month");s.value=new Date(e.currentYear,a).getMonth().toString(),s.textContent=yt(a,e.config.shorthandCurrentMonth,e.l10n),s.tabIndex=-1,e.currentMonth===a&&(s.selected=!0),e.monthsDropdownContainer.appendChild(s)}}}function Se(){var r=F("div","flatpickr-month"),a=window.document.createDocumentFragment(),s;e.config.showMonths>1||e.config.monthSelectorType==="static"?s=F("span","cur-month"):(e.monthsDropdownContainer=F("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),y(e.monthsDropdownContainer,"change",function(T){var w=se(T),O=parseInt(w.value,10);e.changeMonth(O-e.currentMonth),j("onMonthChange")}),Q(),s=e.monthsDropdownContainer);var d=bt("cur-year",{tabindex:"-1"}),h=d.getElementsByTagName("input")[0];h.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&h.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(h.setAttribute("max",e.config.maxDate.getFullYear().toString()),h.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var b=F("div","flatpickr-current-month");return b.appendChild(s),b.appendChild(d),a.appendChild(b),r.appendChild(a),{container:r,yearElement:h,monthElement:s}}function Ae(){vt(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var r=e.config.showMonths;r--;){var a=Se();e.yearElements.push(a.yearElement),e.monthElements.push(a.monthElement),e.monthNav.appendChild(a.container)}e.monthNav.appendChild(e.nextMonthNav)}function ye(){return e.monthNav=F("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=F("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=F("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,Ae(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(r){e.__hidePrevMonthArrow!==r&&(ne(e.prevMonthNav,"flatpickr-disabled",r),e.__hidePrevMonthArrow=r)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(r){e.__hideNextMonthArrow!==r&&(ne(e.nextMonthNav,"flatpickr-disabled",r),e.__hideNextMonthArrow=r)}}),e.currentYearElement=e.yearElements[0],xt(),e.monthNav}function We(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var r=tn(e.config);e.timeContainer=F("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var a=F("span","flatpickr-time-separator",":"),s=bt("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=s.getElementsByTagName("input")[0];var d=bt("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=d.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=te(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?r.hours:v(r.hours)),e.minuteElement.value=te(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():r.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(s),e.timeContainer.appendChild(a),e.timeContainer.appendChild(d),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var h=bt("flatpickr-second");e.secondElement=h.getElementsByTagName("input")[0],e.secondElement.value=te(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():r.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(F("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(h)}return e.config.time_24hr||(e.amPM=F("span","flatpickr-am-pm",e.l10n.amPM[le((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function Oe(){e.weekdayContainer?vt(e.weekdayContainer):e.weekdayContainer=F("div","flatpickr-weekdays");for(var r=e.config.showMonths;r--;){var a=F("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(a)}return wt(),e.weekdayContainer}function wt(){if(e.weekdayContainer){var r=e.l10n.firstDayOfWeek,a=zi(e.l10n.weekdays.shorthand);r>0&&r<a.length&&(a=zi(a.splice(r,a.length),a.splice(0,r)));for(var s=e.config.showMonths;s--;)e.weekdayContainer.children[s].innerHTML=`
|
2
|
-
<span class='flatpickr-weekday'>
|
3
|
-
`+a.join("</span><span class='flatpickr-weekday'>")+`
|
4
|
-
</span>
|
5
|
-
`}}function zn(){e.calendarContainer.classList.add("hasWeeks");var r=F("div","flatpickr-weekwrapper");r.appendChild(F("span","flatpickr-weekday",e.l10n.weekAbbreviation));var a=F("div","flatpickr-weeks");return r.appendChild(a),{weekWrapper:r,weekNumbers:a}}function ze(r,a){a===void 0&&(a=!0);var s=a?r:r-e.currentMonth;s<0&&e._hidePrevMonthArrow===!0||s>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=s,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,j("onYearChange"),Q()),be(),j("onMonthChange"),xt())}function rn(r,a){if(r===void 0&&(r=!0),a===void 0&&(a=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,a===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var s=tn(e.config),d=s.hours,h=s.minutes,b=s.seconds;_(d,h,b)}e.redraw(),r&&j("onChange")}function Ui(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),j("onClose")}function Ji(){e.config!==void 0&&j("onDestroy");for(var r=e._handlers.length;r--;)e._handlers[r].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var a=e.calendarContainer.parentNode;if(a.lastChild&&a.removeChild(a.lastChild),a.parentNode){for(;a.firstChild;)a.parentNode.insertBefore(a.firstChild,a);a.parentNode.removeChild(a)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(s){try{delete e[s]}catch{}})}function tt(r){return e.calendarContainer.contains(r)}function on(r){if(e.isOpen&&!e.config.inline){var a=se(r),s=tt(a),d=a===e.input||a===e.altInput||e.element.contains(a)||r.path&&r.path.indexOf&&(~r.path.indexOf(e.input)||~r.path.indexOf(e.altInput)),h=!d&&!s&&!tt(r.relatedTarget),b=!e.config.ignoredFocusElements.some(function(T){return T.contains(a)});h&&b&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&f(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function Et(r){if(!(!r||e.config.minDate&&r<e.config.minDate.getFullYear()||e.config.maxDate&&r>e.config.maxDate.getFullYear())){var a=r,s=e.currentYear!==a;e.currentYear=a||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),s&&(e.redraw(),j("onYearChange"),Q())}}function He(r,a){var s;a===void 0&&(a=!0);var d=e.parseDate(r,void 0,a);if(e.config.minDate&&d&&ce(d,e.config.minDate,a!==void 0?a:!e.minDateHasTime)<0||e.config.maxDate&&d&&ce(d,e.config.maxDate,a!==void 0?a:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(d===void 0)return!1;for(var h=!!e.config.enable,b=(s=e.config.enable)!==null&&s!==void 0?s:e.config.disable,T=0,w=void 0;T<b.length;T++){if(w=b[T],typeof w=="function"&&w(d))return h;if(w instanceof Date&&d!==void 0&&w.getTime()===d.getTime())return h;if(typeof w=="string"){var O=e.parseDate(w,void 0,!0);return O&&O.getTime()===d.getTime()?h:!h}else if(typeof w=="object"&&d!==void 0&&w.from&&w.to&&d.getTime()>=w.from.getTime()&&d.getTime()<=w.to.getTime())return h}return!h}function Ct(r){return e.daysContainer!==void 0?r.className.indexOf("hidden")===-1&&r.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(r):!1}function Vi(r){var a=r.target===e._input,s=e._input.value.trimEnd()!==cn();a&&s&&!(r.relatedTarget&&tt(r.relatedTarget))&&e.setDate(e._input.value,!0,r.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function qn(r){var a=se(r),s=e.config.wrap?n.contains(a):a===e._input,d=e.config.allowInput,h=e.isOpen&&(!d||!s),b=e.config.inline&&s&&!d;if(r.keyCode===13&&s){if(d)return e.setDate(e._input.value,!0,a===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),a.blur();e.open()}else if(tt(a)||h||b){var T=!!e.timeContainer&&e.timeContainer.contains(a);switch(r.keyCode){case 13:T?(r.preventDefault(),f(),an()):Un(r);break;case 27:r.preventDefault(),an();break;case 8:case 46:s&&!e.config.allowInput&&(r.preventDefault(),e.clear());break;case 37:case 39:if(!T&&!s){r.preventDefault();var w=l();if(e.daysContainer!==void 0&&(d===!1||w&&Ct(w))){var O=r.keyCode===39?1:-1;r.ctrlKey?(r.stopPropagation(),ze(O),me(V(1),0)):me(void 0,O)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:r.preventDefault();var D=r.keyCode===40?1:-1;e.daysContainer&&a.$i!==void 0||a===e.input||a===e.altInput?r.ctrlKey?(r.stopPropagation(),Et(e.currentYear-D),me(V(1),0)):T||me(void 0,D*7):a===e.currentYearElement?Et(e.currentYear-D):e.config.enableTime&&(!T&&e.hourElement&&e.hourElement.focus(),f(r),e._debouncedChange());break;case 9:if(T){var M=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(ue){return ue}),L=M.indexOf(a);if(L!==-1){var De=M[L+(r.shiftKey?-1:1)];r.preventDefault(),(De||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(a)&&r.shiftKey&&(r.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&a===e.amPM)switch(r.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],g(),Me();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],g(),Me();break}(s||tt(a))&&j("onKeyDown",r)}function St(r,a){if(a===void 0&&(a="flatpickr-day"),!(e.selectedDates.length!==1||r&&(!r.classList.contains(a)||r.classList.contains("flatpickr-disabled")))){for(var s=r?r.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),d=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),h=Math.min(s,e.selectedDates[0].getTime()),b=Math.max(s,e.selectedDates[0].getTime()),T=!1,w=0,O=0,D=h;D<b;D+=Wi.DAY)He(new Date(D),!0)||(T=T||D>h&&D<b,D<d&&(!w||D>w)?w=D:D>d&&(!O||D<O)&&(O=D));var M=Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+a));M.forEach(function(L){var De=L.dateObj,ue=De.getTime(),nt=w>0&&ue<w||O>0&&ue>O;if(nt){L.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(qe){L.classList.remove(qe)});return}else if(T&&!nt)return;["startRange","inRange","endRange","notAllowed"].forEach(function(qe){L.classList.remove(qe)}),r!==void 0&&(r.classList.add(s<=e.selectedDates[0].getTime()?"startRange":"endRange"),d<s&&ue===d?L.classList.add("startRange"):d>s&&ue===d&&L.classList.add("endRange"),ue>=w&&(O===0||ue<=O)&&Ri(ue,d,s)&&L.classList.add("inRange"))})}}function Zi(){e.isOpen&&!e.config.static&&!e.config.inline&&Mt()}function Qi(r,a){if(a===void 0&&(a=e._positionElement),e.isMobile===!0){if(r){r.preventDefault();var s=se(r);s&&s.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),j("onOpen");return}else if(e._input.disabled||e.config.inline)return;var d=e.isOpen;e.isOpen=!0,d||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),j("onOpen"),Mt(a)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(r===void 0||!e.timeContainer.contains(r.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function Kn(r){return function(a){var s=e.config["_"+r+"Date"]=e.parseDate(a,e.config.dateFormat),d=e.config["_"+(r==="min"?"max":"min")+"Date"];s!==void 0&&(e[r==="min"?"minDateHasTime":"maxDateHasTime"]=s.getHours()>0||s.getMinutes()>0||s.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(h){return He(h)}),!e.selectedDates.length&&r==="min"&&E(s),Me()),e.daysContainer&&($n(),s!==void 0?e.currentYearElement[r]=s.getFullYear().toString():e.currentYearElement.removeAttribute(r),e.currentYearElement.disabled=!!d&&s!==void 0&&d.getFullYear()===s.getFullYear())}}function er(){var r=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=ie(ie({},JSON.parse(JSON.stringify(n.dataset||{}))),t),s={};e.config.parseDate=a.parseDate,e.config.formatDate=a.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(M){e.config._enable=Vn(M)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(M){e.config._disable=Vn(M)}});var d=a.mode==="time";if(!a.dateFormat&&(a.enableTime||d)){var h=G.defaultConfig.dateFormat||Le.dateFormat;s.dateFormat=a.noCalendar||d?"H:i"+(a.enableSeconds?":S":""):h+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||d)&&!a.altFormat){var b=G.defaultConfig.altFormat||Le.altFormat;s.altFormat=a.noCalendar||d?"h:i"+(a.enableSeconds?":S K":" K"):b+(" h:i"+(a.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:Kn("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:Kn("max")});var T=function(M){return function(L){e.config[M==="min"?"_minTime":"_maxTime"]=e.parseDate(L,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:T("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:T("max")}),a.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,s,a);for(var w=0;w<r.length;w++)e.config[r[w]]=e.config[r[w]]===!0||e.config[r[w]]==="true";Ut.filter(function(M){return e.config[M]!==void 0}).forEach(function(M){e.config[M]=Zt(e.config[M]||[]).map(c)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var w=0;w<e.config.plugins.length;w++){var O=e.config.plugins[w](e)||{};for(var D in O)Ut.indexOf(D)>-1?e.config[D]=Zt(O[D]).map(c).concat(e.config[D]):typeof a[D]>"u"&&(e.config[D]=O[D])}a.altInputClass||(e.config.altInputClass=Xn().className+" "+e.config.altInputClass),j("onParseConfig")}function Xn(){return e.config.wrap?n.querySelector("[data-input]"):n}function Gn(){typeof e.config.locale!="object"&&typeof G.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=ie(ie({},G.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?G.l10ns[e.config.locale]:void 0),Ie.D="("+e.l10n.weekdays.shorthand.join("|")+")",Ie.l="("+e.l10n.weekdays.longhand.join("|")+")",Ie.M="("+e.l10n.months.shorthand.join("|")+")",Ie.F="("+e.l10n.months.longhand.join("|")+")",Ie.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var r=ie(ie({},t),JSON.parse(JSON.stringify(n.dataset||{})));r.time_24hr===void 0&&G.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=jn(e),e.parseDate=Qt({config:e.config,l10n:e.l10n})}function Mt(r){if(typeof e.config.position=="function")return void e.config.position(e,r);if(e.calendarContainer!==void 0){j("onPreCalendarPosition");var a=r||e._positionElement,s=Array.prototype.reduce.call(e.calendarContainer.children,function(yr,Dr){return yr+Dr.offsetHeight},0),d=e.calendarContainer.offsetWidth,h=e.config.position.split(" "),b=h[0],T=h.length>1?h[1]:null,w=a.getBoundingClientRect(),O=window.innerHeight-w.bottom,D=b==="above"||b!=="below"&&O<s&&w.top>s,M=window.pageYOffset+w.top+(D?-s-2:a.offsetHeight+2);if(ne(e.calendarContainer,"arrowTop",!D),ne(e.calendarContainer,"arrowBottom",D),!e.config.inline){var L=window.pageXOffset+w.left,De=!1,ue=!1;T==="center"?(L-=(d-w.width)/2,De=!0):T==="right"&&(L-=d-w.width,ue=!0),ne(e.calendarContainer,"arrowLeft",!De&&!ue),ne(e.calendarContainer,"arrowCenter",De),ne(e.calendarContainer,"arrowRight",ue);var nt=window.document.body.offsetWidth-(window.pageXOffset+w.right),qe=L+d>window.document.body.offsetWidth,fr=nt+d>window.document.body.offsetWidth;if(ne(e.calendarContainer,"rightMost",qe),!e.config.static)if(e.calendarContainer.style.top=M+"px",!qe)e.calendarContainer.style.left=L+"px",e.calendarContainer.style.right="auto";else if(!fr)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=nt+"px";else{var un=tr();if(un===void 0)return;var pr=window.document.body.offsetWidth,hr=Math.max(0,pr/2-d/2),mr=".flatpickr-calendar.centerMost:before",gr=".flatpickr-calendar.centerMost:after",vr=un.cssRules.length,br="{left:"+w.left+"px;right:auto;}";ne(e.calendarContainer,"rightMost",!1),ne(e.calendarContainer,"centerMost",!0),un.insertRule(mr+","+gr+br,vr),e.calendarContainer.style.left=hr+"px",e.calendarContainer.style.right="auto"}}}}function tr(){for(var r=null,a=0;a<document.styleSheets.length;a++){var s=document.styleSheets[a];if(s.cssRules){try{s.cssRules}catch{continue}r=s;break}}return r??nr()}function nr(){var r=document.createElement("style");return document.head.appendChild(r),r.sheet}function $n(){e.config.noCalendar||e.isMobile||(Q(),xt(),be())}function an(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function Un(r){r.preventDefault(),r.stopPropagation();var a=function(M){return M.classList&&M.classList.contains("flatpickr-day")&&!M.classList.contains("flatpickr-disabled")&&!M.classList.contains("notAllowed")},s=Hn(se(r),a);if(s!==void 0){var d=s,h=e.latestSelectedDateObj=new Date(d.dateObj.getTime()),b=(h.getMonth()<e.currentMonth||h.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=d,e.config.mode==="single")e.selectedDates=[h];else if(e.config.mode==="multiple"){var T=sn(h);T?e.selectedDates.splice(parseInt(T),1):e.selectedDates.push(h)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=h,e.selectedDates.push(h),ce(h,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(M,L){return M.getTime()-L.getTime()}));if(g(),b){var w=e.currentYear!==h.getFullYear();e.currentYear=h.getFullYear(),e.currentMonth=h.getMonth(),w&&(j("onYearChange"),Q()),j("onMonthChange")}if(xt(),be(),Me(),!b&&e.config.mode!=="range"&&e.config.showMonths===1?Y(d):e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus(),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var O=e.config.mode==="single"&&!e.config.enableTime,D=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(O||D)&&an()}B()}}var _t={locale:[Gn,wt],showMonths:[Ae,u,Oe],minDate:[P],maxDate:[P],positionElement:[Zn],clickOpens:[function(){e.config.clickOpens===!0?(y(e._input,"focus",e.open),y(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function ir(r,a){if(r!==null&&typeof r=="object"){Object.assign(e.config,r);for(var s in r)_t[s]!==void 0&&_t[s].forEach(function(d){return d()})}else e.config[r]=a,_t[r]!==void 0?_t[r].forEach(function(d){return d()}):Ut.indexOf(r)>-1&&(e.config[r]=Zt(a));e.redraw(),Me(!0)}function Jn(r,a){var s=[];if(r instanceof Array)s=r.map(function(d){return e.parseDate(d,a)});else if(r instanceof Date||typeof r=="number")s=[e.parseDate(r,a)];else if(typeof r=="string")switch(e.config.mode){case"single":case"time":s=[e.parseDate(r,a)];break;case"multiple":s=r.split(e.config.conjunction).map(function(d){return e.parseDate(d,a)});break;case"range":s=r.split(e.l10n.rangeSeparator).map(function(d){return e.parseDate(d,a)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(r)));e.selectedDates=e.config.allowInvalidPreload?s:s.filter(function(d){return d instanceof Date&&He(d,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(d,h){return d.getTime()-h.getTime()})}function rr(r,a,s){if(a===void 0&&(a=!1),s===void 0&&(s=e.config.dateFormat),r!==0&&!r||r instanceof Array&&r.length===0)return e.clear(a);Jn(r,s),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),P(void 0,a),E(),e.selectedDates.length===0&&e.clear(!1),Me(a),a&&j("onChange")}function Vn(r){return r.slice().map(function(a){return typeof a=="string"||typeof a=="number"||a instanceof Date?e.parseDate(a,void 0,!0):a&&typeof a=="object"&&a.from&&a.to?{from:e.parseDate(a.from,void 0),to:e.parseDate(a.to,void 0)}:a}).filter(function(a){return a})}function or(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var r=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);r&&Jn(r,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function ar(){if(e.input=Xn(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=F(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),Zn()}function Zn(){e._positionElement=e.config.positionElement||e._input}function lr(){var r=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=F("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=r,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=r==="datetime-local"?"Y-m-d\\TH:i:S":r==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}y(e.mobileInput,"change",function(a){e.setDate(se(a).value,!1,e.mobileFormatStr),j("onChange"),j("onClose")})}function sr(r){if(e.isOpen===!0)return e.close();e.open(r)}function j(r,a){if(e.config!==void 0){var s=e.config[r];if(s!==void 0&&s.length>0)for(var d=0;s[d]&&d<s.length;d++)s[d](e.selectedDates,e.input.value,e,a);r==="onChange"&&(e.input.dispatchEvent(ln("change")),e.input.dispatchEvent(ln("input")))}}function ln(r){var a=document.createEvent("Event");return a.initEvent(r,!0,!0),a}function sn(r){for(var a=0;a<e.selectedDates.length;a++){var s=e.selectedDates[a];if(s instanceof Date&&ce(s,r)===0)return""+a}return!1}function cr(r){return e.config.mode!=="range"||e.selectedDates.length<2?!1:ce(r,e.selectedDates[0])>=0&&ce(r,e.selectedDates[1])<=0}function xt(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(r,a){var s=new Date(e.currentYear,e.currentMonth,1);s.setMonth(e.currentMonth+a),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[a].textContent=yt(s.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=s.getMonth().toString(),r.value=s.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function cn(r){var a=r||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(s){return e.formatDate(s,a)}).filter(function(s,d,h){return e.config.mode!=="range"||e.config.enableTime||h.indexOf(s)===d}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function Me(r){r===void 0&&(r=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=cn(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=cn(e.config.altFormat)),r!==!1&&j("onValueUpdate")}function ur(r){var a=se(r),s=e.prevMonthNav.contains(a),d=e.nextMonthNav.contains(a);s||d?ze(s?-1:1):e.yearElements.indexOf(a)>=0?a.select():a.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):a.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function dr(r){r.preventDefault();var a=r.type==="keydown",s=se(r),d=s;e.amPM!==void 0&&s===e.amPM&&(e.amPM.textContent=e.l10n.amPM[le(e.amPM.textContent===e.l10n.amPM[0])]);var h=parseFloat(d.getAttribute("min")),b=parseFloat(d.getAttribute("max")),T=parseFloat(d.getAttribute("step")),w=parseInt(d.value,10),O=r.delta||(a?r.which===38?1:-1:0),D=w+T*O;if(typeof d.value<"u"&&d.value.length===2){var M=d===e.hourElement,L=d===e.minuteElement;D<h?(D=b+D+le(!M)+(le(M)&&le(!e.amPM)),L&&W(void 0,-1,e.hourElement)):D>b&&(D=d===e.hourElement?D-b-le(!e.amPM):h,L&&W(void 0,1,e.hourElement)),e.amPM&&M&&(T===1?D+w===23:Math.abs(D-w)>T)&&(e.amPM.textContent=e.l10n.amPM[le(e.amPM.textContent===e.l10n.amPM[0])]),d.value=te(D)}}return o(),e}function Qe(n,t){for(var e=Array.prototype.slice.call(n).filter(function(c){return c instanceof HTMLElement}),i=[],o=0;o<e.length;o++){var l=e[o];try{if(l.getAttribute("data-fp-omit")!==null)continue;l._flatpickr!==void 0&&(l._flatpickr.destroy(),l._flatpickr=void 0),l._flatpickr=Wo(l,t||{}),i.push(l._flatpickr)}catch(c){console.error(c)}}return i.length===1?i[0]:i}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return Qe(this,n)},HTMLElement.prototype.flatpickr=function(n){return Qe([this],n)});var G=function(n,t){return typeof n=="string"?Qe(window.document.querySelectorAll(n),t):n instanceof Node?Qe([n],t):Qe(n,t)};G.defaultConfig={};G.l10ns={en:ie({},Vt),default:ie({},Vt)};G.localize=function(n){G.l10ns.default=ie(ie({},G.l10ns.default),n)};G.setDefaults=function(n){G.defaultConfig=ie(ie({},G.defaultConfig),n)};G.parseDate=Qt({});G.formatDate=jn({});G.compareDates=ce;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return Qe(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=G);var qi=G;function Rn(n=document){n===""?n=document:n instanceof String&&(n=document.querySelectorAll(n));let t=n.querySelectorAll("input[data-datepicker-type]");Alchemy.isiOS?t.forEach(e=>{e.attributes.type=e.dataset.datepickerType}):t.forEach(e=>{let i=e.dataset.datepickerType,o={locale:Alchemy.locale.slice(0,2),altInput:!0,altFormat:Alchemy.t(`formats.${i}`),altInputClass:"flatpickr-input",dateFormat:"Z",enableTime:/time/.test(i),noCalendar:i==="time",time_24hr:Alchemy.t("formats.time_24hr"),onValueUpdate(l,c,u){return Alchemy.setElementDirty(u.element.closest(".element-editor"))}};qi(e,o)})}function zo(n){let t=n.item.dataset.pageId,e=Alchemy.routes.move_admin_page_path(t),i={target_parent_id:n.to.dataset.parentId,new_position:n.newIndex};Be(e,i).then(async o=>{let l=await o.data,u=document.getElementById(`page_${t}`).querySelector(".sitemap_url");Alchemy.growl(Alchemy.t("Successfully moved page")),u.textContent=l.url_path,nn()}).catch(o=>{Alchemy.growl(o.message||o,"error")})}function nn(){document.querySelectorAll("li.sitemap-item").forEach(n=>{let t=n.querySelector(".page_folder"),e=n.querySelector(".children"),i={folded:n.dataset.folded==="true",id:n.dataset.pageId,type:n.dataset.type};e.children.length>0||i.folded?t.outerHTML=HandlebarsTemplates.page_folder({page:i}):t.innerHTML=""})}function Bn(n){n.forEach(t=>{new zt(t,{group:"pages",animation:150,fallbackOnBody:!0,swapThreshold:.65,handle:".handle",onEnd:zo})})}function Ki(){let n=document.querySelectorAll("ul.children");nn(),Bn(n)}var Dt=class{constructor(t){let e=document.getElementById("sitemap-list").innerHTML.replace(/__ID__/g,"{{id}}");this.search_field=document.querySelector(".search_input_field"),this.filter_field_clear=document.querySelector(".search_field_clear"),this.filter_field_clear.removeAttribute("href"),this.display=document.getElementById("page_filter_result"),this.sitemap_wrapper=document.getElementById("sitemap-wrapper"),this.template=Handlebars.compile(document.getElementById("sitemap-template").innerHTML),this.list_template=Handlebars.compile(e),this.items=null,this.options=t,Handlebars.registerPartial("list",e),this.load(t.page_root_id)}load(t){let e=new Alchemy.Spinner("medium"),i=this.sitemap_wrapper;i.innerHTML="",e.spin(i),qt(this.options.url,{id:t}).then(async o=>{this.render(await o.data),this.handlePageFolders(),e.stop()}).catch(this.errorHandler)}handlePageFolders(){Kt("click","#sitemap",".page_folder",function(t){let e=new Alchemy.Spinner("small"),i=t.target.closest(".page_folder"),o=i.dataset.pageId;i.innerHTML="",e.spin(i),Be(Alchemy.routes.fold_admin_page_path(o)).then(async l=>{this.reRender(o,await l.data),e.stop()}).catch(this.errorHandler)}.bind(this))}render(t){let e=this.sitemap_wrapper,i=this.template;e.innerHTML=i({children:t.pages}),this.items=document.getElementById("sitemap").querySelectorAll(".sitemap_page"),this.sitemap_wrapper=document.getElementById("sitemap-wrapper"),this._observe(),Ki()}reRender(t,e){let i=document.getElementById(`page_${t}`);i.outerHTML=this.list_template({children:e.pages}),i=document.getElementById(`page_${t}`);let o=i.querySelectorAll("ul.children");Bn(o),nn()}filter(t){let e=[];this.items.forEach(function(o){t!==""&&o.getAttribute("name").toLowerCase().indexOf(t)!==-1?(o.classList.add("highlight"),o.classList.remove("no-match"),e.push(o)):(o.classList.add("no-match"),o.classList.remove("highlight"))}),this.filter_field_clear.style.display="inline-block";let{length:i}=e;i===1?(this.display.style.display="block",this.display.innerText=`1 ${Alchemy.t("page_found")}`,e[0].scrollIntoView({behavior:"smooth",block:"center"})):i>1?(this.display.style.display="block",this.display.innerText=`${i} ${Alchemy.t("pages_found")}`):(this.items.forEach(o=>o.classList.remove("no-match","highlight")),this.display.style.display="none",window.scrollTo({top:0,left:0,behavior:"smooth"}),this.filter_field_clear.style.display="none")}_observe(){this.search_field.addEventListener("keyup",t=>{let e=t.target.value;this.filter(e.toLowerCase())}),this.search_field.addEventListener("focus",()=>key.setScope("search")),this.filter_field_clear.addEventListener("click",()=>(this.search_field.value="",this.filter(""),!1))}errorHandler(t){Alchemy.growl(t.message||t,"error"),console.error(t)}};var Xi={},et=null;function qo(n){let t=Alchemy.TinymceDefaults;return t.language=Alchemy.locale,t.selector=`#${n}`,t.init_instance_callback=Uo,t}function Ko(n){let t=Xi[n]||{};return{...qo(n),...t}}function Xo(n){Go(),n.forEach(t=>{let e=`tinymce_${t}`,i=document.getElementById(e);i?et.observe(i):console.warn(`Could not initialize TinyMCE for textarea#${e}!`)})}function Go(){et!==null&&et.disconnect();let n=(e,i)=>{e.forEach(o=>{o.intersectionRatio>0&&($o(o.target),i.unobserve(o.target))})},t={root:Alchemy.ElementEditors.element_area.get(0),rootMargin:"0px",threshold:[.05]};et=new IntersectionObserver(n,t)}function $o(n){let t=n.id,e=Ko(t);if(Wn(t),e){let i=new Alchemy.Spinner("small");n.closest(".tinymce_container").prepend(i.spin().el.get(0)),tinymce.init(e)}else console.warn("No tinymce configuration found for",id)}function Uo(n){let t=document.getElementById(n.id).closest(".element-editor");t.getElementsByClassName("spinner").item(0).remove(),n.on("dirty",function(){Alchemy.setElementDirty(t)}),n.on("click",function(e){e.target=t,Alchemy.ElementEditors.onClickElement(e)})}function Wn(n){let t=document.getElementById(n);et&&t&&et.unobserve(t);let e=tinymce.get(n);e&&e.remove()}var Gi={init(n){Xo(n)},initWith(n){tinymce.init({...Alchemy.TinymceDefaults,...n})},remove(n){n.forEach(t=>Wn(`tinymce_${t}`))},removeFrom(n){$(n).each(function(t){Wn(t.id)})},setCustomConfig(n,t){Xi[n]=t}};function $i(){document.addEventListener("DialogReady.Alchemy",function(n){let t=n.detail.body,e=t.querySelector("#page_public_on"),i=t.querySelector("#page_public_until"),o=t.querySelector(".page-publication-date-fields"),l=t.querySelector("#page_public");l&&l.addEventListener("click",function(c){let u=c.target,f=new Date;u.checked?(o.classList.remove("hidden"),e._flatpickr.setDate(f)):(o.classList.add("hidden"),e.value=""),i.value=""})})}typeof window.Alchemy>"u"&&(window.Alchemy={});Object.assign(Alchemy,{t:dn,translations:Object.assign(Alchemy.translations||{},ei),NodeTree:An,fileEditors:kn,pictureEditors:Pn,ImageLoader:Pe.init,ImageCropper:gt,IngredientAnchorLink:pt,Datepicker:Rn,Sitemap:Dt,Tinymce:Gi,PagePublicationFields:$i});})();
|
6
|
-
/*! Bundled license information:
|
7
|
-
|
8
|
-
sortablejs/modular/sortable.esm.js:
|
9
|
-
(**!
|
10
|
-
* Sortable 1.15.0
|
11
|
-
* @author RubaXa <trash@rubaxa.org>
|
12
|
-
* @author owenm <owen23355@gmail.com>
|
13
|
-
* @license MIT
|
14
|
-
*)
|
15
|
-
*/
|
16
|
-
//# sourceMappingURL=assets/admin.js.map
|