{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js","webpack:///./node_modules/@babel/runtime/helpers/createClass.js","webpack:///./node_modules/uuid/dist/esm-browser/rng.js","webpack:///./node_modules/uuid/dist/esm-browser/bytesToUuid.js","webpack:///./node_modules/uuid/dist/esm-browser/v4.js","webpack:///./src/index.ts"],"names":["root","factory","exports","module","define","amd","a","i","window","installedModules","__webpack_require__","moduleId","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","instance","Constructor","TypeError","obj","configurable","writable","_defineProperties","target","props","length","descriptor","protoProps","staticProps","getRandomValues","crypto","msCrypto","rnds8","Uint8Array","rng","Error","byteToHex","push","toString","substr","buf","offset_","offset","toLowerCase","MessageTypes","options","rnds","random","Message","control","type","data","requestId","this","uuidv4","ArragroCmsCustomControlClass","self","top","validateOptions","ArragroCms","ArragroCmsCustomControlCallbacks","addEventListener","processMessage","undefined","onInit","onResetData","event","console","log","message","payload","Init","ResetData","OnFormChange","onFormChange","OnFormSubmit","onFormSubmit","SelectAsset","onAssetSelected","url","SelectContent","onContentSelected","parent","postMessage","sendMessage","SetHeight","height","OnChange","isValid","OnValidChange"],"mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,SACb,GAAqB,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,OACP,CACJ,IAAIK,EAAIL,IACR,IAAI,IAAIM,KAAKD,GAAuB,iBAAZJ,QAAuBA,QAAUF,GAAMO,GAAKD,EAAEC,IAPxE,CASGC,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAA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AM,sDAjEhC,kCAsEyBkC,GACjBxF,OAAOqG,OAAOC,YAAYd,EAAS,OAvE3C,6BA2EQ,IAAMA,EAAU,IAAIrB,EAAQK,KAAK9D,KAAMqD,EAAa2B,KAAM,MAC1DlB,KAAK+B,YAAYf,KA5EzB,gCA+EsBpE,GACd,IAAMoE,EAAU,IAAIrB,EAAQK,KAAK9D,KAAMqD,EAAayC,UAAW,CAAEC,OAAQrF,IACzEoD,KAAK+B,YAAYf,KAjFzB,+BAoFqB9E,EAAcU,GAC3B,IAAMoE,EAAU,IAAIrB,EAAQK,KAAK9D,KAAMqD,EAAa2C,SAAU,CAAEhG,OAAMU,UACtEoD,KAAK+B,YAAYf,KAtFzB,oCAyF0BmB,GAClB,IAAMnB,EAAU,IAAIrB,EAAQK,KAAK9D,KAAMqD,EAAa6C,cAAe,CAAED,YACrEnC,KAAK+B,YAAYf,KA3FzB,oCA+FQ,IAAMA,EAAU,IAAIrB,EAAQK,KAAK9D,KAAMqD,EAAaiC,YAAa,IACjExB,KAAK+B,YAAYf,KAhGzB,sCAoGQ,IAAMA,EAAU,IAAIrB,EAAQK,KAAK9D,KAAMqD,EAAaoC,cAAe,IACnE3B,KAAK+B,YAAYf,OArGzB","file":"arragrocms-customcontrol.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","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\nmodule.exports = _defineProperty;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n// find the complete implementation of crypto (msCrypto) on IE11.\nvar getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n\n return getRandomValues(rnds8);\n}","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction bytesToUuid(buf, offset_) {\n var offset = offset_ || 0; // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n\n return (byteToHex[buf[offset + 0]] + byteToHex[buf[offset + 1]] + byteToHex[buf[offset + 2]] + byteToHex[buf[offset + 3]] + '-' + byteToHex[buf[offset + 4]] + byteToHex[buf[offset + 5]] + '-' + byteToHex[buf[offset + 6]] + byteToHex[buf[offset + 7]] + '-' + byteToHex[buf[offset + 8]] + byteToHex[buf[offset + 9]] + '-' + byteToHex[buf[offset + 10]] + byteToHex[buf[offset + 11]] + byteToHex[buf[offset + 12]] + byteToHex[buf[offset + 13]] + byteToHex[buf[offset + 14]] + byteToHex[buf[offset + 15]]).toLowerCase();\n}\n\nexport default bytesToUuid;","import rng from './rng.js';\nimport bytesToUuid from './bytesToUuid.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return bytesToUuid(rnds);\n}\n\nexport default v4;","import { v4 as uuidv4 } from 'uuid'\r\nimport { Options } from '../types/global'\r\n\r\nenum MessageTypes {\r\n Init,\r\n SetHeight,\r\n ResetData,\r\n OnChange,\r\n OnValidChange,\r\n OnFormChange,\r\n SelectAsset,\r\n SelectContent,\r\n OnFormSubmit\r\n}\r\n\r\nclass Message {\r\n public control: string\r\n public type: MessageTypes\r\n public data: any\r\n public requestId: string\r\n\r\n constructor(control: string, type: MessageTypes, data: any) {\r\n this.control = control\r\n this.type = type\r\n this.data = data\r\n this.requestId = uuidv4()\r\n }\r\n}\r\n\r\nexport class ArragroCmsCustomControlClass {\r\n constructor (\r\n name: string,\r\n options: Options\r\n ) {\r\n if (window.self === window.top) {\r\n throw Error('The custom control must be hosted in an iframe')\r\n }\r\n this.name = name\r\n this.validateOptions(options)\r\n window.ArragroCms = {\r\n ArragroCmsCustomControlCallbacks: {\r\n [name]: options\r\n }\r\n }\r\n window.addEventListener('message', this.processMessage, true)\r\n }\r\n\r\n name: string\r\n\r\n private validateOptions (options: Options) {\r\n if (options.onInit === undefined) throw Error('You must supply onInit to options.') \r\n if (options.onResetData === undefined) throw Error('You must supply onResetData to options.')\r\n }\r\n\r\n private processMessage (event: MessageEvent) {\r\n console.log('Message Received', event, event.data.message.type)\r\n const message = event.data.message as Message\r\n const payload = event.data.payload\r\n if (message !== undefined &&\r\n payload !== undefined) {\r\n switch (message.type) {\r\n case MessageTypes.Init: {\r\n window.ArragroCms.ArragroCmsCustomControlCallbacks[this.name].onInit(payload)\r\n break;\r\n }\r\n case MessageTypes.ResetData: {\r\n window.ArragroCms.ArragroCmsCustomControlCallbacks[this.name].onResetData(payload)\r\n break;\r\n }\r\n case MessageTypes.OnFormChange: {\r\n if (window.ArragroCms.ArragroCmsCustomControlCallbacks[this.name].onFormChange) {\r\n window.ArragroCms.ArragroCmsCustomControlCallbacks[this.name].onFormChange!(payload)\r\n }\r\n break;\r\n }\r\n case MessageTypes.OnFormSubmit: {\r\n if (window.ArragroCms.ArragroCmsCustomControlCallbacks[this.name].onFormSubmit) {\r\n window.ArragroCms.ArragroCmsCustomControlCallbacks[this.name].onFormSubmit!(payload)\r\n }\r\n break;\r\n }\r\n case MessageTypes.SelectAsset: {\r\n if (window.ArragroCms.ArragroCmsCustomControlCallbacks[this.name].onAssetSelected) {\r\n window.ArragroCms.ArragroCmsCustomControlCallbacks[this.name].onAssetSelected!(payload.url)\r\n }\r\n break\r\n }\r\n case MessageTypes.SelectContent: {\r\n if (window.ArragroCms.ArragroCmsCustomControlCallbacks[this.name].onContentSelected) {\r\n window.ArragroCms.ArragroCmsCustomControlCallbacks[this.name].onContentSelected!(payload.url)\r\n }\r\n break\r\n }\r\n default:\r\n throw Error('A message has been received we do not cater for')\r\n }\r\n }\r\n }\r\n\r\n private sendMessage (message: Message) {\r\n window.parent.postMessage(message, '*')\r\n }\r\n\r\n public Init () {\r\n const message = new Message(this.name, MessageTypes.Init, null)\r\n this.sendMessage(message)\r\n }\r\n\r\n public SetHeight (value: number) {\r\n const message = new Message(this.name, MessageTypes.SetHeight, { height: value })\r\n this.sendMessage(message)\r\n }\r\n\r\n public OnChange (name: string, value: any) {\r\n const message = new Message(this.name, MessageTypes.OnChange, { name, value })\r\n this.sendMessage(message)\r\n }\r\n\r\n public OnValidChange (isValid: boolean) {\r\n const message = new Message(this.name, MessageTypes.OnValidChange, { isValid })\r\n this.sendMessage(message)\r\n }\r\n\r\n public SelectAsset () {\r\n const message = new Message(this.name, MessageTypes.SelectAsset, {})\r\n this.sendMessage(message)\r\n }\r\n\r\n public SelectContent () {\r\n const message = new Message(this.name, MessageTypes.SelectContent, {})\r\n this.sendMessage(message)\r\n }\r\n}\r\n"],"sourceRoot":""}