diff --git a/CHANGELOG.md b/CHANGELOG.md index ea6bd6e8..3f888055 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ 1. [](#bugfix) * Fixed fetch issue throwing error when request not completed and while unloading the page [#1301](https://github.com/getgrav/grav-plugin-admin/issues/1301) * Fixed ordering when > 100 pages [grav#1564](https://github.com/getgrav/grav/pull/1564) + * Fixed Lists issue when reindexing, causing Radio fields to potentially lose their `checked` status ([#1154](https://github.com/getgrav/grav-plugin-admin/issues/1154) | related: [1d55ffc](https://github.com/getgrav/grav-plugin-admin/commit/1d55ffc616125047f245efe9f2180ef2c16b4949)) # v1.5.0-rc.4 ## 07/05/2017 diff --git a/themes/grav/app/forms/fields/collections.js b/themes/grav/app/forms/fields/collections.js index 4d4b4e86..51349f34 100644 --- a/themes/grav/app/forms/fields/collections.js +++ b/themes/grav/app/forms/fields/collections.js @@ -212,10 +212,6 @@ export default class CollectionsField { }); }); }); - - items.find('input[type="radio"][checked]').each((index, radio) => { - radio.checked = true; - }); } _onAddedNodes(event, target/* , record, instance */) { diff --git a/themes/grav/js/admin.min.js b/themes/grav/js/admin.min.js index 27a500eb..13502fcf 100644 --- a/themes/grav/js/admin.min.js +++ b/themes/grav/js/admin.min.js @@ -10,7 +10,7 @@ alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquer setTimeout(function(){n(t)},600))}function i(n,i,a){function o(){t.off(a,"mouseout",o),s&&(r(s),s=null)}var s=e(n,i),l=setInterval(function(){if(s)for(var t=a;;t=t.parentNode){if(t&&11==t.nodeType&&(t=t.host),t==document.body)return;if(!t){o();break}}if(!s)return clearInterval(l)},400);t.on(a,"mouseout",o)}function a(t,e,n){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(e){g(t,e)},this.waitingFor=0}function o(t,e){return e instanceof Function?{getAnnotations:e}:(e&&e!==!0||(e={}),e)}function s(t){var e=t.state.lint;e.hasGutter&&t.clearGutter(y);for(var n=0;n1,n.options.tooltips))}}r.onUpdateLinting&&r.onUpdateLinting(e,i,t)}function m(t){var e=t.state.lint;e&&(clearTimeout(e.timeout),e.timeout=setTimeout(function(){p(t)},e.options.delay||500))}function v(t,e){for(var n=e.target||e.srcElement,r=document.createDocumentFragment(),a=0;a=0&&b.splice(e,1)}function s(t){var e=document.createElement("style");return t.attrs.type="text/css",u(e,t.attrs),a(t,e),e}function l(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",u(e,t.attrs),a(t,e),e}function u(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function c(t,e){var n,r,i,a;if(e.transform&&t.css){if(a=e.transform(t.css),!a)return function(){};t.css=a}if(e.singleton){var u=_++;n=y||(y=s(e)),r=f.bind(null,n,u,!1),i=f.bind(null,n,u,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=l(e),r=p.bind(null,n,e),i=function(){o(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(e),r=d.bind(null,n),i=function(){o(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}function f(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(e,i);else{var a=document.createTextNode(i),o=t.childNodes;o[e]&&t.removeChild(o[e]),o.length?t.insertBefore(a,o[e]):t.appendChild(a)}}function d(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function p(t,e,n){var r=n.css,i=n.sourceMap,a=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||a)&&(r=w(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([r],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}var h={},m=function(t){var e;return function(){return"undefined"==typeof e&&(e=t.apply(this,arguments)),e}},v=m(function(){return window&&document&&document.all&&!window.atob}),g=function(t){var e={};return function(n){return"undefined"==typeof e[n]&&(e[n]=t.call(this,n)),e[n]}}(function(t){return document.querySelector(t)}),y=null,_=0,b=[],w=n(418);t.exports=function(t,e){e=e||{},e.attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||(e.singleton=v()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=i(t,e);return r(n,e),function(t){for(var a=[],o=0;o0){var c=a.character;l.forEach(function(t){c>t&&(c-=1)}),a.character=c}}var f=a.character-1,d=f+1;a.evidence&&(s=a.evidence.substring(f).search(/.\b/),s>-1&&(d+=s)),a.description=a.reason,a.start=a.character,a.end=d,a=n(a),a&&r.push({message:a.description,severity:a.severity,from:t.Pos(a.line-1,f),to:t.Pos(a.line-1,d)})}}}var o=["Dangerous comment"],s=[["Expected '{'","Statement body should be inside '{ }' braces."]],l=["Missing semicolon","Extra comma","Missing property name","Unmatched "," and instead saw"," is not defined","Unclosed string","Stopping, unable to continue"];t.registerHelper("lint","javascript",e)})},function(t,e,n){!function(t){t(n(360))}(function(t){"use strict";t.registerHelper("lint","json",function(e){var n=[];jsonlint.parseError=function(e,r){var i=r.loc;n.push({from:t.Pos(i.first_line-1,i.first_column),to:t.Pos(i.last_line-1,i.last_column),message:e})};try{jsonlint.parse(e)}catch(t){}return n})})},function(t,e,n){!function(t){t(n(360))}(function(t){"use strict";t.registerHelper("lint","yaml",function(e){var n=[];try{jsyaml.load(e)}catch(e){var r=e.mark,i=r?t.Pos(r.line,r.column):t.Pos(0,0),a=i;n.push({from:i,to:a,message:e.message})}return n})})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i=n(1),a=r(i);(0,a.default)('[name="task"][value="saveas"], [name="task"][value="switchlanguage"]').on("mousedown touchstart",function(t){var e=["lang","redirect"],n=(0,a.default)(t.currentTarget),r=(0,a.default)("#"+n.attr("form"));if(r.length)return e.forEach(function(t){var e=n.attr(t);if(e){var i=r.find('[name="data['+t+']"]');i.length||(i=(0,a.default)(''),r.append(i)),i.val(e)}}),!0})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(425),a=r(i),o=n(431),s=r(o),l=n(432),u=r(l);e.default={Form:{Form:s.default,Instance:o.Instance},Fields:u.default,FormState:{FormState:a.default,Instance:i.Instance}}},function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.DOMBehaviors=e.Instance=void 0;var a=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{ignore:[],form_id:"blueprints"};i(this,t),this.options=e,this.refresh(),this.form&&this.fields.length&&(d=this.collect(),this.loadState=d,p.attach())}return a(t,[{key:"refresh",value:function(){return this.form=(0,s.default)("form#"+this.options.form_id).filter(":noparents(.remodal)"),this.fields=(0,s.default)("form#"+this.options.form_id+' *, [form="'+this.options.form_id+'"]').filter(":input:not(.no-form)").filter(":noparents(.remodal)"),this}},{key:"collect",value:function(){var t=this;if(this.form&&this.fields.length){var e={};return this.refresh().fields.each(function(n,r){r=(0,s.default)(r);var i=r.prop("name"),a=r.prop("type"),o=r.prop("tagName").toLowerCase(),l=void 0;if(!i.startsWith("toggleable_")&&"data[lang]"!==i&&"data[redirect]"!==i){switch(a){case"checkbox":l=r.is(":checked");break;case"radio":if(!r.is(":checked"))return;l=r.val();break;default:l=r.val()}"select"===o&&null===l&&(l=""),Array.isArray(l)&&(l=l.join("|")),i&&!~t.options.ignore.indexOf(i)&&(e[i]=l)}}),u.default.OrderedMap(e)}}},{key:"diff",value:function(){return(0,f.default)(d,this.collect())}},{key:"equals",value:function(){return this.form&&this.fields.length?u.default.is(d,this.collect()):null}}]),t}();e.default=h;var m=e.Instance=new h;e.DOMBehaviors=p}).call(e,function(){return this}())},function(t,e,n){!function(e,n){t.exports=n()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return a(t)?t:O(t)}function n(t){return o(t)?t:C(t)}function r(t){return s(t)?t:j(t)}function i(t){return a(t)&&!l(t)?t:P(t)}function a(t){return!(!t||!t[un])}function o(t){return!(!t||!t[cn])}function s(t){return!(!t||!t[fn])}function l(t){return o(t)||s(t)}function u(t){return!(!t||!t[dn])}function c(t){return t.value=!1,t}function f(t){t&&(t.value=!0)}function d(){}function p(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i=0;i>>0;if(""+n!==e||4294967295===n)return NaN;e=n}return e<0?h(t)+e:e}function v(){return!0}function g(t,e,n){return(0===t||void 0!==n&&t<=-n)&&(void 0===e||void 0!==n&&e>=n)}function y(t,e){return b(t,e,0)}function _(t,e){return b(t,e,e)}function b(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function w(t){this.next=t}function x(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={value:i,done:!1},r}function k(){return{value:void 0,done:!0}}function S(t){return!!I(t)}function A(t){return t&&"function"==typeof t.next}function E(t){var e=I(t);return e&&e.call(t)}function I(t){var e=t&&(kn&&t[kn]||t[Sn]);if("function"==typeof e)return e}function M(t){return t&&"number"==typeof t.length}function O(t){return null===t||void 0===t?F():a(t)?t.toSeq():R(t)}function C(t){return null===t||void 0===t?F().toKeyedSeq():a(t)?o(t)?t.toSeq():t.fromEntrySeq():q(t)}function j(t){return null===t||void 0===t?F():a(t)?o(t)?t.entrySeq():t.toIndexedSeq():U(t)}function P(t){return(null===t||void 0===t?F():a(t)?o(t)?t.entrySeq():t:U(t)).toSetSeq()}function T(t){this._array=t,this.size=t.length}function z(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function D(t){this._iterable=t,this.size=t.length||t.size}function L(t){this._iterator=t,this._iteratorCache=[]}function N(t){return!(!t||!t[En])}function F(){return In||(In=new T([]))}function q(t){var e=Array.isArray(t)?new T(t).fromEntrySeq():A(t)?new L(t).fromEntrySeq():S(t)?new D(t).fromEntrySeq():"object"==typeof t?new z(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function U(t){var e=B(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function R(t){var e=B(t)||"object"==typeof t&&new z(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function B(t){return M(t)?new T(t):A(t)?new L(t):S(t)?new D(t):void 0}function V(t,e,n,r){var i=t._cache;if(i){for(var a=i.length-1,o=0;o<=a;o++){var s=i[n?a-o:o];if(e(s[1],r?s[0]:o,t)===!1)return o+1}return o}return t.__iterateUncached(e,n)}function H(t,e,n,r){var i=t._cache;if(i){var a=i.length-1,o=0;return new w(function(){var t=i[n?a-o:o];return o++>a?k():x(e,r?t[0]:o-1,t[1])})}return t.__iteratorUncached(e,n)}function G(t,e){return e?K(e,t,"",{"":t}):W(t)}function K(t,e,n,r){return Array.isArray(e)?t.call(r,n,j(e).map(function(n,r){return K(t,n,r,e)})):$(e)?t.call(r,n,C(e).map(function(n,r){return K(t,n,r,e)})):e}function W(t){return Array.isArray(t)?j(t).map(W).toList():$(t)?C(t).map(W).toMap():t}function $(t){return t&&(t.constructor===Object||void 0===t.constructor)}function Y(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return!("function"!=typeof t.equals||"function"!=typeof e.equals||!t.equals(e))}function J(t,e){if(t===e)return!0;if(!a(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||o(t)!==o(e)||s(t)!==s(e)||u(t)!==u(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!l(t);if(u(t)){var r=t.entries();return e.every(function(t,e){var i=r.next().value;return i&&Y(i[1],t)&&(n||Y(i[0],e))})&&r.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var c=t;t=e,e=c}var f=!0,d=e.__iterate(function(e,r){if(n?!t.has(e):i?!Y(e,t.get(r,gn)):!Y(t.get(r,gn),e))return f=!1,!1});return f&&t.size===d}function X(t,e){if(!(this instanceof X))return new X(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(Mn)return Mn;Mn=this}}function Q(t,e){if(!t)throw new Error(e)}function Z(t,e,n){if(!(this instanceof Z))return new Z(t,e,n);if(Q(0!==n,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),n=void 0===n?1:Math.abs(n),e>>1&1073741824|3221225471&t}function at(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){if(t!==t||t===1/0)return 0;var n=0|t;for(n!==t&&(n^=4294967295*t);t>4294967295;)t/=4294967295,n^=t;return it(n)}if("string"===e)return t.length>Nn?ot(t):st(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"===e)return lt(t);if("function"==typeof t.toString)return st(t.toString());throw new Error("Value type "+e+" cannot be hashed.")}function ot(t){var e=Un[t];return void 0===e&&(e=st(t),qn===Fn&&(qn=0,Un={}),qn++,Un[t]=e),e}function st(t){for(var e=0,n=0;n0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ct(t){Q(t!==1/0,"Cannot perform this action with an infinite size.")}function ft(t){return null===t||void 0===t?xt():dt(t)&&!u(t)?t:xt().withMutations(function(e){var r=n(t);ct(r.size),r.forEach(function(t,n){return e.set(n,t)})})}function dt(t){return!(!t||!t[Rn])}function pt(t,e){this.ownerID=t,this.entries=e}function ht(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n}function mt(t,e,n){this.ownerID=t,this.count=e,this.nodes=n}function vt(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n}function gt(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n}function yt(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&bt(t._root)}function _t(t,e){return x(t,e[0],e[1])}function bt(t,e){return{node:t,index:0,__prev:e}}function wt(t,e,n,r){var i=Object.create(Bn);return i.size=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function xt(){return Vn||(Vn=wt(0))}function kt(t,e,n){var r,i;if(t._root){var a=c(yn),o=c(_n);if(r=St(t._root,t.__ownerID,0,void 0,e,n,a,o),!o.value)return t;i=t.size+(a.value?n===gn?-1:1:0)}else{if(n===gn)return t;i=1,r=new pt(t.__ownerID,[[e,n]])}return t.__ownerID?(t.size=i,t._root=r,t.__hash=void 0,t.__altered=!0,t):r?wt(i,r):xt()}function St(t,e,n,r,i,a,o,s){return t?t.update(e,n,r,i,a,o,s):a===gn?t:(f(s),f(o),new gt(e,r,[i,a]))}function At(t){return t.constructor===gt||t.constructor===vt}function Et(t,e,n,r,i){if(t.keyHash===r)return new vt(e,r,[t.entry,i]);var a,o=(0===n?t.keyHash:t.keyHash>>>n)&vn,s=(0===n?r:r>>>n)&vn,l=o===s?[Et(t,e,n+hn,r,i)]:(a=new gt(e,r,i),o>>=1)o[s]=1&n?e[a++]:void 0;return o[r]=i,new mt(t,a+1,o)}function Ct(t,e,r){for(var i=[],o=0;o>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function Lt(t,e,n,r){var i=r?t:p(t);return i[e]=n,i}function Nt(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var a=new Array(i),o=0,s=0;s0&&ia?0:a-n,u=o-n;return u>mn&&(u=mn),function(){if(i===u)return Jn;var t=e?--u:i++;return r&&r[t]}}function i(t,r,i){var s,l=t&&t.array,u=i>a?0:a-i>>r,c=(o-i>>r)+1;return c>mn&&(c=mn),function(){for(;;){if(s){var t=s();if(t!==Jn)return t;s=null}if(u===c)return Jn;var a=e?--c:u++;s=n(l&&l[a],r-hn,i+(a<=t.size||e<0)return t.withMutations(function(t){e<0?Yt(t,e).set(0,n):Yt(t,0,e+1).set(e,n)});e+=t._origin;var r=t._tail,i=t._root,a=c(_n);return e>=Xt(t._capacity)?r=Kt(r,t.__ownerID,0,e,n,a):i=Kt(i,t.__ownerID,t._level,e,n,a),a.value?t.__ownerID?(t._root=i,t._tail=r,t.__hash=void 0,t.__altered=!0,t):Vt(t._origin,t._capacity,t._level,i,r):t}function Kt(t,e,n,r,i,a){var o=r>>>n&vn,s=t&&o0){var u=t&&t.array[o],c=Kt(u,e,n-hn,r,i,a);return c===u?t:(l=Wt(t,e),l.array[o]=c,l)}return s&&t.array[o]===i?t:(f(a),l=Wt(t,e),void 0===i&&o===l.array.length-1?l.array.pop():l.array[o]=i,l)}function Wt(t,e){return e&&t&&e===t.ownerID?t:new Rt(t?t.array.slice():[],e)}function $t(t,e){if(e>=Xt(t._capacity))return t._tail;if(e<1<0;)n=n.array[e>>>r&vn],r-=hn;return n}}function Yt(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var r=t.__ownerID||new d,i=t._origin,a=t._capacity,o=i+e,s=void 0===n?a:n<0?a+n:i+n;if(o===i&&s===a)return t;if(o>=s)return t.clear();for(var l=t._level,u=t._root,c=0;o+c<0;)u=new Rt(u&&u.array.length?[void 0,u]:[],r),l+=hn,c+=1<=1<f?new Rt([],r):h;if(h&&p>f&&ohn;g-=hn){var y=f>>>g&vn;v=v.array[y]=Wt(v.array[y],r)}v.array[f>>>hn&vn]=h}if(s=p)o-=p,s-=p,l=hn,u=null,m=m&&m.removeBefore(r,0,o);else if(o>i||p>>l&vn;if(_!==p>>>l&vn)break;_&&(c+=(1<i&&(u=u.removeBefore(r,l,o-c)),u&&po&&(o=u.size),a(l)||(u=u.map(function(t){return G(t)})),i.push(u)}return o>t.size&&(t=t.setSize(o)),Tt(t,e,i)}function Xt(t){return t>>hn<=mn&&o.size>=2*a.size?(i=o.filter(function(t,e){return void 0!==t&&s!==e}),r=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(r.__ownerID=i.__ownerID=t.__ownerID)):(r=a.remove(e),i=s===o.size-1?o.pop():o.set(s,void 0))}else if(l){if(n===o.get(s)[1])return t;r=a,i=o.set(s,[e,n])}else r=a.set(e,o.size),i=o.set(o.size,[e,n]);return t.__ownerID?(t.size=r.size,t._map=r,t._list=i,t.__hash=void 0,t):te(r,i)}function re(t,e){ this._iter=t,this._useKeys=e,this.size=t.size}function ie(t){this._iter=t,this.size=t.size}function ae(t){this._iter=t,this.size=t.size}function oe(t){this._iter=t,this.size=t.size}function se(t){var e=Me(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=Oe,e.__iterateUncached=function(e,n){var r=this;return t.__iterate(function(t,n){return e(n,t,r)!==!1},n)},e.__iteratorUncached=function(e,n){if(e===xn){var r=t.__iterator(e,n);return new w(function(){var t=r.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===wn?bn:wn,n)},e}function le(t,e,n){var r=Me(t);return r.size=t.size,r.has=function(e){return t.has(e)},r.get=function(r,i){var a=t.get(r,gn);return a===gn?i:e.call(n,a,r,t)},r.__iterateUncached=function(r,i){var a=this;return t.__iterate(function(t,i,o){return r(e.call(n,t,i,o),i,a)!==!1},i)},r.__iteratorUncached=function(r,i){var a=t.__iterator(xn,i);return new w(function(){var i=a.next();if(i.done)return i;var o=i.value,s=o[0];return x(r,s,e.call(n,o[1],s,t),i)})},r}function ue(t,e){var n=Me(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=se(t);return e.reverse=function(){return t.flip()},e}),n.get=function(n,r){return t.get(e?n:-1-n,r)},n.has=function(n){return t.has(e?n:-1-n)},n.includes=function(e){return t.includes(e)},n.cacheResult=Oe,n.__iterate=function(e,n){var r=this;return t.__iterate(function(t,n){return e(t,n,r)},!n)},n.__iterator=function(e,n){return t.__iterator(e,!n)},n}function ce(t,e,n,r){var i=Me(t);return r&&(i.has=function(r){var i=t.get(r,gn);return i!==gn&&!!e.call(n,i,r,t)},i.get=function(r,i){var a=t.get(r,gn);return a!==gn&&e.call(n,a,r,t)?a:i}),i.__iterateUncached=function(i,a){var o=this,s=0;return t.__iterate(function(t,a,l){if(e.call(n,t,a,l))return s++,i(t,r?a:s-1,o)},a),s},i.__iteratorUncached=function(i,a){var o=t.__iterator(xn,a),s=0;return new w(function(){for(;;){var a=o.next();if(a.done)return a;var l=a.value,u=l[0],c=l[1];if(e.call(n,c,u,t))return x(i,r?u:s++,c,a)}})},i}function fe(t,e,n){var r=ft().asMutable();return t.__iterate(function(i,a){r.update(e.call(n,i,a,t),0,function(t){return t+1})}),r.asImmutable()}function de(t,e,n){var r=o(t),i=(u(t)?Qt():ft()).asMutable();t.__iterate(function(a,o){i.update(e.call(n,a,o,t),function(t){return t=t||[],t.push(r?[o,a]:a),t})});var a=Ie(t);return i.map(function(e){return Se(t,a(e))})}function pe(t,e,n,r){var i=t.size;if(void 0!==e&&(e|=0),void 0!==n&&(n===1/0?n=i:n|=0),g(e,n,i))return t;var a=y(e,i),o=_(n,i);if(a!==a||o!==o)return pe(t.toSeq().cacheResult(),e,n,r);var s,l=o-a;l===l&&(s=l<0?0:l);var u=Me(t);return u.size=0===s?s:t.size&&s||void 0,!r&&N(t)&&s>=0&&(u.get=function(e,n){return e=m(this,e),e>=0&&es)return k();var t=i.next();return r||e===wn?t:e===bn?x(e,l-1,void 0,t):x(e,l-1,t.value[1],t)})},u}function he(t,e,n){var r=Me(t);return r.__iterateUncached=function(r,i){var a=this;if(i)return this.cacheResult().__iterate(r,i);var o=0;return t.__iterate(function(t,i,s){return e.call(n,t,i,s)&&++o&&r(t,i,a)}),o},r.__iteratorUncached=function(r,i){var a=this;if(i)return this.cacheResult().__iterator(r,i);var o=t.__iterator(xn,i),s=!0;return new w(function(){if(!s)return k();var t=o.next();if(t.done)return t;var i=t.value,l=i[0],u=i[1];return e.call(n,u,l,a)?r===xn?t:x(r,l,u,t):(s=!1,k())})},r}function me(t,e,n,r){var i=Me(t);return i.__iterateUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterate(i,a);var s=!0,l=0;return t.__iterate(function(t,a,u){if(!s||!(s=e.call(n,t,a,u)))return l++,i(t,r?a:l-1,o)}),l},i.__iteratorUncached=function(i,a){var o=this;if(a)return this.cacheResult().__iterator(i,a);var s=t.__iterator(xn,a),l=!0,u=0;return new w(function(){var t,a,c;do{if(t=s.next(),t.done)return r||i===wn?t:i===bn?x(i,u++,void 0,t):x(i,u++,t.value[1],t);var f=t.value;a=f[0],c=f[1],l&&(l=e.call(n,c,a,o))}while(l);return i===xn?t:x(i,a,c,t)})},i}function ve(t,e){var r=o(t),i=[t].concat(e).map(function(t){return a(t)?r&&(t=n(t)):t=r?q(t):U(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===i.length)return t;if(1===i.length){var l=i[0];if(l===t||r&&o(l)||s(t)&&s(l))return l}var u=new T(i);return r?u=u.toKeyedSeq():s(t)||(u=u.toSetSeq()),u=u.flatten(!0),u.size=i.reduce(function(t,e){if(void 0!==t){var n=e.size;if(void 0!==n)return t+n}},0),u}function ge(t,e,n){var r=Me(t);return r.__iterateUncached=function(r,i){function o(t,u){var c=this;t.__iterate(function(t,i){return(!e||u0}function ke(t,n,r){var i=Me(t);return i.size=new T(r).map(function(t){return t.size}).min(),i.__iterate=function(t,e){for(var n,r=this.__iterator(wn,e),i=0;!(n=r.next()).done&&t(n.value,i++,this)!==!1;);return i},i.__iteratorUncached=function(t,i){var a=r.map(function(t){return t=e(t),E(i?t.reverse():t)}),o=0,s=!1;return new w(function(){var e;return s||(e=a.map(function(t){return t.next()}),s=e.some(function(t){return t.done})),s?k():x(t,o++,n.apply(null,e.map(function(t){return t.value})))})},i}function Se(t,e){return N(t)?e:t.constructor(e)}function Ae(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Ee(t){return ct(t.size),h(t)}function Ie(t){return o(t)?n:s(t)?r:i}function Me(t){return Object.create((o(t)?C:s(t)?j:P).prototype)}function Oe(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Ce(t,e){return t>e?1:te?-1:0}function an(t){if(t.size===1/0)return 0;var e=u(t),n=o(t),r=e?1:0,i=t.__iterate(n?e?function(t,e){r=31*r+sn(at(t),at(e))|0}:function(t,e){r=r+sn(at(t),at(e))|0}:e?function(t){r=31*r+at(t)|0}:function(t){r=r+at(t)|0});return on(i,r)}function on(t,e){return e=jn(e,3432918353),e=jn(e<<15|e>>>-15,461845907),e=jn(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=jn(e^e>>>16,2246822507),e=jn(e^e>>>13,3266489909),e=it(e^e>>>16)}function sn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var ln=Array.prototype.slice;t(n,e),t(r,e),t(i,e),e.isIterable=a,e.isKeyed=o,e.isIndexed=s,e.isAssociative=l,e.isOrdered=u,e.Keyed=n,e.Indexed=r,e.Set=i;var un="@@__IMMUTABLE_ITERABLE__@@",cn="@@__IMMUTABLE_KEYED__@@",fn="@@__IMMUTABLE_INDEXED__@@",dn="@@__IMMUTABLE_ORDERED__@@",pn="delete",hn=5,mn=1<r?k():x(t,i,n[e?r-i++:i++])})},t(z,C),z.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},z.prototype.has=function(t){return this._object.hasOwnProperty(t)},z.prototype.__iterate=function(t,e){for(var n=this._object,r=this._keys,i=r.length-1,a=0;a<=i;a++){var o=r[e?i-a:a];if(t(n[o],o,this)===!1)return a+1}return a},z.prototype.__iterator=function(t,e){var n=this._object,r=this._keys,i=r.length-1,a=0;return new w(function(){var o=r[e?i-a:a];return a++>i?k():x(t,o,n[o])})},z.prototype[dn]=!0,t(D,j),D.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var n=this._iterable,r=E(n),i=0;if(A(r))for(var a;!(a=r.next()).done&&t(a.value,i++,this)!==!1;);return i},D.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var n=this._iterable,r=E(n);if(!A(r))return new w(k);var i=0;return new w(function(){var e=r.next();return e.done?e:x(t,i++,e.value)})},t(L,j),L.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var n=this._iterator,r=this._iteratorCache,i=0;i=r.length){var e=n.next();if(e.done)return e;r[i]=e.value}return x(t,i,r[i++])})};var In;t(X,j),X.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},X.prototype.get=function(t,e){return this.has(t)?this._value:e},X.prototype.includes=function(t){return Y(this._value,t)},X.prototype.slice=function(t,e){var n=this.size;return g(t,e,n)?this:new X(this._value,_(e,n)-y(t,n))},X.prototype.reverse=function(){return this},X.prototype.indexOf=function(t){return Y(this._value,t)?0:-1},X.prototype.lastIndexOf=function(t){return Y(this._value,t)?this.size:-1},X.prototype.__iterate=function(t,e){for(var n=0;n=0&&e=0&&nn?k():x(t,a++,o)})},Z.prototype.equals=function(t){return t instanceof Z?this._start===t._start&&this._end===t._end&&this._step===t._step:J(this,t)};var On;t(tt,e),t(et,tt),t(nt,tt),t(rt,tt),tt.Keyed=et,tt.Indexed=nt,tt.Set=rt;var Cn,jn="function"==typeof Math.imul&&Math.imul(4294967295,2)===-2?Math.imul:function(t,e){t|=0,e|=0;var n=65535&t,r=65535&e;return n*r+((t>>>16)*r+n*(e>>>16)<<16>>>0)|0},Pn=Object.isExtensible,Tn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),zn="function"==typeof WeakMap;zn&&(Cn=new WeakMap);var Dn=0,Ln="__immutablehash__";"function"==typeof Symbol&&(Ln=Symbol(Ln));var Nn=16,Fn=255,qn=0,Un={};t(ft,et),ft.of=function(){var t=ln.call(arguments,0);return xt().withMutations(function(e){for(var n=0;n=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}})},ft.prototype.toString=function(){return this.__toString("Map {","}")},ft.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},ft.prototype.set=function(t,e){return kt(this,t,e)},ft.prototype.setIn=function(t,e){return this.updateIn(t,gn,function(){return e})},ft.prototype.remove=function(t){return kt(this,t,gn)},ft.prototype.deleteIn=function(t){return this.updateIn(t,function(){return gn})},ft.prototype.update=function(t,e,n){return 1===arguments.length?t(this):this.updateIn([t],e,n)},ft.prototype.updateIn=function(t,e,n){n||(n=e,e=void 0);var r=zt(this,je(t),e,n);return r===gn?void 0:r},ft.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):xt()},ft.prototype.merge=function(){return Ct(this,void 0,arguments)},ft.prototype.mergeWith=function(t){var e=ln.call(arguments,1);return Ct(this,t,e)},ft.prototype.mergeIn=function(t){var e=ln.call(arguments,1);return this.updateIn(t,xt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},ft.prototype.mergeDeep=function(){return Ct(this,jt,arguments)},ft.prototype.mergeDeepWith=function(t){var e=ln.call(arguments,1);return Ct(this,Pt(t),e)},ft.prototype.mergeDeepIn=function(t){var e=ln.call(arguments,1);return this.updateIn(t,xt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},ft.prototype.sort=function(t){return Qt(be(this,t))},ft.prototype.sortBy=function(t,e){return Qt(be(this,e,t))},ft.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},ft.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new d)},ft.prototype.asImmutable=function(){return this.__ensureOwner()},ft.prototype.wasAltered=function(){return this.__altered},ft.prototype.__iterator=function(t,e){return new yt(this,t,e)},ft.prototype.__iterate=function(t,e){var n=this,r=0;return this._root&&this._root.iterate(function(e){return r++,t(e[1],e[0],n)},e),r},ft.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?wt(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},ft.isMap=dt;var Rn="@@__IMMUTABLE_MAP__@@",Bn=ft.prototype;Bn[Rn]=!0,Bn[pn]=Bn.remove,Bn.removeIn=Bn.deleteIn,pt.prototype.get=function(t,e,n,r){for(var i=this.entries,a=0,o=i.length;a=Hn)return It(t,l,r,i);var h=t&&t===this.ownerID,m=h?l:p(l);return d?s?u===c-1?m.pop():m[u]=m.pop():m[u]=[r,i]:m.push([r,i]),h?(this.entries=m,this):new pt(t,m)}},ht.prototype.get=function(t,e,n,r){void 0===e&&(e=at(n));var i=1<<((0===t?e:e>>>t)&vn),a=this.bitmap;return 0===(a&i)?r:this.nodes[Dt(a&i-1)].get(t+hn,e,n,r)},ht.prototype.update=function(t,e,n,r,i,a,o){void 0===n&&(n=at(r));var s=(0===e?n:n>>>e)&vn,l=1<=Gn)return Ot(t,d,u,s,h);if(c&&!h&&2===d.length&&At(d[1^f]))return d[1^f];if(c&&h&&1===d.length&&At(h))return h;var m=t&&t===this.ownerID,v=c?h?u:u^l:u|l,g=c?h?Lt(d,f,h,m):Ft(d,f,m):Nt(d,f,h,m);return m?(this.bitmap=v,this.nodes=g,this):new ht(t,v,g)},mt.prototype.get=function(t,e,n,r){void 0===e&&(e=at(n));var i=(0===t?e:e>>>t)&vn,a=this.nodes[i];return a?a.get(t+hn,e,n,r):r},mt.prototype.update=function(t,e,n,r,i,a,o){void 0===n&&(n=at(r));var s=(0===e?n:n>>>e)&vn,l=i===gn,u=this.nodes,c=u[s];if(l&&!c)return this;var f=St(c,t,e+hn,n,r,i,a,o);if(f===c)return this;var d=this.count;if(c){if(!f&&(d--,d=0&&t>>e&vn;if(r>=this.array.length)return new Rt([],t);var i,a=0===r;if(e>0){var o=this.array[r];if(i=o&&o.removeBefore(t,e-hn,n),i===o&&a)return this}if(a&&!i)return this;var s=Wt(this,t);if(!a)for(var l=0;l>>e&vn;if(r>=this.array.length)return this;var i;if(e>0){var a=this.array[r];if(i=a&&a.removeAfter(t,e-hn,n),i===a&&r===this.array.length-1)return this}var o=Wt(this,t);return o.array.splice(r+1),i&&(o.array[r]=i),o};var Yn,Jn={};t(Qt,ft),Qt.of=function(){return this(arguments)},Qt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Qt.prototype.get=function(t,e){var n=this._map.get(t);return void 0!==n?this._list.get(n)[1]:e},Qt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):ee()},Qt.prototype.set=function(t,e){return ne(this,t,e)},Qt.prototype.remove=function(t){return ne(this,t,gn)},Qt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Qt.prototype.__iterate=function(t,e){var n=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],n)},e)},Qt.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Qt.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._list.__ensureOwner(t);return t?te(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=n,this)},Qt.isOrderedMap=Zt,Qt.prototype[dn]=!0,Qt.prototype[pn]=Qt.prototype.remove;var Xn;t(re,C),re.prototype.get=function(t,e){return this._iter.get(t,e)},re.prototype.has=function(t){return this._iter.has(t)},re.prototype.valueSeq=function(){return this._iter.valueSeq()},re.prototype.reverse=function(){var t=this,e=ue(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},re.prototype.map=function(t,e){var n=this,r=le(this,t,e);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(t,e)}),r},re.prototype.__iterate=function(t,e){var n,r=this;return this._iter.__iterate(this._useKeys?function(e,n){return t(e,n,r)}:(n=e?Ee(this):0,function(i){return t(i,e?--n:n++,r)}),e)},re.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var n=this._iter.__iterator(wn,e),r=e?Ee(this):0;return new w(function(){var i=n.next();return i.done?i:x(t,e?--r:r++,i.value,i)})},re.prototype[dn]=!0,t(ie,j),ie.prototype.includes=function(t){return this._iter.includes(t)},ie.prototype.__iterate=function(t,e){var n=this,r=0;return this._iter.__iterate(function(e){return t(e,r++,n)},e)},ie.prototype.__iterator=function(t,e){var n=this._iter.__iterator(wn,e),r=0;return new w(function(){var e=n.next();return e.done?e:x(t,r++,e.value,e)})},t(ae,P),ae.prototype.has=function(t){return this._iter.includes(t)},ae.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){return t(e,e,n)},e)},ae.prototype.__iterator=function(t,e){var n=this._iter.__iterator(wn,e);return new w(function(){var e=n.next();return e.done?e:x(t,e.value,e.value,e)})},t(oe,C),oe.prototype.entrySeq=function(){return this._iter.toSeq()},oe.prototype.__iterate=function(t,e){var n=this;return this._iter.__iterate(function(e){if(e){Ae(e);var r=a(e);return t(r?e.get(1):e[1],r?e.get(0):e[0],n)}},e)},oe.prototype.__iterator=function(t,e){var n=this._iter.__iterator(wn,e);return new w(function(){for(;;){var e=n.next();if(e.done)return e;var r=e.value;if(r){Ae(r);var i=a(r);return x(t,i?r.get(0):r[0],i?r.get(1):r[1],e)}}})},ie.prototype.cacheResult=re.prototype.cacheResult=ae.prototype.cacheResult=oe.prototype.cacheResult=Oe,t(Pe,et),Pe.prototype.toString=function(){return this.__toString(ze(this)+" {","}")},Pe.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},Pe.prototype.get=function(t,e){if(!this.has(t))return e;var n=this._defaultValues[t];return this._map?this._map.get(t,n):n},Pe.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=Te(this,xt()))},Pe.prototype.set=function(t,e){if(!this.has(t))throw new Error('Cannot set unknown key "'+t+'" on '+ze(this));if(this._map&&!this._map.has(t)){var n=this._defaultValues[t];if(e===n)return this}var r=this._map&&this._map.set(t,e);return this.__ownerID||r===this._map?this:Te(this,r)},Pe.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:Te(this,e)},Pe.prototype.wasAltered=function(){return this._map.wasAltered()},Pe.prototype.__iterator=function(t,e){var r=this;return n(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},Pe.prototype.__iterate=function(t,e){var r=this;return n(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},Pe.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?Te(this,e,t):(this.__ownerID=t,this._map=e,this)};var Qn=Pe.prototype;Qn[pn]=Qn.remove,Qn.deleteIn=Qn.removeIn=Bn.removeIn,Qn.merge=Bn.merge,Qn.mergeWith=Bn.mergeWith,Qn.mergeIn=Bn.mergeIn,Qn.mergeDeep=Bn.mergeDeep,Qn.mergeDeepWith=Bn.mergeDeepWith,Qn.mergeDeepIn=Bn.mergeDeepIn,Qn.setIn=Bn.setIn,Qn.update=Bn.update,Qn.updateIn=Bn.updateIn,Qn.withMutations=Bn.withMutations,Qn.asMutable=Bn.asMutable,Qn.asImmutable=Bn.asImmutable,t(Ne,rt),Ne.of=function(){return this(arguments)},Ne.fromKeys=function(t){return this(n(t).keySeq())},Ne.prototype.toString=function(){return this.__toString("Set {","}")},Ne.prototype.has=function(t){return this._map.has(t)},Ne.prototype.add=function(t){return qe(this,this._map.set(t,!0))},Ne.prototype.remove=function(t){return qe(this,this._map.remove(t))},Ne.prototype.clear=function(){return qe(this,this._map.clear())},Ne.prototype.union=function(){var t=ln.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var n=0;n=0;n--)e={value:arguments[n],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):$e(t,e)},Ke.prototype.pushAll=function(t){if(t=r(t),0===t.size)return this;ct(t.size);var e=this.size,n=this._head;return t.reverse().forEach(function(t){e++,n={value:t,next:n}}),this.__ownerID?(this.size=e,this._head=n,this.__hash=void 0,this.__altered=!0,this):$e(e,n)},Ke.prototype.pop=function(){return this.slice(1)},Ke.prototype.unshift=function(){return this.push.apply(this,arguments)},Ke.prototype.unshiftAll=function(t){return this.pushAll(t)},Ke.prototype.shift=function(){return this.pop.apply(this,arguments)},Ke.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Ye()},Ke.prototype.slice=function(t,e){if(g(t,e,this.size))return this;var n=y(t,this.size),r=_(e,this.size);if(r!==this.size)return nt.prototype.slice.call(this,t,e);for(var i=this.size-n,a=this._head;n--;)a=a.next;return this.__ownerID?(this.size=i,this._head=a,this.__hash=void 0,this.__altered=!0,this):$e(i,a)},Ke.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?$e(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ke.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var n=0,r=this._head;r&&t(r.value,n++,this)!==!1;)r=r.next;return n},Ke.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var n=0,r=this._head;return new w(function(){if(r){var e=r.value;return r=r.next,x(t,n++,e)}return k()})},Ke.isStack=We;var ir="@@__IMMUTABLE_STACK__@@",ar=Ke.prototype;ar[ir]=!0,ar.withMutations=Bn.withMutations,ar.asMutable=Bn.asMutable,ar.asImmutable=Bn.asImmutable,ar.wasAltered=Bn.wasAltered;var or;e.Iterator=w,Je(e,{toArray:function(){ct(this.size);var t=new Array(this.size||0);return this.valueSeq().__iterate(function(e,n){t[n]=e}),t},toIndexedSeq:function(){return new ie(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new re(this,!0)},toMap:function(){return ft(this.toKeyedSeq())},toObject:function(){ct(this.size);var t={};return this.__iterate(function(e,n){t[n]=e}),t},toOrderedMap:function(){return Qt(this.toKeyedSeq())},toOrderedSet:function(){return Be(o(this)?this.valueSeq():this)},toSet:function(){return Ne(o(this)?this.valueSeq():this)},toSetSeq:function(){return new ae(this)},toSeq:function(){return s(this)?this.toIndexedSeq():o(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Ke(o(this)?this.valueSeq():this)},toList:function(){return qt(o(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){var t=ln.call(arguments,0);return Se(this,ve(this,t))},includes:function(t){return this.some(function(e){return Y(e,t)})},entries:function(){return this.__iterator(xn)},every:function(t,e){ct(this.size);var n=!0;return this.__iterate(function(r,i,a){if(!t.call(e,r,i,a))return n=!1,!1}),n},filter:function(t,e){return Se(this,ce(this,t,e,!0))},find:function(t,e,n){var r=this.findEntry(t,e);return r?r[1]:n},forEach:function(t,e){return ct(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){ct(this.size),t=void 0!==t?""+t:",";var e="",n=!0;return this.__iterate(function(r){n?n=!1:e+=t,e+=null!==r&&void 0!==r?r.toString():""}),e},keys:function(){return this.__iterator(bn)},map:function(t,e){return Se(this,le(this,t,e))},reduce:function(t,e,n){ct(this.size);var r,i;return arguments.length<2?i=!0:r=e,this.__iterate(function(e,a,o){i?(i=!1,r=e):r=t.call(n,r,e,a,o)}),r},reduceRight:function(t,e,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Se(this,ue(this,!0))},slice:function(t,e){return Se(this,pe(this,t,e,!0))},some:function(t,e){return!this.every(Ze(t),e)},sort:function(t){return Se(this,be(this,t))},values:function(){return this.__iterator(wn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return h(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return fe(this,t,e)},equals:function(t){return J(this,t)},entrySeq:function(){var t=this;if(t._cache)return new T(t._cache);var e=t.toSeq().map(Qe).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Ze(t),e)},findEntry:function(t,e,n){var r=n;return this.__iterate(function(n,i,a){if(t.call(e,n,i,a))return r=[i,n],!1}),r},findKey:function(t,e){var n=this.findEntry(t,e);return n&&n[0]},findLast:function(t,e,n){return this.toKeyedSeq().reverse().find(t,e,n)},findLastEntry:function(t,e,n){return this.toKeyedSeq().reverse().findEntry(t,e,n)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(v)},flatMap:function(t,e){return Se(this,ye(this,t,e))},flatten:function(t){return Se(this,ge(this,t,!0))},fromEntrySeq:function(){return new oe(this)},get:function(t,e){return this.find(function(e,n){return Y(n,t)},void 0,e)},getIn:function(t,e){for(var n,r=this,i=je(t);!(n=i.next()).done;){var a=n.value;if(r=r&&r.get?r.get(a,gn):gn,r===gn)return e}return r},groupBy:function(t,e){return de(this,t,e)},has:function(t){return this.get(t,gn)!==gn},hasIn:function(t){return this.getIn(t,gn)!==gn},isSubset:function(t){return t="function"==typeof t.includes?t:e(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return t="function"==typeof t.isSubset?t:e(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(e){return Y(e,t)})},keySeq:function(){return this.toSeq().map(Xe).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return we(this,t)},maxBy:function(t,e){return we(this,e,t)},min:function(t){return we(this,t?tn(t):rn)},minBy:function(t,e){return we(this,e?tn(e):rn,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return Se(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return Se(this,me(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Ze(t),e)},sortBy:function(t,e){return Se(this,be(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return Se(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return Se(this,he(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Ze(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=an(this))}});var sr=e.prototype;sr[un]=!0,sr[An]=sr.values,sr.__toJS=sr.toArray,sr.__toStringMapper=en,sr.inspect=sr.toSource=function(){return this.toString()},sr.chain=sr.flatMap,sr.contains=sr.includes,Je(n,{flip:function(){return Se(this,se(this))},mapEntries:function(t,e){var n=this,r=0;return Se(this,this.toSeq().map(function(i,a){return t.call(e,[a,i],r++,n)}).fromEntrySeq())},mapKeys:function(t,e){var n=this;return Se(this,this.toSeq().flip().map(function(r,i){return t.call(e,r,i,n)}).flip())}});var lr=n.prototype;lr[cn]=!0,lr[An]=sr.entries,lr.__toJS=sr.toObject,lr.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+en(t)},Je(r,{toKeyedSeq:function(){return new re(this,!1)},filter:function(t,e){return Se(this,ce(this,t,e,!1))},findIndex:function(t,e){var n=this.findEntry(t,e);return n?n[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Se(this,ue(this,!1))},slice:function(t,e){return Se(this,pe(this,t,e,!1))},splice:function(t,e){var n=arguments.length;if(e=Math.max(0|e,0),0===n||2===n&&!e)return this;t=y(t,t<0?this.count():this.size);var r=this.slice(0,t);return Se(this,1===n?r:r.concat(p(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var n=this.findLastEntry(t,e);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(t){return Se(this,ge(this,t,!1))},get:function(t,e){return t=m(this,t),t<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,n){return n===t},void 0,e)},has:function(t){return t=m(this,t),t>=0&&(void 0!==this.size?this.size===1/0||t=1e4)return d(t,e,n);var l=a.diff(t,e),f=0;return l.forEach(function(t){if("="===t.op)f++;else if("!="===t.op){if(c(t.val)&&c(t.newVal)){var e=d(t.val,t.newVal,s(o,f));i=i.concat(e)}else i.push(u("replace",s(o,f),t.newVal));f++}else"+"===t.op?(i.push(u("add",s(o,f),t.val)),f++):"-"===t.op&&i.push(u("remove",s(o,f)))}),i},h=function(t,e,n){var r=n||"";return t===e?[]:[u("replace",s(r,""),e)]},m=function(t,e,n){return r.is(t,e)?r.List():t==e||null!=t&&null!=e?f(t)&&f(e)?r.fromJS(p(t,e)):c(t)&&c(e)?r.fromJS(d(t,e)):r.fromJS(h(t,e,n)):r.fromJS([u("replace","/",e)])};t.exports=m},function(t,e,n){"use strict";var r=n(426),i=function(t){return r.Iterable.isKeyed(t)},a=function(t){return r.Iterable.isIndexed(t)},o=function(t,e,n){return"remove"===t?{op:t,path:e}:{op:t,path:e,value:n}};t.exports={isMap:i,isIndexed:a,op:o}},function(t,e,n){"use strict";function r(t,e){for(var n=t.size||0,r=e.size||0,o=a(n+1,r+1,0),s=0;s=0||c>=0;)u>=0&&c>=0&&i.is(e.get(u),n.get(c))?(o.push(new s({op:"=",val:e.get(u)})),u-=1,c-=1):u>=0&&c>=0&&u===c&&!i.is(e.get(u),n.get(c))?(o.push(new l({val:e.get(u),newVal:n.get(u)})),u-=1,c-=1):c>=0&&(u===-1||t[u+1][c]>=t[u][c+1])?(o.push(new s({op:"+",val:n.get(c)})),c-=1):u>=0&&(c===-1||t[u+1][c]');n.append(i)}),t=!0,!0)})})}},{key:"addedNodes",value:function(t){var e=this;t.forEach(function(t){"childList"===t.type&&(t.addedNodes&&(0,s.default)("body").trigger("mutation._grav",t.target,t,e),t.removedNodes&&(0,s.default)("body").trigger("mutation_removed._grav",{target:t.target,mutation:t},e))})}}]),e}();e.default=l;e.Instance=new l("form#blueprints")}).call(e,function(){return this}())},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(433),a=r(i),o=n(434),s=r(o),l=n(435),u=r(l),c=n(436),f=r(c),d=n(437),p=r(d),h=n(358),m=r(h),v=n(545),g=r(v),y=n(355),_=r(y),b=n(550),w=r(b),x=n(553),k=r(x),S=n(554),A=r(S);e.default={FilepickerField:{FilepickerField:a.default,Instance:i.Instance},SelectizeField:{SelectizeField:s.default,Instance:o.Instance},ArrayField:{ArrayField:u.default,Instance:l.Instance},CollectionsField:{CollectionsField:f.default,Instance:c.Instance},DateTimeField:{DateTimeField:p.default,Instance:d.Instance},EditorField:{EditorField:m.default,Instance:h.Instance},ColorpickerField:{ColorpickerField:g.default,Instance:v.Instance},FilesField:{FilesField:_.default,Instance:y.Instance},SelectUniqueField:{SelectUniqueField:A.default,Instance:S.Instance},MediapickerField:{MediapickerField:w.default,Instance:b.Instance},MultilevelField:{MultilevelField:k.default,Instance:x.Instance}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instance=void 0;var a=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"all",r=l.config.current_url+(".json/task"+l.config.param_sep+"getFilesInFolder"),o=t.closest("[data-grav-filepicker]"),s=o.data("name"),u=o.data("value");(0,c.default)(r,{method:"post",body:{name:s}},function(t){if("undefined"!=typeof t.files){var r=[];a=t.thumbs||{};for(var o=0;o0,d=!1,p=function(t,e){var n="";if(u&&i&&(!t.status||"available"===t.status)&&t.name.match(/\.(jpg|jpeg|png|gif)$/i)){var r=f(l.config.base_url_relative+"/../"+i+"/"+t.name,-4,"@2x"),o=f(l.config.base_url_relative+"/../"+i+"/"+t.name,-4,"@3x"),s=a[t.name]||l.config.base_url_relative+"/../"+i+"/"+t.name;n='\n "}return'
\n \n '+n+' '+e(t.name)+"\n \n
"};r.selectize({valueField:"name",labelField:"name",searchField:"name",optgroups:[{$order:1,value:"pending",label:"Pending"},{$order:2,value:"available",label:"Available"}],optgroupField:"status",create:!1,preload:!1,render:{option:function(t,e){return p(t,e)},item:function(t,e){return p(t,e)}},onInitialize:function(){this.load(function(t){return o(r,function(e){return t(e)},"selected")})},onLoad:function(){if(!d){var t=this.getValue();this.updateOption(t,{name:t}),d=!0}},onFocus:function(){this.load(function(t){return o(r,function(e){return t(e)})})}})}}}]),t}();e.default=d;e.Instance=new d},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instance=void 0;var a=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};i(this,t),this.options=Object.assign({},n),this.elements=[],(0,s.default)("[data-grav-selectize]").each(function(t,n){return e.add(n)}),(0,s.default)("body").on("mutation._grav",this._onAddedNodes.bind(this))}return a(t,[{key:"add",value:function(t){t=(0,s.default)(t);var e=t.prop("tagName").toLowerCase(),n="input"===e||"select"===e,r=(n?t.closest("[data-grav-selectize]"):t).data("grav-selectize")||{},i=n?t:t.find("input, select");i.length&&!i.get(0).selectize&&(i.selectize(r),this.elements.push(i.data("selectize")))}},{key:"_onAddedNodes",value:function(t,e){var n=this,r=(0,s.default)(e).find("select.fancy, input.fancy, [data-grav-selectize]");r.length&&r.each(function(t,e){return n.add(e)})}}]),t}();e.default=l;e.Instance=new l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instance=void 0;var a=function(){function t(t,e){for(var n=0;n\n \n \n ':'\n
\n \n \n \n ',t+='\n \n \n
'}}]),t}(),d=function(){function t(){var e=this;i(this,t),c.on("input",'[data-grav-array-type="key"], [data-grav-array-type="value"]',function(t){return e.actionInput(t)}),c.on("click touch",'[data-grav-array-action]:not([data-grav-array-action="sort"])',function(t){return e.actionEvent(t)}),this.arrays=(0,s.default)(),(0,s.default)('[data-grav-field="array"]').each(function(t,n){return e.addArray(n)}),(0,s.default)("body").on("mutation._grav",this._onAddedNodes.bind(this))}return a(t,[{key:"addArray",value:function(t){t=(0,s.default)(t),t.find('[data-grav-array-type="container"]').each(function(t,e){e=(0,s.default)(e),e.data("array-sort")||e[0].hasAttribute("data-array-nosort")||e.data("array-sort",new u.default(e.get(0),{handle:".fa-bars",animation:150}))})}},{key:"actionInput",value:function(t){var e=(0,s.default)(t.target),n=e.data("grav-array-type");this._setTemplate(e);var r=e.data("array-template"),i="key"===n?e:e.siblings('[data-grav-array-type="key"]:first'),a="value"===n?e:e.siblings('[data-grav-array-type="value"]:first'),o=r.isValueOnly()?this.getIndexFor(e):i.val();o=o.toString().replace(/\[/g,"%5B").replace(/]/g,"%5D");var l=r.getName()+"["+o+"]";a.attr("name",a.val()?l:r.getName()),this.refreshNames(r)}},{key:"actionEvent",value:function(t){t&&t.preventDefault();var e=(0,s.default)(t.target),n=e.data("grav-array-action"),r=e.parents('[data-grav-array-type="container"]');this._setTemplate(e),this[n+"Action"](e);var i=r.find("> div");r[i.length>1?"removeClass":"addClass"]("one-child")}},{key:"addAction",value:function(t){var e=t.data("array-template"),n=t.closest('[data-grav-array-type="row"]');n.after(e.getNewRow())}},{key:"remAction",value:function(t){var e=t.data("array-template"),n=t.closest('[data-grav-array-type="row"]'),r=!n.siblings().length;if(r){var i=(0,s.default)(e.getNewRow());n.after(i),i.find('[data-grav-array-type="value"]:last').attr("name",e.getName())}n.remove(),this.refreshNames(e)}},{key:"refreshNames",value:function(t){if(t.isValueOnly()){var e=t.container.find('> div > [data-grav-array-type="row"]'),n=e.find('[name]:not([name=""])');n.each(function(t,e){e=(0,s.default)(e);var n=e.attr("name");n=n.replace(/\[\d+\]$/,"["+t+"]"),e.attr("name",n)}),n.length||e.find('[data-grav-array-type="value"]').attr("name",t.getName())}}},{key:"getIndexFor",value:function(t){var e=t.data("array-template"),n=t.closest('[data-grav-array-type="row"]');return e.container.find((e.isValueOnly()?"> div ":"")+' > [data-grav-array-type="row"]').index(n)}},{key:"_setTemplate",value:function(t){t.data("array-template")||t.data("array-template",new f(t.closest("[data-grav-array-name]")))}},{key:"_onAddedNodes",value:function(t,e){var n=this,r=(0,s.default)(e).find('[data-grav-field="array"]');r.length&&r.each(function(t,e){e=(0,s.default)(e),~n.arrays.index(e)||n.addArray(e)})}}]),t}();e.default=d;e.Instance=new d},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instance=void 0;var a=function(){function t(t,e){for(var n=0;n .collection-actions [data-action="add"]',function(t){return e.addItem(t)}),t.on("click",'> ul > li > .item-actions [data-action="delete"]',function(t){return e.removeItem(t)}),t.on("click",'> ul > li > .item-actions [data-action="collapse"]',function(t){return e.collapseItem(t)}),t.on("click",'> ul > li > .item-actions [data-action="expand"]',function(t){return e.expandItem(t)}),t.on("click",'> .collection-actions [data-action-sort="date"]',function(t){return e.sortItems(t)}),t.on("click",'> .collection-actions [data-action="collapse_all"]',function(t){return e.collapseItems(t)}),t.on("click",'> .collection-actions [data-action="expand_all"]',function(t){return e.expandItems(t)}),t.on("input change","[data-key-observe]",function(t){return e.observeKey(t)}),t.find("[data-collection-holder]").each(function(t,n){n=(0,s.default)(n),n.data("collection-sort")||n[0].hasAttribute("data-collection-nosort")||n.data("collection-sort",new u.default(n.get(0),{forceFallback:!1,handle:".collection-sort",animation:150,filter:".CodeMirror, .grav-editor-resizer",onUpdate:function(){return e.reindex(n)}}))}),this._updateActionsStateBasedOnMinMax(t)}},{key:"addItem",value:function(t){var e=(0,s.default)(t.currentTarget),n=e.data("action-add")||"bottom",r=(0,s.default)(e.closest('[data-type="collection"]')),i=(0,s.default)(r.find('> [data-collection-template="new"]').data("collection-template-html"));this._updateActionsStateBasedOnMinMax(r);var a=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]"),o=r.data("max");if(!("undefined"!=typeof o&&a.length>=o)){r.find("> [data-collection-holder]")["top"===n?"prepend":"append"](i),this.reindex(r),a=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]");var l=r.closest('[data-type="collection"]').find('[data-action-add="top"]'),u=r.closest('[data-type="collection"]').find('[data-action="sort"]');a.length&&(l.length&&l.parent().removeClass("hidden"),u.length&&a.length>1&&u.removeClass("hidden")),(0,s.default)('[data-grav-field="toggleable"] input[type="checkbox"]').trigger("change")}}},{key:"removeItem",value:function(t){var e=(0,s.default)(t.currentTarget),n=e.closest("[data-collection-item]"),r=(0,s.default)(e.closest('[data-type="collection"]')),i=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]"),a=r.data("min");if(!("undefined"!=typeof a&&i.length<=a)){n.remove(),this.reindex(r),i=r.closest('[data-type="collection"]').find("> ul > [data-collection-item]");var o=r.closest('[data-type="collection"]').find('[data-action-add="top"]'),l=r.closest('[data-type="collection"]').find('[data-action="sort"]');i.length||o.length&&o.parent().addClass("hidden"),l.length&&i.length<=1&&l.addClass("hidden"),this._updateActionsStateBasedOnMinMax(r)}}},{key:"collapseItems",value:function(t){var e=(0,s.default)(t.currentTarget),n=(0,s.default)(e.closest('[data-type="collection"]')).find('> ul > [data-collection-item] > .item-actions [data-action="collapse"]');n.click()}},{key:"collapseItem",value:function(t){var e=(0,s.default)(t.currentTarget),n=e.closest("[data-collection-item]");e.attr("data-action","expand").removeClass("fa-chevron-circle-down").addClass("fa-chevron-circle-right"),n.addClass("collection-collapsed")}},{key:"expandItems",value:function(t){ -var e=(0,s.default)(t.currentTarget),n=(0,s.default)(e.closest('[data-type="collection"]')).find('> ul > [data-collection-item] > .item-actions [data-action="expand"]');n.click()}},{key:"expandItem",value:function(t){var e=(0,s.default)(t.currentTarget),n=e.closest("[data-collection-item]");e.attr("data-action","collapse").removeClass("fa-chevron-circle-right").addClass("fa-chevron-circle-down"),n.removeClass("collection-collapsed")}},{key:"sortItems",value:function(t){var e=(0,s.default)(t.currentTarget),n=e.data("action-sort"),r=e.data("action-sort-dir")||"asc",i=(0,s.default)(e.closest('[data-type="collection"]')),a=i.closest('[data-type="collection"]').find("> ul > [data-collection-item]");a.sort(function(t,e){var i=(0,s.default)(t).find('[name$="['+n+']"]'),a=(0,s.default)(e).find('[name$="['+n+']"]'),o=void 0;return o="asc"===r?i.val()a.val()?1:0:i.val()>a.val()?-1:i.val() ul > [data-collection-item]"),e.each(function(t,e){e=(0,s.default)(e);var n=e.find("[data-key-observe]"),r=n.val(),i=n.length,a=e.data("collection-key-backup");e.attr("data-collection-key",i?r:t),["name","data-grav-field-name","for","id","data-grav-file-settings"].forEach(function(t){e.find("["+t+"], [_"+t+"]").each(function(){var e=(0,s.default)(this),n=[],o=[new RegExp("\\[(\\d+|\\*|"+a+")\\]","g"),new RegExp("\\.(\\d+|\\*|"+a+")\\.","g")];if(i&&!r)return e.attr("_"+t,e.attr(t)),void e.attr(t,null);e.attr("_"+t)&&(e.attr(t,e.attr("_"+t)),e.attr("_"+t,null)),e.parents("[data-collection-key]").map(function(t,e){return n.push((0,s.default)(e).attr("data-collection-key"))}),n.reverse();var l=a,u=e.attr(t).replace(o[0],function(){return l=n.shift()||l,"["+l+"]"});u=u.replace(o[1],function(){return l=n.shift()||l,"."+l+"."}),e.attr(t,u)})})}),e.find('input[type="radio"][checked]').each(function(t,e){e.checked=!0})}},{key:"_onAddedNodes",value:function(t,e){var n=this,r=(0,s.default)(e).find('[data-type="collection"]');r.length&&r.each(function(t,e){e=(0,s.default)(e),~n.lists.index(e)||n.addList(e)})}},{key:"_updateActionsStateBasedOnMinMax",value:function(t){var e=t.closest('[data-type="collection"]').find("> ul > [data-collection-item]"),n=t.data("min"),r=t.data("max");t.find('> .collection-actions [data-action="add"]').attr("disabled",!1),t.find('> ul > li > .item-actions [data-action="delete"]').attr("disabled",!1),"undefined"!=typeof n&&e.length<=n&&t.find('> ul > li > .item-actions [data-action="delete"]').attr("disabled",!0),"undefined"!=typeof r&&e.length>=r&&t.find('> .collection-actions [data-action="add"]').attr("disabled",!0)}}]),t}();e.default=c;e.Instance=new c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instance=void 0;var a=function(){function t(t,e){for(var n=0;n-1,h=(0,s.default)("body"),m="mousedown touchstart MSPointerDown pointerdown",v="mousemove touchmove MSPointerMove pointermove",g="mouseup touchend MSPointerUp pointerup",y=p?"focus":"focusin",_=function(){function t(e){var n=this;i(this,t),this.selector=e,this.field=(0,s.default)(this.selector),this.options=Object.assign({},this.field.data("grav-colorpicker")),this.built=!1,this.attach(),this.options.update&&this.field.on("change._grav_colorpicker",function(t,e,r,i){var a=r,o=(0,d.hex2rgb)(r);i<1&&(a="rgba("+o.r+", "+o.g+", "+o.b+", "+i+")");var s=e.closest(n.options.update);s.length||(s=e.siblings(n.options.update)),s.length||(s=e.parent(".g-colorpicker").find(n.options.update)),s.css({backgroundColor:a})})}return a(t,[{key:"attach",value:function(){var t=this;h.on(y,this.selector,function(e){return t.show(e,e.currentTarget)}),h.on(m,this.selector+" .g-colorpicker, "+this.selector+" .g-colorpicker i",this.bound("iconClick")),h.on("keydown",this.selector,function(e){switch(e.keyCode){case 9:t.hide();break;case 13:case 27:t.hide(),e.currentTarget.blur()}return!0}),h.on("keyup",this.selector,function(e){return t.updateFromInput(!0,e.currentTarget),!0}),h.on("paste",this.selector,function(e){setTimeout(function(){return t.updateFromInput(!0,e.currentTarget)},1)})}},{key:"show",value:function(t,e){e=(0,s.default)(e),this.built||this.build(),this.element=e,this.reposition(),this.wrapper.addClass("cp-visible"),this.updateFromInput();var n=(0,s.default)("#admin-main .content-wrapper").data("scrollbar").getViewElement();this.wrapper.on(m,".cp-grid, .cp-slider, .cp-opacity-slider",this.bound("bodyDown")),h.on(v,this.bound("bodyMove")),h.on(m,this.bound("bodyClick")),h.on(g,this.bound("targetReset")),(0,s.default)(n).on("scroll",this.bound("reposition"))}},{key:"hide",value:function(){if(this.built){this.wrapper.removeClass("cp-visible");var t=(0,s.default)("#admin-main .content-wrapper").data("scrollbar").getViewElement();this.wrapper.undelegate(m,".cp-grid, .cp-slider, .cp-opacity-slider",this.bound("bodyDown")),h.off(v,this.bound("bodyMove")),h.off(m,this.bound("bodyClick")),h.off(g,this.bound("targetReset")),(0,s.default)(t).off("scroll",this.bound("reposition"))}}},{key:"build",value:function(){var t=this;this.wrapper=(0,s.default)('
'),this.slider=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')),this.opacitySlider=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')),this.grid=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')).append((0,s.default)('
')),(0,s.default)("
").appendTo(this.grid.find(".cp-picker"));var e=(0,s.default)('
').appendTo(this.wrapper);this.tabs={hue:(0,s.default)('
').text("HUE").appendTo(e),brightness:(0,s.default)('
').text("BRI").appendTo(e),saturation:(0,s.default)('
').text("SAT").appendTo(e),wheel:(0,s.default)('
').text("WHEEL").appendTo(e),transparent:(0,s.default)('
').text("TRANSPARENT").appendTo(e)},e.on(m,"> div",function(n){var r=(0,s.default)(n.currentTarget);if(r.is(t.tabs.transparent)){var i=t.opacitySlider.height();return t.opacity=0,t.opacitySlider.find(".cp-picker").css({top:(0,u.default)(i-i*t.opacity,0,i)}),void t.move(t.opacitySlider,{manualOpacity:!0})}var a=e.find(".active"),o=a.attr("class").replace(/\s|active|cp-tab-/g,""),l=r.attr("class").replace(/\s|active|cp-tab-/g,"");t.wrapper.removeClass("cp-mode-"+o).addClass("cp-mode-"+l),a.removeClass("active"),r.addClass("active"),t.mode=l,t.updateFromInput()}),this.wrapper.appendTo(".content-wrapper"),this.built=!0,this.mode="hue"}},{key:"reposition",value:function(){var t=(0,s.default)(".content-wrapper")[0],e=this.element[0].getBoundingClientRect(),n=t.getBoundingClientRect(),r={x:0,y:0};this.options.offset&&(r.x=this.options.offset.x||0,r.y=this.options.offset.y||0),this.wrapper.css({top:e.top+e.height+t.scrollTop-n.top+r.y,left:e.left+t.scrollLeft-n.left+r.x})}},{key:"iconClick",value:function(t){if(this.wrapper&&this.wrapper.hasClass("cp-visible"))return!0;t&&t.preventDefault();var e=(0,s.default)(t.currentTarget).find("input");setTimeout(function(){return e.focus()},50)}},{key:"bodyMove",value:function(t){t&&t.preventDefault(),this.target&&this.move(this.target,t)}},{key:"bodyClick",value:function(t){var e=(0,s.default)(t.target);e.closest(".cp-wrapper").length||e.is(this.selector)||this.hide()}},{key:"bodyDown",value:function(t){t&&t.preventDefault(),this.target=(0,s.default)(t.currentTarget),this.move(this.target,t,!0)}},{key:"targetReset",value:function(t){t&&t.preventDefault(),this.target=null}},{key:"move",value:function(t,e){var n=this.element,r=t.find(".cp-picker"),i=t[0].getBoundingClientRect(),a=i.left+window.scrollX,o=i.top+window.scrollY,s=Math.round((e?e.pageX:0)-a),l=Math.round((e?e.pageY:0)-o),u=void 0,c=void 0,f=void 0,d=void 0,p=e.changedTouches||e.originalEvent&&e.originalEvent.changedTouches;e&&p&&(s=(p?p[0].pageX:0)-a,l=(p?p[0].pageY:0)-o),e&&e.manualOpacity&&(l=i.height),s<0&&(s=0),l<0&&(l=0),s>i.width&&(s=i.width),l>i.height&&(l=i.height),t.parent(".cp-mode-wheel").length&&r.parent(".cp-grid").length&&(u=75-s,c=75-l,f=Math.sqrt(u*u+c*c),d=Math.atan2(c,u),d<0&&(d+=2*Math.PI),f>75&&(s=75-75*Math.cos(d),l=75-75*Math.sin(d)),s=Math.round(s),l=Math.round(l)),t.hasClass("cp-grid")?(r.css({top:l,left:s}),this.updateFromPicker(n,t)):(r.css({top:l}),this.updateFromPicker(n,t))}},{key:"updateFromInput",value:function(t,e){e=e?(0,s.default)(e):this.element;var n=e.val(),r=n.replace(/\s/g,"").match(/^rgba?\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},(.+)\)/),i=void 0,a=void 0;if(n=(0,d.rgbstr2hex)(n)||n,r=r?(0,u.default)(r[1],0,1):1,(i=(0,d.parseHex)(n))||(i="#ffffff"),a=(0,d.hex2hsb)(i),this.built){this.opacity=r;var o=this.opacitySlider.height();this.opacitySlider.find(".cp-picker").css({top:(0,u.default)(o-o*this.opacity,0,o)});var l=this.grid.height(),c=this.grid.width(),f=void 0,p=void 0,h=void 0,m=void 0;switch(o=this.slider.height(),this.mode){case"wheel":f=(0,u.default)(Math.ceil(.75*a.s),0,l/2),p=a.h*Math.PI/180,h=(0,u.default)(75-Math.cos(p)*f,0,c),m=(0,u.default)(75-Math.sin(p)*f,0,l),this.grid.css({backgroundColor:"transparent"}).find(".cp-picker").css({top:m,left:h}),m=150-a.b/(100/l),""===i&&(m=0),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:a.s,b:100})});break;case"saturation":h=(0,u.default)(5*a.h/12,0,150),m=(0,u.default)(l-Math.ceil(a.b/(100/l)),0,l),this.grid.find(".cp-picker").css({top:m,left:h}),m=(0,u.default)(o-a.s*(o/100),0,o),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:100,b:a.b})}),this.grid.find(".cp-grid-inner").css({opacity:a.s/100});break;case"brightness":h=(0,u.default)(5*a.h/12,0,150),m=(0,u.default)(l-Math.ceil(a.s/(100/l)),0,l),this.grid.find(".cp-picker").css({top:m,left:h}),m=(0,u.default)(o-a.b*(o/100),0,o),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:a.s,b:100})}),this.grid.find(".cp-grid-inner").css({opacity:1-a.b/100});break;case"hue":default:h=(0,u.default)(Math.ceil(a.s/(100/c)),0,c),m=(0,u.default)(l-Math.ceil(a.b/(100/l)),0,l),this.grid.find(".cp-picker").css({top:m,left:h}),m=(0,u.default)(o-a.h/(360/o),0,o),this.slider.find(".cp-picker").css({top:m}),this.grid.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:100,b:100})})}}t||e.val(this.getValue(i)),(this.element||e).trigger("change._grav_colorpicker",[e,i,r])}},{key:"updateFromPicker",value:function(t,e){var n=function(t,e){var n,r;return t.length&&e?(n=t[0].getBoundingClientRect().left,r=t[0].getBoundingClientRect().top,{x:n-e[0].getBoundingClientRect().left+t[0].offsetWidth/2,y:r-e[0].getBoundingClientRect().top+t[0].offsetHeight/2}):null},r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,c=void 0,f=void 0,p=this.wrapper.find(".cp-grid"),h=this.wrapper.find(".cp-slider"),m=this.wrapper.find(".cp-opacity-slider"),v=p.find(".cp-picker"),g=h.find(".cp-picker"),y=m.find(".cp-picker"),_=n(v,p),b=n(g,h),w=n(y,m),x=p[0].getBoundingClientRect().width,k=p[0].getBoundingClientRect().height,S=h[0].getBoundingClientRect().height,A=m[0].getBoundingClientRect().height,E=this.element.val();if(E=(0,d.rgbstr2hex)(E)||E,(r=(0,d.parseHex)(E))||(r="#ffffff"),e.hasClass("cp-grid")||e.hasClass("cp-slider"))switch(this.mode){case"wheel":s=x/2-_.x,l=k/2-_.y,c=Math.sqrt(s*s+l*l),f=Math.atan2(l,s),f<0&&(f+=2*Math.PI),c>75&&(c=75,_.x=69-75*Math.cos(f),_.y=69-75*Math.sin(f)),a=(0,u.default)(c/.75,0,100),i=(0,u.default)(180*f/Math.PI,0,360),o=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),h.css({backgroundColor:(0,d.hsb2hex)({h:i,s:a,b:100})});break;case"saturation":i=(0,u.default)(parseInt(_.x*(360/x),10),0,360),a=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),o=(0,u.default)(100-Math.floor(_.y*(100/k)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),h.css({backgroundColor:(0,d.hsb2hex)({h:i,s:100,b:o})}),p.find(".cp-grid-inner").css({opacity:a/100});break;case"brightness":i=(0,u.default)(parseInt(_.x*(360/x),10),0,360),a=(0,u.default)(100-Math.floor(_.y*(100/k)),0,100),o=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),h.css({backgroundColor:(0,d.hsb2hex)({h:i,s:a,b:100})}),p.find(".cp-grid-inner").css({opacity:1-o/100});break;default:i=(0,u.default)(360-parseInt(b.y*(360/S),10),0,360),a=(0,u.default)(Math.floor(_.x*(100/x)),0,100),o=(0,u.default)(100-Math.floor(_.y*(100/k)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),p.css({backgroundColor:(0,d.hsb2hex)({h:i,s:100,b:100})})}e.hasClass("cp-opacity-slider")&&(this.opacity=parseFloat(1-w.y/A).toFixed(2)),t.val(this.getValue(r)),this.element.trigger("change._grav_colorpicker",[this.element,r,this.opacity])}},{key:"getValue",value:function(t){if(1===this.opacity)return t;var e=(0,d.hex2rgb)(t);return"rgba("+e.r+", "+e.g+", "+e.b+", "+this.opacity+")"}},{key:"bound",value:function t(e){var t=this._bound||(this._bound={});return t[e]||(t[e]=(0,f.default)(this[e],this))}}]),t}();e.default=_;e.Instance=new _("[data-grav-colorpicker]")},function(t,e){function n(t,e,n){return tn?n:t}t.exports=n},function(t,e,n){function r(t,e,n){var r=i(arguments,2);return function(){return t.apply(e,r.concat(i(arguments)))}}var i=n(548);t.exports=r},function(t,e){function n(t,e,n){var r=t.length;e=null==e?0:e<0?Math.max(r+e,0):Math.min(e,r),n=null==n?r:n<0?Math.max(r+n,0):Math.min(n,r);for(var i=[];e-1?t.substring(1):t,16),{r:t>>16,g:(65280&t)>>8,b:255&t}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i=n(1),a=r(i),o=n(551),s=r(o);(0,a.default)(function(){var t="",e=(0,a.default)("body"),n=new s.default(".pages-list-container .mediapicker-scroll",{autoshow:!0}),r=new s.default(".thumbs-list-container .mediapicker-scroll",{autoshow:!0});(0,a.default)(".media-container .media-range").on("input change",function(){var t=(0,a.default)(".media-container div.card-item"),e=(0,a.default)(this).val()+"px";t.each(function(){(0,a.default)(this).css("width",e)})}),(0,a.default)(document).on("opened",".remodal",function(){setTimeout(function(){n.update(),r.update()},10)}),e.on("click","[data-mediapicker-modal-trigger]",function(){var n=(0,a.default)(this).data("grav-mediapicker-unique-identifier"),r=e.find('[data-remodal-unique-identifier="'+n+'"]');t=a.default.remodal.lookup[r.data("remodal")],t||(r.remodal(),t=a.default.remodal.lookup[r.data("remodal")]),t.open(),r.find(".js__files").trigger("fillView")}),e.on("click","[data-remodal-mediapicker] .media-container.in-modal .admin-media-details a",function(n){n.preventDefault(),n.stopPropagation();var r=(0,a.default)(n.target).parents(".js__media-element").data("file-url"),i=r.replace(/ /g,"%20"),o=(0,a.default)(n.target).parents("[data-remodal-mediapicker]").data("remodal-unique-identifier");e.find('[data-grav-mediapicker-unique-identifier="'+o+'"] input').val(i),t.close()})})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instance=void 0;var a=function(){function t(t,e){for(var n=0;n ul > [data-collection-item] > .item-actions [data-action="expand"]');n.click()}},{key:"expandItem",value:function(t){var e=(0,s.default)(t.currentTarget),n=e.closest("[data-collection-item]");e.attr("data-action","collapse").removeClass("fa-chevron-circle-right").addClass("fa-chevron-circle-down"),n.removeClass("collection-collapsed")}},{key:"sortItems",value:function(t){var e=(0,s.default)(t.currentTarget),n=e.data("action-sort"),r=e.data("action-sort-dir")||"asc",i=(0,s.default)(e.closest('[data-type="collection"]')),a=i.closest('[data-type="collection"]').find("> ul > [data-collection-item]");a.sort(function(t,e){var i=(0,s.default)(t).find('[name$="['+n+']"]'),a=(0,s.default)(e).find('[name$="['+n+']"]'),o=void 0;return o="asc"===r?i.val()a.val()?1:0:i.val()>a.val()?-1:i.val() ul > [data-collection-item]"),e.each(function(t,e){e=(0,s.default)(e);var n=e.find("[data-key-observe]"),r=n.val(),i=n.length,a=e.data("collection-key-backup");e.attr("data-collection-key",i?r:t),["name","data-grav-field-name","for","id","data-grav-file-settings"].forEach(function(t){e.find("["+t+"], [_"+t+"]").each(function(){var e=(0,s.default)(this),n=[],o=[new RegExp("\\[(\\d+|\\*|"+a+")\\]","g"),new RegExp("\\.(\\d+|\\*|"+a+")\\.","g")];if(i&&!r)return e.attr("_"+t,e.attr(t)),void e.attr(t,null);e.attr("_"+t)&&(e.attr(t,e.attr("_"+t)),e.attr("_"+t,null)),e.parents("[data-collection-key]").map(function(t,e){return n.push((0,s.default)(e).attr("data-collection-key"))}),n.reverse();var l=a,u=e.attr(t).replace(o[0],function(){return l=n.shift()||l,"["+l+"]"});u=u.replace(o[1],function(){return l=n.shift()||l,"."+l+"."}),e.attr(t,u)})})})}},{key:"_onAddedNodes",value:function(t,e){var n=this,r=(0,s.default)(e).find('[data-type="collection"]');r.length&&r.each(function(t,e){e=(0,s.default)(e),~n.lists.index(e)||n.addList(e)})}},{key:"_updateActionsStateBasedOnMinMax",value:function(t){var e=t.closest('[data-type="collection"]').find("> ul > [data-collection-item]"),n=t.data("min"),r=t.data("max");t.find('> .collection-actions [data-action="add"]').attr("disabled",!1),t.find('> ul > li > .item-actions [data-action="delete"]').attr("disabled",!1),"undefined"!=typeof n&&e.length<=n&&t.find('> ul > li > .item-actions [data-action="delete"]').attr("disabled",!0),"undefined"!=typeof r&&e.length>=r&&t.find('> .collection-actions [data-action="add"]').attr("disabled",!0)}}]),t}();e.default=c;e.Instance=new c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instance=void 0;var a=function(){function t(t,e){for(var n=0;n-1,h=(0,s.default)("body"),m="mousedown touchstart MSPointerDown pointerdown",v="mousemove touchmove MSPointerMove pointermove",g="mouseup touchend MSPointerUp pointerup",y=p?"focus":"focusin",_=function(){function t(e){var n=this;i(this,t),this.selector=e,this.field=(0,s.default)(this.selector),this.options=Object.assign({},this.field.data("grav-colorpicker")),this.built=!1,this.attach(),this.options.update&&this.field.on("change._grav_colorpicker",function(t,e,r,i){var a=r,o=(0,d.hex2rgb)(r);i<1&&(a="rgba("+o.r+", "+o.g+", "+o.b+", "+i+")");var s=e.closest(n.options.update);s.length||(s=e.siblings(n.options.update)),s.length||(s=e.parent(".g-colorpicker").find(n.options.update)),s.css({backgroundColor:a})})}return a(t,[{key:"attach",value:function(){var t=this;h.on(y,this.selector,function(e){return t.show(e,e.currentTarget)}),h.on(m,this.selector+" .g-colorpicker, "+this.selector+" .g-colorpicker i",this.bound("iconClick")),h.on("keydown",this.selector,function(e){switch(e.keyCode){case 9:t.hide();break;case 13:case 27:t.hide(),e.currentTarget.blur()}return!0}),h.on("keyup",this.selector,function(e){return t.updateFromInput(!0,e.currentTarget),!0}),h.on("paste",this.selector,function(e){setTimeout(function(){return t.updateFromInput(!0,e.currentTarget)},1)})}},{key:"show",value:function(t,e){e=(0,s.default)(e),this.built||this.build(),this.element=e,this.reposition(),this.wrapper.addClass("cp-visible"),this.updateFromInput();var n=(0,s.default)("#admin-main .content-wrapper").data("scrollbar").getViewElement();this.wrapper.on(m,".cp-grid, .cp-slider, .cp-opacity-slider",this.bound("bodyDown")),h.on(v,this.bound("bodyMove")),h.on(m,this.bound("bodyClick")),h.on(g,this.bound("targetReset")),(0,s.default)(n).on("scroll",this.bound("reposition"))}},{key:"hide",value:function(){if(this.built){this.wrapper.removeClass("cp-visible");var t=(0,s.default)("#admin-main .content-wrapper").data("scrollbar").getViewElement();this.wrapper.undelegate(m,".cp-grid, .cp-slider, .cp-opacity-slider",this.bound("bodyDown")),h.off(v,this.bound("bodyMove")),h.off(m,this.bound("bodyClick")),h.off(g,this.bound("targetReset")),(0,s.default)(t).off("scroll",this.bound("reposition"))}}},{key:"build",value:function(){var t=this;this.wrapper=(0,s.default)('
'),this.slider=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')),this.opacitySlider=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')),this.grid=(0,s.default)('
').appendTo(this.wrapper).append((0,s.default)('
')).append((0,s.default)('
')),(0,s.default)("
").appendTo(this.grid.find(".cp-picker"));var e=(0,s.default)('
').appendTo(this.wrapper);this.tabs={hue:(0,s.default)('
').text("HUE").appendTo(e),brightness:(0,s.default)('
').text("BRI").appendTo(e),saturation:(0,s.default)('
').text("SAT").appendTo(e),wheel:(0,s.default)('
').text("WHEEL").appendTo(e),transparent:(0,s.default)('
').text("TRANSPARENT").appendTo(e)},e.on(m,"> div",function(n){var r=(0,s.default)(n.currentTarget);if(r.is(t.tabs.transparent)){var i=t.opacitySlider.height();return t.opacity=0,t.opacitySlider.find(".cp-picker").css({top:(0,u.default)(i-i*t.opacity,0,i)}),void t.move(t.opacitySlider,{manualOpacity:!0})}var a=e.find(".active"),o=a.attr("class").replace(/\s|active|cp-tab-/g,""),l=r.attr("class").replace(/\s|active|cp-tab-/g,"");t.wrapper.removeClass("cp-mode-"+o).addClass("cp-mode-"+l),a.removeClass("active"),r.addClass("active"),t.mode=l,t.updateFromInput()}),this.wrapper.appendTo(".content-wrapper"),this.built=!0,this.mode="hue"}},{key:"reposition",value:function(){var t=(0,s.default)(".content-wrapper")[0],e=this.element[0].getBoundingClientRect(),n=t.getBoundingClientRect(),r={x:0,y:0};this.options.offset&&(r.x=this.options.offset.x||0,r.y=this.options.offset.y||0),this.wrapper.css({top:e.top+e.height+t.scrollTop-n.top+r.y,left:e.left+t.scrollLeft-n.left+r.x})}},{key:"iconClick",value:function(t){if(this.wrapper&&this.wrapper.hasClass("cp-visible"))return!0;t&&t.preventDefault();var e=(0,s.default)(t.currentTarget).find("input");setTimeout(function(){return e.focus()},50)}},{key:"bodyMove",value:function(t){t&&t.preventDefault(),this.target&&this.move(this.target,t)}},{key:"bodyClick",value:function(t){var e=(0,s.default)(t.target);e.closest(".cp-wrapper").length||e.is(this.selector)||this.hide()}},{key:"bodyDown",value:function(t){t&&t.preventDefault(),this.target=(0,s.default)(t.currentTarget),this.move(this.target,t,!0)}},{key:"targetReset",value:function(t){t&&t.preventDefault(),this.target=null}},{key:"move",value:function(t,e){var n=this.element,r=t.find(".cp-picker"),i=t[0].getBoundingClientRect(),a=i.left+window.scrollX,o=i.top+window.scrollY,s=Math.round((e?e.pageX:0)-a),l=Math.round((e?e.pageY:0)-o),u=void 0,c=void 0,f=void 0,d=void 0,p=e.changedTouches||e.originalEvent&&e.originalEvent.changedTouches;e&&p&&(s=(p?p[0].pageX:0)-a,l=(p?p[0].pageY:0)-o),e&&e.manualOpacity&&(l=i.height),s<0&&(s=0),l<0&&(l=0),s>i.width&&(s=i.width),l>i.height&&(l=i.height),t.parent(".cp-mode-wheel").length&&r.parent(".cp-grid").length&&(u=75-s,c=75-l,f=Math.sqrt(u*u+c*c),d=Math.atan2(c,u),d<0&&(d+=2*Math.PI),f>75&&(s=75-75*Math.cos(d),l=75-75*Math.sin(d)),s=Math.round(s),l=Math.round(l)),t.hasClass("cp-grid")?(r.css({top:l,left:s}),this.updateFromPicker(n,t)):(r.css({top:l}),this.updateFromPicker(n,t))}},{key:"updateFromInput",value:function(t,e){e=e?(0,s.default)(e):this.element;var n=e.val(),r=n.replace(/\s/g,"").match(/^rgba?\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},(.+)\)/),i=void 0,a=void 0;if(n=(0,d.rgbstr2hex)(n)||n,r=r?(0,u.default)(r[1],0,1):1,(i=(0,d.parseHex)(n))||(i="#ffffff"),a=(0,d.hex2hsb)(i),this.built){this.opacity=r;var o=this.opacitySlider.height();this.opacitySlider.find(".cp-picker").css({top:(0,u.default)(o-o*this.opacity,0,o)});var l=this.grid.height(),c=this.grid.width(),f=void 0,p=void 0,h=void 0,m=void 0;switch(o=this.slider.height(),this.mode){case"wheel":f=(0,u.default)(Math.ceil(.75*a.s),0,l/2),p=a.h*Math.PI/180,h=(0,u.default)(75-Math.cos(p)*f,0,c),m=(0,u.default)(75-Math.sin(p)*f,0,l),this.grid.css({backgroundColor:"transparent"}).find(".cp-picker").css({top:m,left:h}),m=150-a.b/(100/l),""===i&&(m=0),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:a.s,b:100})});break;case"saturation":h=(0,u.default)(5*a.h/12,0,150),m=(0,u.default)(l-Math.ceil(a.b/(100/l)),0,l),this.grid.find(".cp-picker").css({top:m,left:h}),m=(0,u.default)(o-a.s*(o/100),0,o),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:100,b:a.b})}),this.grid.find(".cp-grid-inner").css({opacity:a.s/100});break;case"brightness":h=(0,u.default)(5*a.h/12,0,150),m=(0,u.default)(l-Math.ceil(a.s/(100/l)),0,l),this.grid.find(".cp-picker").css({top:m,left:h}),m=(0,u.default)(o-a.b*(o/100),0,o),this.slider.find(".cp-picker").css({top:m}),this.slider.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:a.s,b:100})}),this.grid.find(".cp-grid-inner").css({opacity:1-a.b/100});break;case"hue":default:h=(0,u.default)(Math.ceil(a.s/(100/c)),0,c),m=(0,u.default)(l-Math.ceil(a.b/(100/l)),0,l),this.grid.find(".cp-picker").css({top:m,left:h}),m=(0,u.default)(o-a.h/(360/o),0,o),this.slider.find(".cp-picker").css({top:m}),this.grid.css({backgroundColor:(0,d.hsb2hex)({h:a.h,s:100,b:100})})}}t||e.val(this.getValue(i)),(this.element||e).trigger("change._grav_colorpicker",[e,i,r])}},{key:"updateFromPicker",value:function(t,e){var n=function(t,e){var n,r;return t.length&&e?(n=t[0].getBoundingClientRect().left,r=t[0].getBoundingClientRect().top,{x:n-e[0].getBoundingClientRect().left+t[0].offsetWidth/2,y:r-e[0].getBoundingClientRect().top+t[0].offsetHeight/2}):null},r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0,c=void 0,f=void 0,p=this.wrapper.find(".cp-grid"),h=this.wrapper.find(".cp-slider"),m=this.wrapper.find(".cp-opacity-slider"),v=p.find(".cp-picker"),g=h.find(".cp-picker"),y=m.find(".cp-picker"),_=n(v,p),b=n(g,h),w=n(y,m),x=p[0].getBoundingClientRect().width,k=p[0].getBoundingClientRect().height,S=h[0].getBoundingClientRect().height,A=m[0].getBoundingClientRect().height,E=this.element.val();if(E=(0,d.rgbstr2hex)(E)||E,(r=(0,d.parseHex)(E))||(r="#ffffff"),e.hasClass("cp-grid")||e.hasClass("cp-slider"))switch(this.mode){case"wheel":s=x/2-_.x,l=k/2-_.y,c=Math.sqrt(s*s+l*l),f=Math.atan2(l,s),f<0&&(f+=2*Math.PI),c>75&&(c=75,_.x=69-75*Math.cos(f),_.y=69-75*Math.sin(f)),a=(0,u.default)(c/.75,0,100),i=(0,u.default)(180*f/Math.PI,0,360),o=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),h.css({backgroundColor:(0,d.hsb2hex)({h:i,s:a,b:100})});break;case"saturation":i=(0,u.default)(parseInt(_.x*(360/x),10),0,360),a=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),o=(0,u.default)(100-Math.floor(_.y*(100/k)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),h.css({backgroundColor:(0,d.hsb2hex)({h:i,s:100,b:o})}),p.find(".cp-grid-inner").css({opacity:a/100});break;case"brightness":i=(0,u.default)(parseInt(_.x*(360/x),10),0,360),a=(0,u.default)(100-Math.floor(_.y*(100/k)),0,100),o=(0,u.default)(100-Math.floor(b.y*(100/S)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),h.css({backgroundColor:(0,d.hsb2hex)({h:i,s:a,b:100})}),p.find(".cp-grid-inner").css({opacity:1-o/100});break;default:i=(0,u.default)(360-parseInt(b.y*(360/S),10),0,360),a=(0,u.default)(Math.floor(_.x*(100/x)),0,100),o=(0,u.default)(100-Math.floor(_.y*(100/k)),0,100),r=(0,d.hsb2hex)({h:i,s:a,b:o}),p.css({backgroundColor:(0,d.hsb2hex)({h:i,s:100,b:100})})}e.hasClass("cp-opacity-slider")&&(this.opacity=parseFloat(1-w.y/A).toFixed(2)),t.val(this.getValue(r)),this.element.trigger("change._grav_colorpicker",[this.element,r,this.opacity])}},{key:"getValue",value:function(t){if(1===this.opacity)return t;var e=(0,d.hex2rgb)(t);return"rgba("+e.r+", "+e.g+", "+e.b+", "+this.opacity+")"}},{key:"bound",value:function t(e){var t=this._bound||(this._bound={});return t[e]||(t[e]=(0,f.default)(this[e],this))}}]),t}();e.default=_;e.Instance=new _("[data-grav-colorpicker]")},function(t,e){function n(t,e,n){return tn?n:t}t.exports=n},function(t,e,n){function r(t,e,n){var r=i(arguments,2);return function(){return t.apply(e,r.concat(i(arguments)))}}var i=n(548);t.exports=r},function(t,e){function n(t,e,n){var r=t.length;e=null==e?0:e<0?Math.max(r+e,0):Math.min(e,r),n=null==n?r:n<0?Math.max(r+n,0):Math.min(n,r);for(var i=[];e-1?t.substring(1):t,16),{r:t>>16,g:(65280&t)>>8,b:255&t}}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var i=n(1),a=r(i),o=n(551),s=r(o);(0,a.default)(function(){var t="",e=(0,a.default)("body"),n=new s.default(".pages-list-container .mediapicker-scroll",{autoshow:!0}),r=new s.default(".thumbs-list-container .mediapicker-scroll",{autoshow:!0});(0,a.default)(".media-container .media-range").on("input change",function(){var t=(0,a.default)(".media-container div.card-item"),e=(0,a.default)(this).val()+"px";t.each(function(){(0,a.default)(this).css("width",e)})}),(0,a.default)(document).on("opened",".remodal",function(){setTimeout(function(){n.update(),r.update()},10)}),e.on("click","[data-mediapicker-modal-trigger]",function(){var n=(0,a.default)(this).data("grav-mediapicker-unique-identifier"),r=e.find('[data-remodal-unique-identifier="'+n+'"]');t=a.default.remodal.lookup[r.data("remodal")],t||(r.remodal(),t=a.default.remodal.lookup[r.data("remodal")]),t.open(),r.find(".js__files").trigger("fillView")}),e.on("click","[data-remodal-mediapicker] .media-container.in-modal .admin-media-details a",function(n){n.preventDefault(),n.stopPropagation();var r=(0,a.default)(n.target).parents(".js__media-element").data("file-url"),i=r.replace(/ /g,"%20"),o=(0,a.default)(n.target).parents("[data-remodal-mediapicker]").data("remodal-unique-identifier");e.find('[data-grav-mediapicker-unique-identifier="'+o+'"] input').val(i),t.close()})})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instance=void 0;var a=function(){function t(t,e){for(var n=0;n