Files
CHIEFSOFT\ameye e9e5c0546c first commit
2023-11-30 13:20:54 -05:00

6 lines
11 KiB
JavaScript

!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=89)}({1:function(t,e,n){var o;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var t=[],e=0;e<arguments.length;e++){var o=arguments[e];if(o){var i=typeof o;if("string"===i||"number"===i)t.push(o);else if(Array.isArray(o)){if(o.length){var c=r.apply(null,o);c&&t.push(c)}}else if("object"===i)if(o.toString===Object.prototype.toString)for(var a in o)n.call(o,a)&&o[a]&&t.push(a);else t.push(o.toString())}}return t.join(" ")}t.exports?(r.default=r,t.exports=r):void 0===(o=function(){return r}.apply(e,[]))||(t.exports=o)}()},126:function(t,e,n){"use strict";n.r(e);var o=n(1),r=n.n(o),i=n(7),c=window.canvasBreakpoints,a=n(16);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=v(t);if(e){var r=v(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return d(this,n)}}function d(t,e){return!e||"object"!==u(e)&&"function"!=typeof e?m(t):e}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function v(t){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=window.jQuery,b=wp.element,h=b.Component,g=b.Fragment,w=wp.blockEditor.InnerBlocks,z=wp.compose.compose,k=wp.data.withSelect,O=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(d,t);var e,n,o,u=p(d);function d(){var t;return s(this,d),(t=u.apply(this,arguments)).state={resizing:!1,resizingContainerWidth:0,resizingCursorPosition:0,resizingColSize:0},t.onResizeStart=t.onResizeStart.bind(m(t)),t.onResizing=Object(i.throttle)(150,t.onResizing.bind(m(t))),t.onResizeEnd=t.onResizeEnd.bind(m(t)),t}return e=d,(n=[{key:"componentDidMount",value:function(){document.addEventListener("mousemove",this.onResizing),document.addEventListener("mouseup",this.onResizeEnd)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousemove",this.onResizing),document.removeEventListener("mouseup",this.onResizeEnd)}},{key:"onResizeStart",value:function(t){var e=this.props,n=e.clientId,o=e.attributes,r=y('[data-block="'.concat(n,'"')).closest(".cnvs-block-row");this.setState({resizing:!0,resizingContainerWidth:r.width(),resizingCursorPosition:t.clientX,resizingColSize:o.size}),t.preventDefault()}},{key:"onResizing",value:function(t){if(this.state.resizing){var e=this.props,n=e.attributes,o=e.clientId,r=t.clientX-this.state.resizingCursorPosition,i=this.state.resizingContainerWidth/12,c=Math.round(r/i),u=this.state.resizingColSize+c;u!==n.size&&Object(a.a)(o,u,!0)}}},{key:"onResizeEnd",value:function(t){this.state.resizing&&(t.preventDefault(),this.setState({resizing:!1,resizingContainerWidth:0,resizingCursorPosition:0,resizingColSize:0}))}},{key:"render",value:function(){var t=this,e=this.props,n=e.hasChildBlocks,o=e.attributes,i=e.clientId,a=o.canvasClassName,u=this.props.className;return u=r()("cnvs-block-column",a,u),wp.element.createElement(g,null,wp.element.createElement("div",{className:u},wp.element.createElement("div",{className:"cnvs-block-column-inner","data-min-height":o.minHeight},wp.element.createElement("div",null,wp.element.createElement(w,{templateLock:!1,renderAppender:n?void 0:function(){return wp.element.createElement(w.ButtonBlockAppender,null)}})))),wp.element.createElement("div",{className:"cnvs-block-column-resizer",draggable:"true",onMouseDown:function(e){t.onResizeStart(e)}},wp.element.createElement("span",null)),wp.element.createElement("style",null,a&&i?function(t,e,n){var o="",r=!0;return Object.keys(c).forEach((function(i){var a=c[i],u="",s="";if("desktop"!==i&&(s="_".concat(i)),s&&r&&(r=!1,u+="\n\t\t\t\t.".concat(e," + .cnvs-block-column-resizer {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t")),t["size".concat(s)]){var l=t["size".concat(s)];u+="\n\t\t\t\t#block-".concat(n,'[data-type="canvas/column"] {\n\t\t\t\t\t-ms-flex-preferred-size: ').concat(100*l/12,"%;\n\t\t\t\t\tflex-basis: ").concat(100*l/12,"%;\n\t\t\t\t\twidth: ").concat(100*l/12,"%;\n\t\t\t\t}\n\t\t\t")}if(t["order".concat(s)]){var f=t["order".concat(s)];u+="\n\t\t\t\t#block-".concat(n,'[data-type="canvas/column"] {\n\t\t\t\t\t-ms-flex-order: ').concat(f,";\n\t\t\t\t\torder: ").concat(f,";\n\t\t\t\t}\n\t\t\t")}if(t["minHeight".concat(s)]){var p=t["minHeight".concat(s)];u+="\n\t\t\t\t.".concat(e," > .cnvs-block-column-inner {\n\t\t\t\t\tmin-height: ").concat(p,";\n\t\t\t\t}\n\t\t\t")}if(t["verticalAlign".concat(s)]){var d=t["verticalAlign".concat(s)];"top"===d?d="flex-start":"bottom"===d&&(d="flex-end"),u+="\n\t\t\t\t#block-".concat(n,'[data-type="canvas/column"] {\n\t\t\t\t\tjustify-content: ').concat(d,";\n\t\t\t\t}\n\t\t\t\t.").concat(e," > .cnvs-block-column-inner {\n\t\t\t\t\talign-items: ").concat(d,";\n\t\t\t\t}\n\t\t\t")}s&&u&&(u="@media (max-width: ".concat(a.width,"px) { ").concat(u," } ")),u&&(o+=u)})),o}(o,a,i):""))}}])&&l(e.prototype,n),o&&l(e,o),d}(h),E=z(k((function(t,e){var n=e.clientId,o=t("core/block-editor");return{getBlockRootClientId:o.getBlockRootClientId,getBlocks:o.getBlocks,hasChildBlocks:(0,o.getBlockOrder)(n).length>0}})))(O);function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function _(t,e){return(_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=B(t);if(e){var r=B(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return P(this,n)}}function P(t,e){return!e||"object"!==S(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function B(t){return(B=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var x=wp.element.Component,I=wp.blockEditor.InnerBlocks,A=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_(t,e)}(i,t);var e,n,o,r=C(i);function i(){return j(this,i),r.apply(this,arguments)}return e=i,(n=[{key:"render",value:function(){return wp.element.createElement(I.Content,null)}}])&&R(e.prototype,n),o&&R(e,o),i}(x),T=wp.hooks.addFilter;T("canvas.customBlock.editRender","canvas/column/editRender",(function(t,e){return"canvas/column"===e.name?wp.element.createElement(E,e):t})),T("canvas.customBlock.registerData","canvas/column/registerData",(function(t){return"canvas/column"===t.name&&(t.save=A),t})),T("canvas.customBlock.onFieldChange","canvas/column/changeColumnSize",(function(t,e,n){return"canvas/column"===n.name&&"size"===e?(Object(a.a)(n.clientId,t,!0),"CNVS_PREVENT_UPDATE"):t}))},16:function(t,e,n){"use strict";var o=window.lodash.findIndex;function r(t,e){var n=o(t,{clientId:e});return n===t.length-1?t.slice(0,n):t.slice(n+1)}var i=wp.data.select("core/block-editor"),c=i.getBlockRootClientId,a=i.getBlocks,u=i.getBlockAttributes,s=window.jQuery;function l(t,e){s("#block-".concat(t,'[data-type="canvas/column"]')).css({flexBasis:"".concat(100*e/12,"%"),width:"".concat(100*e/12,"%")}),wp.data.dispatch("core/block-editor").updateBlockAttributes(t,{size:e})}e.a=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(n){if(!(e<1||e>12)){var o=a(c(t)),i=r(o,t),s=u(t),f=e-s.size;if(f<0)l(t,e),l(i[0].clientId,i[0].attributes.size-f);else if(f>0){var p=0;if(i.map((function(t){t.attributes.size>1&&(p+=t.attributes.size-1)})),!p||f>p)return;l(t,e),i.forEach((function(t){if(f>0&&t.attributes.size>1){var e=Math.max(t.attributes.size-f,1);f-=t.attributes.size-e,l(t.clientId,e)}}))}}}else l(t,e)}},7:function(t,e,n){!function(t){"use strict";function e(t,e,n,o){var r,i=!1,c=0;function a(){r&&clearTimeout(r)}function u(){for(var u=arguments.length,s=new Array(u),l=0;l<u;l++)s[l]=arguments[l];var f=this,p=Date.now()-c;function d(){c=Date.now(),n.apply(f,s)}function m(){r=void 0}i||(o&&!r&&d(),a(),void 0===o&&p>t?d():!0!==e&&(r=setTimeout(o?m:d,void 0===o?t-p:t)))}return"boolean"!=typeof e&&(o=n,n=e,e=void 0),u.cancel=function(){a(),i=!0},u}t.debounce=function(t,n,o){return void 0===o?e(t,n,!1):e(t,o,!1!==n)},t.throttle=e,Object.defineProperty(t,"__esModule",{value:!0})}(e)},89:function(t,e,n){t.exports=n(126)}});