File "control.js.map"

Full Path: /home/jlklyejr/public_html/post-date/wp-content/plugins/kirki/pro-src/packages/kirki-pro-margin-padding/dist/control.js.map
File size: 15.96 KB
MIME-type: application/json
Charset: utf-8

{"mappings":"uBAAwCA,EAAKC,EAAKC,GAYhD,OAXID,KAAOD,EACTG,OAAOC,eAAeJ,EAAKC,EAAK,CAC9BC,MAAOA,EACPG,YAAY,EACZC,cAAc,EACdC,UAAU,IAGZP,EAAIC,GAAOC,EAGNF,aCR8BQ,EAAKC,GAC1C,gBCLsCD,GACtC,GAAIE,MAAMC,QAAQH,GAAM,OAAOA,EDIxBI,CAAeJ,aELiBK,GACvC,GAAIC,OAAOC,YAAYZ,OAAOU,IAAkD,uBAAzCV,OAAOa,UAAUC,SAASC,KAAKL,GAAgC,OAAOH,MAAMS,KAAKN,GFI1FO,CAAqBZ,eGJnD,MAAM,IAAIa,UAAU,wDHI0CC,YILhEC,EAAeC,MCEf,IAyKAC,EAzKgCC,SAAAA,GAC9B,IAAQC,EACND,EADMC,QAASC,EACfF,EADeE,kBAAmBC,EAClCH,EADkCG,aAAcC,EAChDJ,EADgDI,WAAYC,EAC5DL,EAD4DK,UAGxBC,EAAtCC,EAAsCD,EAAAA,UAAS,WAC7C,OAAOF,MADFI,EAA+BF,EAAtC,GAAoBG,EAAkBH,EAAtC,GAIMI,EAA0BlC,SAAAA,GAC9B,IAAImC,EAAO,GACPC,EAAS,GACTC,EAAW,GAkBf,MAhBI,KAAOrC,IAGTqC,GAAW,GADXrC,GADAA,EAAQ,iBAAoBA,EAAQA,EAAMe,WAAaf,GACzCsC,QACQC,QAAQ,KAAO,IAAM,GAGvC,MAFJvC,EAAQA,EAAMwC,QAAQH,EAAU,MAG9BF,EAAOnC,EAAMwC,QAAN,OAAsB,IAE7BJ,EAASC,GADTD,EAASpC,EAAMwC,QAAQL,EAAM,KACFG,OAC3BF,EAASK,WAAWL,IAEpBA,EAASC,GAIN,CACLF,KAAMA,EACNC,OAAQA,IAiBNM,EAA0BC,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BP,QAASa,GAC5CD,EAAK5C,gBAOlBvB,MAHKiD,cAAA,MAAA,CAGAC,UAAU,2BACblD,MADFiD,cAAA,OAAA,CACQS,IAAKX,EAASG,UAAU,sBAC3B3C,6NE3HT+D,GAAAC,UAAAC,QAAAC,OAAA,CAzB0DC,WAAA,SAAAN,EAAAO,GAiD9D,IAAAxE,EAAAyE,KAEIzE,EAAMA,yBAANA,EAAAwD,yBAAAkB,KAAA1E,GAEA2E,GAAAA,UAASC,QACPvF,UAAAkF,WAAAhF,KAAAS,EAACiE,EAAAO,GAtDuDL,GAAAC,UAAApE,QAAA0E,KAAA,WAsDxD,SACM1E,EAFR2E,GAGI3E,IAFF6E,IAGE7E,EAAA8E,UACA9E,EAAA+E,UAAAC,SACAb,GAAOnE,UAAQwE,QAAOjG,OAAtB,UAAA0G,QAwCRzB,yBAAA,SAAA0B,GAEoBT,KAGRU,cAACC,UAAuBpF,OAAQ+E,GAHxBN,KAMTL,cAAUC,4kBCtHrBF,GAAGC,UAAUiB,mBAAmB,gBAAkBC,EAClDnB,GAAGC,UAAUiB,mBAAmB,iBAAmBC","sources":["node_modules/@swc/helpers/src/_define_property.js","node_modules/@swc/helpers/src/_sliced_to_array.js","node_modules/@swc/helpers/src/_array_with_holes.js","node_modules/@swc/helpers/src/_iterable_to_array.js","node_modules/@swc/helpers/src/_non_iterable_rest.js","React.js","src/KirkiMarginPaddingForm.js","node_modules/@swc/helpers/src/_object_spread.js","src/KirkiMarginPaddingControl.js","src/control.js"],"sourcesContent":["export default function _defineProperty(obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n\n  return obj;\n}\n","import arrayWithHoles from './_array_with_holes';\nimport iterableToArrayLimit from './_iterable_to_array';\nimport nonIterableRest from './_non_iterable_rest';\n\nexport default function _slicedToArray(arr, i) {\n  return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n  if (Array.isArray(arr)) return arr;\n}\n","export default function _iterableToArray(iter) {\n  if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n","export default function _nonIterableRest() {\n  throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n","module.exports=React;","import { useRef, useState } from \"react\";\n\nconst KirkiMarginPaddingForm = (props) => {\n  const { control, customizerSetting, defaultArray, valueArray, valueUnit } =\n    props;\n\n  const [inputValues, setInputValues] = useState(() => {\n    return valueArray;\n  });\n\n  const getSingleValueAsObject = (value) => {\n    let unit = \"\";\n    let number = \"\";\n    let negative = \"\";\n\n    if (\"\" !== value) {\n      value = \"string\" !== typeof value ? value.toString() : value;\n      value = value.trim();\n      negative = -1 < value.indexOf(\"-\") ? \"-\" : \"\";\n      value = value.replace(negative, \"\");\n\n      if (\"\" !== value) {\n        unit = value.replace(/\\d+/g, \"\");\n        number = value.replace(unit, \"\");\n        number = negative + number.trim();\n        number = parseFloat(number);\n      } else {\n        number = negative;\n      }\n    }\n\n    return {\n      unit: unit,\n      number: number,\n    };\n  };\n\n  const getValuesForInput = (values) => {\n    let singleValue;\n\n    for (const position in values) {\n      if (Object.hasOwnProperty.call(values, position)) {\n        singleValue = getSingleValueAsObject(values[position]);\n        values[position] = singleValue.number;\n      }\n    }\n\n    return values;\n  };\n\n  const getValuesForCustomizer = (values) => {\n    let singleValue;\n\n    for (const position in values) {\n      if (Object.hasOwnProperty.call(values, position)) {\n        singleValue = values[position];\n\n        if (\"\" !== singleValue) {\n          singleValue = getSingleValueAsObject(singleValue);\n          singleValue = singleValue.number + valueUnit;\n        }\n\n        values[position] = singleValue;\n      }\n    }\n\n    return values;\n  };\n\n  control.updateComponentState = (val) => {\n    setInputValues(getValuesForInput(val));\n  };\n\n  const handleChange = (e, position) => {\n    let values = { ...inputValues };\n    values[position] = e.target.value;\n\n    customizerSetting.set(getValuesForCustomizer(values));\n  };\n\n  const handleReset = (e) => {\n    const values =\n      \"\" !== props.default && \"undefined\" !== typeof props.default\n        ? defaultArray\n        : valueArray;\n\n    customizerSetting.set(getValuesForCustomizer(values));\n  };\n\n  // Preparing for the template.\n  const fieldId = `kirki-control-input-${props.type}-top`;\n  const unitRef = useRef(null);\n\n  const makeMapable = () => {\n    const items = [];\n\n    for (const position in inputValues) {\n      if (Object.hasOwnProperty.call(inputValues, position)) {\n        items.push({ position: position, value: inputValues[position] });\n      }\n    }\n\n    return items;\n  };\n\n  return (\n    <div className=\"kirki-control-form\" tabIndex=\"1\">\n      {(props.label || props.description) && (\n        <>\n          <label className=\"kirki-control-label\" htmlFor={fieldId}>\n            {props.label && (\n              <span className=\"customize-control-title\">{props.label}</span>\n            )}\n\n            {props.description && (\n              <span\n                className=\"customize-control-description description\"\n                dangerouslySetInnerHTML={{ __html: props.description }}\n              />\n            )}\n          </label>\n\n          <div\n            className=\"customize-control-notifications-container\"\n            ref={props.setNotificationContainer}\n          />\n        </>\n      )}\n\n      <button\n        type=\"button\"\n        className=\"kirki-control-reset\"\n        onClick={handleReset}\n      >\n        <i className=\"dashicons dashicons-image-rotate\"></i>\n      </button>\n\n      <div className=\"kirki-control-cols\">\n        <div className=\"kirki-control-left-col\">\n          <div class=\"kirki-control-fields\">\n            {makeMapable(inputValues).map((item) => {\n              const className = `kirki-control-input kirki-control-input-${item.position}`;\n              const id = `kirki-control-input-${props.type}-${item.position}`;\n\n              return (\n                <div class=\"kirki-control-field\">\n                  <input\n                    id={id}\n                    type=\"number\"\n                    value={item.value || 0 === item.value ? item.value : \"\"}\n                    className={className}\n                    onChange={(e) => handleChange(e, item.position)}\n                  />\n                  <label class=\"kirki-control-sublabel\" htmlFor={id}>\n                    {item.position}\n                  </label>\n                </div>\n              );\n            })}\n          </div>\n        </div>\n        <div className=\"kirki-control-right-col\">\n          <span ref={unitRef} className=\"kirki-control-unit\">\n            {valueUnit}\n          </span>\n        </div>\n      </div>\n    </div>\n  );\n};\n\nexport default KirkiMarginPaddingForm;\n","import defineProperty from './_define_property';\n\nexport default function _objectSpread(target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i] != null ? arguments[i] : {};\n    var ownKeys = Object.keys(source);\n\n    if (typeof Object.getOwnPropertySymbols === 'function') {\n      ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n        return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n      }));\n    }\n\n    ownKeys.forEach(function (key) {\n      defineProperty(target, key, source[key]);\n    });\n  }\n\n  return target;\n}","import KirkiMarginPaddingForm from \"./KirkiMarginPaddingForm\";\r\n\r\n/**\r\n * KirkiMarginPaddingControl.\r\n *\r\n * Global objects brought:\r\n * - wp\r\n * - jQuery\r\n * - React\r\n * - ReactDOM\r\n *\r\n * @class\r\n * @augments wp.customize.Control\r\n * @augments wp.customize.Class\r\n */\r\nconst KirkiMarginPaddingControl = wp.customize.Control.extend({\r\n  /**\r\n   * Initialize.\r\n   *\r\n   * @param {string} id - Control ID.\r\n   * @param {object} params - Control params.\r\n   */\r\n  initialize: function (id, params) {\r\n    const control = this;\r\n\r\n    // Bind functions to this control context for passing as React props.\r\n    control.setNotificationContainer =\r\n      control.setNotificationContainer.bind(control);\r\n\r\n    wp.customize.Control.prototype.initialize.call(control, id, params);\r\n\r\n    // The following should be eliminated with <https://core.trac.wordpress.org/ticket/31334>.\r\n    function onRemoved(removedControl) {\r\n      if (control === removedControl) {\r\n        control.destroy();\r\n        control.container.remove();\r\n        wp.customize.control.unbind(\"removed\", onRemoved);\r\n      }\r\n    }\r\n\r\n    wp.customize.control.bind(\"removed\", onRemoved);\r\n  },\r\n\r\n  /**\r\n   * Set notification container and render.\r\n   *\r\n   * This is called when the React component is mounted.\r\n   *\r\n   * @param {Element} element - Notification container.\r\n   * @returns {void}\r\n   */\r\n  setNotificationContainer: function setNotificationContainer(element) {\r\n    const control = this;\r\n\r\n    control.notifications.container = jQuery(element);\r\n    control.notifications.render();\r\n  },\r\n\r\n  /**\r\n   * Render the control into the DOM.\r\n   *\r\n   * This is called from the Control#embed() method in the parent class.\r\n   *\r\n   * @returns {void}\r\n   */\r\n  renderContent: function renderContent() {\r\n    const control = this;\r\n\r\n    ReactDOM.render(\r\n      <KirkiMarginPaddingForm\r\n        {...control.params}\r\n        control={control}\r\n        customizerSetting={control.setting}\r\n        setNotificationContainer={control.setNotificationCotainer}\r\n        value={control.params.value}\r\n      />,\r\n      control.container[0]\r\n    );\r\n\r\n    if (false !== control.params.choices.allowCollapse) {\r\n      control.container.addClass(\"allowCollapse\");\r\n    }\r\n  },\r\n\r\n  /**\r\n   * After control has been first rendered, start re-rendering when setting changes.\r\n   *\r\n   * React is able to be used here instead of the wp.customize.Element abstraction.\r\n   *\r\n   * @returns {void}\r\n   */\r\n  ready: function ready() {\r\n    const control = this;\r\n\r\n    /**\r\n     * Update component value's state when customizer setting's value is changed.\r\n     */\r\n    control.setting.bind((val) => {\r\n      control.updateComponentState(val);\r\n    });\r\n  },\r\n\r\n  /**\r\n   * This method will be overriden by the rendered component.\r\n   */\r\n  updateComponentState: (val) => {},\r\n\r\n  /**\r\n   * Handle removal/de-registration of the control.\r\n   *\r\n   * This is essentially the inverse of the Control#embed() method.\r\n   *\r\n   * @link https://core.trac.wordpress.org/ticket/31334\r\n   * @returns {void}\r\n   */\r\n  destroy: function destroy() {\r\n    const control = this;\r\n\r\n    // Garbage collection: undo mounting that was done in the embed/renderContent method.\r\n    ReactDOM.unmountComponentAtNode(control.container[0]);\r\n\r\n    // Call destroy method in parent if it exists (as of #31334).\r\n    if (wp.customize.Control.prototype.destroy) {\r\n      wp.customize.Control.prototype.destroy.call(control);\r\n    }\r\n  },\r\n});\r\n\r\nexport default KirkiMarginPaddingControl;\r\n","import \"./control.scss\";\r\nimport KirkiMarginPaddingControl from \"./KirkiMarginPaddingControl\";\r\n\r\n// Register control type with Customizer.\r\nwp.customize.controlConstructor[\"kirki-margin\"] = KirkiMarginPaddingControl;\r\nwp.customize.controlConstructor[\"kirki-padding\"] = KirkiMarginPaddingControl;\r\n"],"names":["obj","key","value","Object","defineProperty","enumerable","configurable","writable","arr","i","Array","isArray","$6e00726c30bb8aa8$export$2e2bcd8739ae039","iter","Symbol","iterator","prototype","toString","call","from","$8664303016091545$export$2e2bcd8739ae039","TypeError","$9e1e3aff84b72d71$export$2e2bcd8739ae039","module","React","$c53a0f08a36f035b$export$2e2bcd8739ae039","props","control","customizerSetting","defaultArray","valueArray","valueUnit","useState","$d8de0eb6e0dd5f0d$export$2e2bcd8739ae039","inputValues","setInputValues","getSingleValueAsObject","unit","number","negative","trim","indexOf","replace","parseFloat","getValuesForCustomizer","values","singleValue","position","hasOwnProperty","updateComponentState","val","getValuesForInput","handleChange","e","target","arguments","length","source","ownKeys","keys","getOwnPropertySymbols","concat","filter","sym","getOwnPropertyDescriptor","forEach","$7dbcf7086e8d10dc$export$2e2bcd8739ae039","$d48ddae4a704ec47$export$2e2bcd8739ae039","set","fieldId","type","unitRef","useRef","createElement","className","tabIndex","label","description","Fragment","htmlFor","dangerouslySetInnerHTML","__html","ref","setNotificationContainer","onClick","default","class","items","push","makeMapable","map","item","id","onChange","wp","customize","Control","extend","initialize","params","this","bind","ReactDOM","render","removedControl","destroy","container","remove","onRemoved","element","notifications","unmountComponentAtNode","controlConstructor","KirkiMarginPaddingControl"],"version":3,"file":"control.js.map"}