laipower/wp-content/themes/generatepress/assets/dist/customizer.js

5 lines
314 KiB
JavaScript
Raw Normal View History

(window.webpackJsonp_generatepress=window.webpackJsonp_generatepress||[]).push([[4],{32:function(e,t,r){},45:function(e,t,r){},46:function(e,t,r){},47:function(e,t,r){},48:function(e,t,r){},57:function(e,t,r){},60:function(e,t,r){},61:function(e,t,r){},62:function(e,t,r){},65:function(e,t,r){}}]),function(e){function t(t){for(var a,o,s=t[0],l=t[1],c=t[2],g=0,d=[];g<s.length;g++)o=s[g],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&d.push(n[o][0]),n[o]=0;for(a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a]);for(u&&u(t);d.length;)d.shift()();return i.push.apply(i,c||[]),r()}function r(){for(var e,t=0;t<i.length;t++){for(var r=i[t],a=!0,s=1;s<r.length;s++){var l=r[s];0!==n[l]&&(a=!1)}a&&(i.splice(t--,1),e=o(o.s=r[0]))}return e}var a={},n={1:0},i=[];function o(t){if(a[t])return a[t].exports;var r=a[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=a,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)o.d(r,a,function(t){return e[t]}.bind(null,a));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var s=window.webpackJsonp_generatepress=window.webpackJsonp_generatepress||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var c=0;c<s.length;c++)t(s[c]);var u=l;i.push([70,4]),r()}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.components},function(e,t,r){"use strict";(function(e){function a(t,r,...a){if(void 0!==e&&void 0===r)throw new Error("invariant requires an error message argument");if(!t){let e;if(void 0===r)e=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let t=0;e=new Error(r.replace(/%s/g,(function(){return a[t++]}))),e.name="Invariant Violation"}throw e.framesToPop=1,e}}r.d(t,"a",(function(){return a}))}).call(this,r(63))},function(e,t,r){var a=r(18),n=r(19),i=r(14),o=r(20);e.exports=function(e,t){return a(e)||n(e,t)||i(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var a=r(22),n=r(23),i=r(14),o=r(24);e.exports=function(e){return a(e)||n(e)||i(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return a}))},function(e,t){e.exports=window.wp.hooks},function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.de
/* translators: Unit type (px, em, %) */,{text:Object(c.sprintf)(Object(c.__)("%s Preview","generatepress"),t),key:e},Object(o.createElement)(s.Button,{key:e,className:"components-generate-control-button__units--"+e,isSmall:!0
/* translators: %s: values associated with CSS syntax, 'Pixel', 'Em', 'Percentage' */,"aria-label":t,onClick:function(){wp.customize.previewedDevice.set(e),a(e)}},we(e)))})))))}),Mn=r(34),In=r.n(Mn),kn=r(35),Pn=r.n(kn),Rn=r(36),An=r.n(Rn),Ln=r(37),Fn=r.n(Ln),Bn=r(28),Hn=r.n(Bn);r(60);var Vn=function(e){An()(n,e);var t,r,a=(t=n,r=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(e){return!1}}(),function(){var e,a=Hn()(t);if(r){var n=Hn()(this).constructor;e=Reflect.construct(a,arguments,n)}else e=a.apply(this,arguments);return Fn()(this,e)});function n(){return In()(this,n),a.apply(this,arguments)}return Pn()(n,[{key:"render",value:function(){var e=this.props,t=e.label,r=e.value,a=e.onChange,n=e.rangeMin,i=void 0===n?0:n,l=e.rangeMax,c=void 0===l?100:l,u=e.inputMin,g=void 0===u?"":u,d=e.inputMax,f=void 0===d?"":d,p=e.step,v=void 0===p?1:p,h=e.help,y=void 0===h?"":h,m=e.beforeIcon,b=void 0===m?"":m,O=e.initialPosition,S=void 0===O?"":O,w=e.placeholder,C=void 0===w?"":w;return Object(o.createElement)("div",{className:"components-generate-range-control"},t&&Object(o.createElement)("div",{className:"components-generate-range-control--label"},t),Object(o.createElement)("div",{className:"components-generate-range-control--wrapper"},Object(o.createElement)("div",{className:"components-generate-range-control--range"},Object(o.createElement)(s.RangeControl,{className:"generate-range-control-range",beforeIcon:b,value:dn(r)?parseFloat(r):"",onChange:function(e){return a(e)},min:i,max:c,step:v,withInputField:!1,initialPosition:S})),Object(o.createElement)("div",{className:"components-generate-range-control-input"},Object(o.createElement)(s.TextControl,{type:"number",placeholder:""!==C?C:"",min:g,max:f,step:v,value:dn(r)?r:"",onChange:function(e){return a(e)}}))),y&&Object(o.createElement)("p",{className:"components-base-control__help"},y))}}]),n}(o.Component),zn=(r(61),function(e){var t=e.value,r=e.onClick,a=e.units;return Object(o.createElement)("div",{className:"components-generate--control__units"},Object(o.createElement)(s.Dropdown,{className:"generate-component-control--unit-picker",contentClassName:"generate-component-control--unit-picker-area",position:"bottom left",focusOnMount:"container",renderToggle:function(e){var r=e.isOpen,a=e.onToggle;return Object(o.createElement)(s.Button,{onClick:a,"aria-expanded":r},t||we("dash"))},renderContent:function(e){var n=e.onClose;return Object(o.createElement)(s.ButtonGroup,{className:"components-generate--control-buttons__units","aria-label":Object(c.__)("Select Units","generatepress")},a.map((function(e){var a=e,i=e||we("dash");return""===e&&(a=Object(c.__)("No Unit","generatepress")),"px"===e&&(a=Object(c._x)("Pixel","A size unit for CSS markup","generatepress")),"em"===e&&(a=Object(c._x)("Em","A size unit for CSS markup","generatepress")),"%"===e&&(a=Object(c._x)("Percentage","A size unit for CSS markup","generatepress")),"deg"===e&&(a=Object(c._x)("Degree","A size unit for CSS markup","generatepress")),Object(o.createElement)(s.Tooltip
/* translators: Unit type (px, em, %) */,{text:e?Object(c.sprintf)(Object(c.__)("%s Units","generatepress"),a):a,key:e},Object(o.createElement)(s.Button,{key:e,className:"components-generate--control-button__units--"+e,isSmall:!0,isPrimary:t===e,"aria-pressed":t===e
/* translators: %s: values associated with CSS syntax, 'Pixel', 'Em', 'Percentage' */,"aria-label":e?Object(c.sprintf)(Object(c.__)("%s Units","generatepress"),a):a,onClick:function(){r(e),n()}},i))})))}}))}),Un=function(e){var t=e.label,r=e.unitValue,a=e.units,n=e.onChangeUnit,i=e.step,l=e.rangeMin,c=e.rangeMax,u=e.inputMin,g=void 0===u?null:u,d=e.inputMax,f=void 0===d?null:d,p=e.desktopValue,v=e.desktopInitial,h=e.desktopOnChange,y=e.tabletValue,m=e.tabletInitial,b=e.tabletOnChange,O=e.mobileInitial,S=e.mobileValue,w=e.mobileOnChange;return Object(o.createElement)(s.BaseControl,null,Object(o.createElement)(Dn,{label:t,value:r,devices:["desktop","tablet","mobile"]}),Object(o.createElement)("div",{className:"generate-component-input-with-unit"},Object(o.createElement)("div",{className:"generate-component-device-field","data-device":"desktop"},Object(o.createElement)(Vn,{className:"generate-range-control-range",step:i,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:dn(p)?parseFloat(p):v,initialPosition:v,onChange:h,withInputField:!1})),Object(o.createElement)("div",{className:"generate-component-device-field","data-device":"tablet"},Object(o.createElement)(Vn,{"data-generate-control-device":"tablet",className:"generate-range-control-range",step:i,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:dn(y)?parseFloat(y):m,initialPosition:m,onChange:b,withInputField:!1})),Object(o.createElement)("div",{className:"generate-component-device-field","data-device":"mobile"},Object(o.createElement)(Vn,{"data-generate-control-device":"mobile",className:"generate-range-control-range",step:i,rangeMin:l,rangeMax:c,inputMin:g,inputMax:f,value:dn(S)?parseFloat(S):O,initialPosition:O,onChange:w,withInputField:!1})),Object(o.createElement)(zn,{value:r,units:a,onClick:n})))},Gn=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:Object(c.__)("Font size","generatepress"),unitValue:t.fontSizeUnit,units:["px","em","rem","%"],onChangeUnit:function(e){r("fontSizeUnit",e,t.index)},step:vn(t,"fontSize","step",1),rangeMin:vn(t,"fontSize","min",1),rangeMax:vn(t,"fontSize","max",100),inputMin:0,desktopValue:t.fontSize,desktopInitial:pn(t,"fontSize"),desktopOnChange:function(e){r("fontSize",e,t.index)},tabletValue:t.fontSizeTablet,tabletInitial:pn(t,"fontSizeTablet"),tabletOnChange:function(e){r("fontSizeTablet",e,t.index)},mobileValue:t.fontSizeMobile,mobileInitial:pn(t,"fontSizeMobile"),mobileOnChange:function(e){r("fontSizeMobile",e,t.index)}})},Wn=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:Object(c.__)("Line Height","generatepress"),unitValue:t.lineHeightUnit,units:["","px","em","rem"],onChangeUnit:function(e){r("lineHeightUnit",e,t.index)},step:vn(t,"lineHeight","step",.1),rangeMin:vn(t,"lineHeight","min",1),rangeMax:vn(t,"lineHeight","max",5),inputMin:0,desktopValue:t.lineHeight,desktopInitial:pn(t,"lineHeight"),desktopOnChange:function(e){r("lineHeight",e,t.index)},tabletValue:t.lineHeightTablet,tabletInitial:pn(t,"lineHeightTablet"),tabletOnChange:function(e){r("lineHeightTablet",e,t.index)},mobileValue:t.lineHeightMobile,mobileInitial:pn(t,"lineHeightMobile"),mobileOnChange:function(e){r("lineHeightMobile",e,t.index)}})},Kn=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:Object(c.__)("Letter Spacing","generatepress"),unitValue:t.letterSpacingUnit,units:["px","em","rem"],onChangeUnit:function(e){r("letterSpacingUnit",e,t.index)},step:vn(t,"letterSpacing","step",.01),rangeMin:vn(t,"letterSpacing","min",-1),rangeMax:vn(t,"letterSpacing","max",10),desktopValue:t.letterSpacing,desktopInitial:pn(t,"letterSpacing"),desktopOnChange:function(e){r("letterSpacing",e,t.index)},tabletValue:t.letterSpacingTablet,tabletInitial:pn(t,"letterSpacingTablet"),tabletOnChange:function(e){r("letterSpacingTablet",e,t.index)},mobileValue:t.letterSpacingMobile,mobileInitial:pn(t,"letterSpacingMobile"),mobileOnChange:function(e){r("letterSpacingMobile",e,t.index)}})},$n=function(e){var t=e.font,r=e.onChange;return Object(o.createElement)(Un,{label:"body"===t.selector?Object(c