text
stringlengths
2
1.05M
import React from 'react'; import PropTypes from 'prop-types'; import { compose } from 'redux'; import { connect } from 'react-redux'; import { FormattedMessage, injectIntl, intlShape } from '../../util/reactIntl'; import { isScrollingDisabled } from '../../ducks/UI.duck'; import { TopbarContainer } from '../../containers'; import { Page, LayoutSideNavigation, LayoutWrapperMain, LayoutWrapperSideNav, LayoutWrapperTopbar, LayoutWrapperFooter, Footer, TermsOfService, } from '../../components'; import config from '../../config'; import css from './TermsOfServicePage.css'; const TermsOfServicePageComponent = props => { const { scrollingDisabled, intl } = props; const tabs = [ { text: intl.formatMessage({ id: 'TermsOfServicePage.tosTabTitle' }), selected: true, linkProps: { name: 'TermsOfServicePage', }, }, { text: intl.formatMessage({ id: 'TermsOfServicePage.privacyTabTitle' }), selected: false, linkProps: { name: 'PrivacyPolicyPage', }, }, ]; const siteTitle = config.siteTitle; const schemaTitle = intl.formatMessage({ id: 'TermsOfServicePage.schemaTitle' }, { siteTitle }); const schema = { '@context': 'http://schema.org', '@type': 'WebPage', name: schemaTitle, }; return ( <Page title={schemaTitle} scrollingDisabled={scrollingDisabled} schema={schema}> <LayoutSideNavigation> <LayoutWrapperTopbar> <TopbarContainer currentPage="TermsOfServicePage" /> </LayoutWrapperTopbar> <LayoutWrapperSideNav tabs={tabs} /> <LayoutWrapperMain> <div className={css.content}> <h1 className={css.heading}> <FormattedMessage id="TermsOfServicePage.heading" /> </h1> <TermsOfService /> </div> </LayoutWrapperMain> <LayoutWrapperFooter> <Footer /> </LayoutWrapperFooter> </LayoutSideNavigation> </Page> ); }; const { bool } = PropTypes; TermsOfServicePageComponent.propTypes = { scrollingDisabled: bool.isRequired, // from injectIntl intl: intlShape.isRequired, }; const mapStateToProps = state => { return { scrollingDisabled: isScrollingDisabled(state), }; }; const TermsOfServicePage = compose( connect(mapStateToProps), injectIntl )(TermsOfServicePageComponent); export default TermsOfServicePage;
define([ '../Core/BoundingSphere', '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', '../Core/clone', '../Core/defined', '../Core/defineProperties', '../Core/Matrix2', '../Core/Matrix3', '../Core/Matrix4', '../Core/Quaternion', '../Core/RuntimeError', '../Core/WebGLConstants', '../Renderer/ShaderSource', '../ThirdParty/GltfPipeline/addToArray', '../ThirdParty/GltfPipeline/ForEach', '../ThirdParty/GltfPipeline/hasExtension', './AttributeType', './Axis' ], function( BoundingSphere, Cartesian2, Cartesian3, Cartesian4, clone, defined, defineProperties, Matrix2, Matrix3, Matrix4, Quaternion, RuntimeError, WebGLConstants, ShaderSource, addToArray, ForEach, hasExtension, AttributeType, Axis) { 'use strict'; /** * @private */ var ModelUtility = {}; /** * Updates the model's forward axis if the model is not a 2.0 model. * * @param {Object} model The model to update. */ ModelUtility.updateForwardAxis = function(model) { var cachedSourceVersion = model.gltf.extras.sourceVersion; if ((defined(cachedSourceVersion) && cachedSourceVersion !== '2.0') || ModelUtility.getAssetVersion(model.gltf) !== '2.0') { model._gltfForwardAxis = Axis.X; } }; /** * Gets the string representing the glTF asset version. * * @param {Object} gltf A javascript object containing a glTF asset. * @returns {String} The glTF asset version string. */ ModelUtility.getAssetVersion = function(gltf) { // In glTF 1.0 it was valid to omit the version number. if (!defined(gltf.asset) || !defined(gltf.asset.version)) { return '1.0'; } return gltf.asset.version; }; /** * Splits primitive materials with values incompatible for generating techniques. * * @param {Object} gltf A javascript object containing a glTF asset. * @returns {Object} The glTF asset with modified materials. */ ModelUtility.splitIncompatibleMaterials = function(gltf) { var accessors = gltf.accessors; var materials = gltf.materials; var primitiveInfoByMaterial = {}; ForEach.mesh(gltf, function(mesh) { ForEach.meshPrimitive(mesh, function(primitive) { var materialIndex = primitive.material; var material = materials[materialIndex]; var jointAccessorId = primitive.attributes.JOINTS_0; var componentType; var type; if (defined(jointAccessorId)) { var jointAccessor = accessors[jointAccessorId]; componentType = jointAccessor.componentType; type = jointAccessor.type; } var isSkinned = defined(jointAccessorId); var hasVertexColors = defined(primitive.attributes.COLOR_0); var hasMorphTargets = defined(primitive.targets); var hasNormals = defined(primitive.attributes.NORMAL); var hasTangents = defined(primitive.attributes.TANGENT); var hasTexCoords = defined(primitive.attributes.TEXCOORD_0); var primitiveInfo = primitiveInfoByMaterial[materialIndex]; if (!defined(primitiveInfo)) { primitiveInfoByMaterial[materialIndex] = { skinning: { skinned: isSkinned, componentType: componentType, type: type }, hasVertexColors: hasVertexColors, hasMorphTargets: hasMorphTargets, hasNormals: hasNormals, hasTangents: hasTangents, hasTexCoords: hasTexCoords }; } else if ((primitiveInfo.skinning.skinned !== isSkinned) || (primitiveInfo.skinning.type !== type) || (primitiveInfo.hasVertexColors !== hasVertexColors) || (primitiveInfo.hasMorphTargets !== hasMorphTargets) || (primitiveInfo.hasNormals !== hasNormals) || (primitiveInfo.hasTangents !== hasTangents) || (primitiveInfo.hasTexCoords !== hasTexCoords)) { // This primitive uses the same material as another one that either: // * Isn't skinned // * Uses a different type to store joints and weights // * Doesn't have vertex colors, morph targets, normals, tangents, or texCoords var clonedMaterial = clone(material, true); // Split this off as a separate material materialIndex = addToArray(materials, clonedMaterial); primitive.material = materialIndex; primitiveInfoByMaterial[materialIndex] = { skinning: { skinned: isSkinned, componentType: componentType, type: type }, hasVertexColors: hasVertexColors, hasMorphTargets: hasMorphTargets, hasNormals: hasNormals, hasTangents: hasTangents, hasTexCoords: hasTexCoords }; } }); }); return primitiveInfoByMaterial; }; ModelUtility.getShaderVariable = function(type) { if (type === 'SCALAR') { return 'float'; } return type.toLowerCase(); }; ModelUtility.ModelState = { NEEDS_LOAD: 0, LOADING: 1, LOADED: 2, // Renderable, but textures can still be pending when incrementallyLoadTextures is true. FAILED: 3 }; ModelUtility.getFailedLoadFunction = function(model, type, path) { return function(error) { model._state = ModelUtility.ModelState.FAILED; var message = 'Failed to load ' + type + ': ' + path; if (defined(error)) { message += '\n' + error.message; } model._readyPromise.reject(new RuntimeError(message)); }; }; ModelUtility.parseBuffers = function(model, bufferLoad) { var loadResources = model._loadResources; ForEach.buffer(model.gltf, function(buffer, bufferViewId) { if (defined(buffer.extras._pipeline.source)) { loadResources.buffers[bufferViewId] = buffer.extras._pipeline.source; } else if (defined(bufferLoad)) { var bufferResource = model._resource.getDerivedResource({ url: buffer.uri }); ++loadResources.pendingBufferLoads; bufferResource.fetchArrayBuffer() .then(bufferLoad(model, bufferViewId)) .otherwise(ModelUtility.getFailedLoadFunction(model, 'buffer', bufferResource.url)); } }); }; var aMinScratch = new Cartesian3(); var aMaxScratch = new Cartesian3(); ModelUtility.computeBoundingSphere = function(model) { var gltf = model.gltf; var gltfNodes = gltf.nodes; var gltfMeshes = gltf.meshes; var rootNodes = gltf.scenes[gltf.scene].nodes; var rootNodesLength = rootNodes.length; var nodeStack = []; var min = new Cartesian3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); var max = new Cartesian3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); for (var i = 0; i < rootNodesLength; ++i) { var n = gltfNodes[rootNodes[i]]; n._transformToRoot = ModelUtility.getTransform(n); nodeStack.push(n); while (nodeStack.length > 0) { n = nodeStack.pop(); var transformToRoot = n._transformToRoot; var meshId = n.mesh; if (defined(meshId)) { var mesh = gltfMeshes[meshId]; var primitives = mesh.primitives; var primitivesLength = primitives.length; for (var m = 0; m < primitivesLength; ++m) { var positionAccessor = primitives[m].attributes.POSITION; if (defined(positionAccessor)) { var minMax = ModelUtility.getAccessorMinMax(gltf, positionAccessor); var aMin = Cartesian3.fromArray(minMax.min, 0, aMinScratch); var aMax = Cartesian3.fromArray(minMax.max, 0, aMaxScratch); if (defined(min) && defined(max)) { Matrix4.multiplyByPoint(transformToRoot, aMin, aMin); Matrix4.multiplyByPoint(transformToRoot, aMax, aMax); Cartesian3.minimumByComponent(min, aMin, min); Cartesian3.maximumByComponent(max, aMax, max); } } } } var children = n.children; if (defined(children)) { var childrenLength = children.length; for (var k = 0; k < childrenLength; ++k) { var child = gltfNodes[children[k]]; child._transformToRoot = ModelUtility.getTransform(child); Matrix4.multiplyTransformation(transformToRoot, child._transformToRoot, child._transformToRoot); nodeStack.push(child); } } delete n._transformToRoot; } } var boundingSphere = BoundingSphere.fromCornerPoints(min, max); if (model._forwardAxis === Axis.Z) { // glTF 2.0 has a Z-forward convention that must be adapted here to X-forward. BoundingSphere.transformWithoutScale(boundingSphere, Axis.Z_UP_TO_X_UP, boundingSphere); } if (model._upAxis === Axis.Y) { BoundingSphere.transformWithoutScale(boundingSphere, Axis.Y_UP_TO_Z_UP, boundingSphere); } else if (model._upAxis === Axis.X) { BoundingSphere.transformWithoutScale(boundingSphere, Axis.X_UP_TO_Z_UP, boundingSphere); } return boundingSphere; }; function techniqueAttributeForSemantic(technique, semantic) { return ForEach.techniqueAttribute(technique, function(attribute, attributeName) { if (attribute.semantic === semantic) { return attributeName; } }); } function ensureSemanticExistenceForPrimitive(gltf, primitive) { var accessors = gltf.accessors; var materials = gltf.materials; var techniquesWebgl = gltf.extensions.KHR_techniques_webgl; var techniques = techniquesWebgl.techniques; var programs = techniquesWebgl.programs; var shaders = techniquesWebgl.shaders; var targets = primitive.targets; var attributes = primitive.attributes; for (var target in targets) { if (targets.hasOwnProperty(target)) { var targetAttributes = targets[target]; for (var attribute in targetAttributes) { if (attribute !== 'extras') { attributes[attribute + '_' + target] = targetAttributes[attribute]; } } } } var material = materials[primitive.material]; var technique = techniques[material.extensions.KHR_techniques_webgl.technique]; var program = programs[technique.program]; var vertexShader = shaders[program.vertexShader]; for (var semantic in attributes) { if (attributes.hasOwnProperty(semantic)) { if (!defined(techniqueAttributeForSemantic(technique, semantic))) { var accessorId = attributes[semantic]; var accessor = accessors[accessorId]; var lowerCase = semantic.toLowerCase(); if (lowerCase.charAt(0) === '_') { lowerCase = lowerCase.slice(1); } var attributeName = 'a_' + lowerCase; technique.attributes[attributeName] = { semantic: semantic, type: accessor.componentType }; var pipelineExtras = vertexShader.extras._pipeline; var shaderText = pipelineExtras.source; shaderText = 'attribute ' + ModelUtility.getShaderVariable(accessor.type) + ' ' + attributeName + ';\n' + shaderText; pipelineExtras.source = shaderText; } } } } /** * Ensures all attributes present on the primitive are present in the technique and * vertex shader. * * @param {Object} gltf A javascript object containing a glTF asset. * @returns {Object} The glTF asset, including any additional attributes. */ ModelUtility.ensureSemanticExistence = function (gltf) { ForEach.mesh(gltf, function(mesh) { ForEach.meshPrimitive(mesh, function(primitive) { ensureSemanticExistenceForPrimitive(gltf, primitive); }); }); return gltf; }; /** * Creates attribute location for all attributes required by a technique. * * @param {Object} technique A glTF KHR_techniques_webgl technique object. * @param {Object} precreatedAttributes A dictionary object of pre-created attributes for which to also create locations. * @returns {Object} A dictionary object containing attribute names and their locations. */ ModelUtility.createAttributeLocations = function(technique, precreatedAttributes) { var attributeLocations = {}; var hasIndex0 = false; var i = 1; ForEach.techniqueAttribute(technique, function (attribute, attributeName) { // Set the position attribute to the 0th index. In some WebGL implementations the shader // will not work correctly if the 0th attribute is not active. For example, some glTF models // list the normal attribute first but derived shaders like the cast-shadows shader do not use // the normal attribute. if (/pos/i.test(attributeName) && !hasIndex0) { attributeLocations[attributeName] = 0; hasIndex0 = true; } else { attributeLocations[attributeName] = i++; } }); if (defined(precreatedAttributes)) { for (var attributeName in precreatedAttributes) { if (precreatedAttributes.hasOwnProperty(attributeName)) { attributeLocations[attributeName] = i++; } } } return attributeLocations; }; ModelUtility.getAccessorMinMax = function(gltf, accessorId) { var accessor = gltf.accessors[accessorId]; var extensions = accessor.extensions; var accessorMin = accessor.min; var accessorMax = accessor.max; // If this accessor is quantized, we should use the decoded min and max if (defined(extensions)) { var quantizedAttributes = extensions.WEB3D_quantized_attributes; if (defined(quantizedAttributes)) { accessorMin = quantizedAttributes.decodedMin; accessorMax = quantizedAttributes.decodedMax; } } return { min : accessorMin, max : accessorMax }; }; function getTechniqueAttributeOrUniformFunction(gltf, technique, semantic, ignoreNodes) { if (hasExtension(gltf, 'KHR_techniques_webgl')) { return function(attributeOrUniform, attributeOrUniformName) { if (attributeOrUniform.semantic === semantic && (!ignoreNodes || !defined(attributeOrUniform.node))) { return attributeOrUniformName; } }; } return function(parameterName, attributeOrUniformName) { var attributeOrUniform = technique.parameters[parameterName]; if (attributeOrUniform.semantic === semantic && (!ignoreNodes || !defined(attributeOrUniform.node))) { return attributeOrUniformName; } }; } ModelUtility.getAttributeOrUniformBySemantic = function(gltf, semantic, programId, ignoreNodes) { return ForEach.technique(gltf, function(technique) { if (defined(programId) && (technique.program !== programId)) { return; } var value = ForEach.techniqueAttribute(technique, getTechniqueAttributeOrUniformFunction(gltf, technique, semantic, ignoreNodes)); if (defined(value)) { return value; } return ForEach.techniqueUniform(technique, getTechniqueAttributeOrUniformFunction(gltf, technique, semantic, ignoreNodes)); }); }; ModelUtility.getDiffuseAttributeOrUniform = function(gltf, programId) { var diffuseUniformName = ModelUtility.getAttributeOrUniformBySemantic(gltf, 'COLOR_0', programId); if (!defined(diffuseUniformName)) { diffuseUniformName = ModelUtility.getAttributeOrUniformBySemantic(gltf, '_3DTILESDIFFUSE', programId); } return diffuseUniformName; }; var nodeTranslationScratch = new Cartesian3(); var nodeQuaternionScratch = new Quaternion(); var nodeScaleScratch = new Cartesian3(); ModelUtility.getTransform = function(node, result) { if (defined(node.matrix)) { return Matrix4.fromColumnMajorArray(node.matrix, result); } return Matrix4.fromTranslationQuaternionRotationScale( Cartesian3.fromArray(node.translation, 0, nodeTranslationScratch), Quaternion.unpack(node.rotation, 0, nodeQuaternionScratch), Cartesian3.fromArray(node.scale, 0, nodeScaleScratch), result); }; ModelUtility.getUsedExtensions = function(gltf) { var extensionsUsed = gltf.extensionsUsed; var cachedExtensionsUsed = {}; if (defined(extensionsUsed)) { var extensionsUsedLength = extensionsUsed.length; for (var i = 0; i < extensionsUsedLength; i++) { var extension = extensionsUsed[i]; cachedExtensionsUsed[extension] = true; } } return cachedExtensionsUsed; }; ModelUtility.getRequiredExtensions = function(gltf) { var extensionsRequired = gltf.extensionsRequired; var cachedExtensionsRequired = {}; if (defined(extensionsRequired)) { var extensionsRequiredLength = extensionsRequired.length; for (var i = 0; i < extensionsRequiredLength; i++) { var extension = extensionsRequired[i]; cachedExtensionsRequired[extension] = true; } } return cachedExtensionsRequired; }; ModelUtility.supportedExtensions = { 'AGI_articulations' : true, 'CESIUM_RTC' : true, 'EXT_texture_webp' : true, 'KHR_blend' : true, 'KHR_binary_glTF' : true, 'KHR_draco_mesh_compression' : true, 'KHR_materials_common' : true, 'KHR_techniques_webgl' : true, 'KHR_materials_unlit' : true, 'KHR_materials_pbrSpecularGlossiness' : true, 'KHR_texture_transform' : true, 'WEB3D_quantized_attributes' : true }; ModelUtility.checkSupportedExtensions = function(extensionsRequired, browserSupportsWebp) { for (var extension in extensionsRequired) { if (extensionsRequired.hasOwnProperty(extension)) { if (!ModelUtility.supportedExtensions[extension]) { throw new RuntimeError('Unsupported glTF Extension: ' + extension); } if (extension === 'EXT_texture_webp' && browserSupportsWebp === false) { throw new RuntimeError('Loaded model requires WebP but browser does not support it.'); } } } }; ModelUtility.checkSupportedGlExtensions = function(extensionsUsed, context) { if (defined(extensionsUsed)) { var glExtensionsUsedLength = extensionsUsed.length; for (var i = 0; i < glExtensionsUsedLength; i++) { var extension = extensionsUsed[i]; if (extension !== 'OES_element_index_uint') { throw new RuntimeError('Unsupported WebGL Extension: ' + extension); } else if (!context.elementIndexUint) { throw new RuntimeError('OES_element_index_uint WebGL extension is not enabled.'); } } } }; function replaceAllButFirstInString(string, find, replace) { // Limit search to strings that are not a subset of other tokens. find += '(?!\\w)'; find = new RegExp(find, 'g'); var index = string.search(find); return string.replace(find, function(match, offset) { return index === offset ? match : replace; }); } function getQuantizedAttributes(gltf, accessorId) { var accessor = gltf.accessors[accessorId]; var extensions = accessor.extensions; if (defined(extensions)) { return extensions.WEB3D_quantized_attributes; } return undefined; } function getAttributeVariableName(gltf, primitive, attributeSemantic) { var materialId = primitive.material; var material = gltf.materials[materialId]; if (!hasExtension(gltf, 'KHR_techniques_webgl') || !defined(material.extensions) || !defined(material.extensions.KHR_techniques_webgl)) { return; } var techniqueId = material.extensions.KHR_techniques_webgl.technique; var techniquesWebgl = gltf.extensions.KHR_techniques_webgl; var technique = techniquesWebgl.techniques[techniqueId]; return ForEach.techniqueAttribute(technique, function(attribute, attributeName) { var semantic = attribute.semantic; if (semantic === attributeSemantic) { return attributeName; } }); } ModelUtility.modifyShaderForDracoQuantizedAttributes = function(gltf, primitive, shader, decodedAttributes) { var quantizedUniforms = {}; for (var attributeSemantic in decodedAttributes) { if (decodedAttributes.hasOwnProperty(attributeSemantic)) { var attribute = decodedAttributes[attributeSemantic]; var quantization = attribute.quantization; if (!defined(quantization)) { continue; } var attributeVarName = getAttributeVariableName(gltf, primitive, attributeSemantic); if (attributeSemantic.charAt(0) === '_') { attributeSemantic = attributeSemantic.substring(1); } var decodeUniformVarName = 'gltf_u_dec_' + attributeSemantic.toLowerCase(); if (!defined(quantizedUniforms[decodeUniformVarName])) { var newMain = 'gltf_decoded_' + attributeSemantic; var decodedAttributeVarName = attributeVarName.replace('a_', 'gltf_a_dec_'); var size = attribute.componentsPerAttribute; // replace usages of the original attribute with the decoded version, but not the declaration shader = replaceAllButFirstInString(shader, attributeVarName, decodedAttributeVarName); // declare decoded attribute var variableType; if (quantization.octEncoded) { variableType = 'vec3'; } else if (size > 1) { variableType = 'vec' + size; } else { variableType = 'float'; } shader = variableType + ' ' + decodedAttributeVarName + ';\n' + shader; // The gltf 2.0 COLOR_0 vertex attribute can be VEC4 or VEC3 var vec3Color = size === 3 && attributeSemantic === 'COLOR_0'; if (vec3Color) { shader = replaceAllButFirstInString(shader, decodedAttributeVarName, 'vec4(' + decodedAttributeVarName + ', 1.0)'); } // splice decode function into the shader var decode = ''; if (quantization.octEncoded) { var decodeUniformVarNameRangeConstant = decodeUniformVarName + '_rangeConstant'; shader = 'uniform float ' + decodeUniformVarNameRangeConstant + ';\n' + shader; decode = '\n' + 'void main() {\n' + // Draco oct-encoding decodes to zxy order ' ' + decodedAttributeVarName + ' = czm_octDecode(' + attributeVarName + '.xy, ' + decodeUniformVarNameRangeConstant + ').zxy;\n' + ' ' + newMain + '();\n' + '}\n'; } else { var decodeUniformVarNameNormConstant = decodeUniformVarName + '_normConstant'; var decodeUniformVarNameMin = decodeUniformVarName + '_min'; shader = 'uniform float ' + decodeUniformVarNameNormConstant + ';\n' + 'uniform ' + variableType + ' ' + decodeUniformVarNameMin + ';\n' + shader; var attributeVarAccess = vec3Color ? '.xyz' : ''; decode = '\n' + 'void main() {\n' + ' ' + decodedAttributeVarName + ' = ' + decodeUniformVarNameMin + ' + ' + attributeVarName + attributeVarAccess + ' * ' + decodeUniformVarNameNormConstant + ';\n' + ' ' + newMain + '();\n' + '}\n'; } shader = ShaderSource.replaceMain(shader, newMain); shader += decode; } } } return { shader : shader }; }; ModelUtility.modifyShaderForQuantizedAttributes = function(gltf, primitive, shader) { var quantizedUniforms = {}; var attributes = primitive.attributes; for (var attributeSemantic in attributes) { if (attributes.hasOwnProperty(attributeSemantic)) { var attributeVarName = getAttributeVariableName(gltf, primitive, attributeSemantic); var accessorId = primitive.attributes[attributeSemantic]; if (attributeSemantic.charAt(0) === '_') { attributeSemantic = attributeSemantic.substring(1); } var decodeUniformVarName = 'gltf_u_dec_' + attributeSemantic.toLowerCase(); var decodeUniformVarNameScale = decodeUniformVarName + '_scale'; var decodeUniformVarNameTranslate = decodeUniformVarName + '_translate'; if (!defined(quantizedUniforms[decodeUniformVarName]) && !defined(quantizedUniforms[decodeUniformVarNameScale])) { var quantizedAttributes = getQuantizedAttributes(gltf, accessorId); if (defined(quantizedAttributes)) { var decodeMatrix = quantizedAttributes.decodeMatrix; var newMain = 'gltf_decoded_' + attributeSemantic; var decodedAttributeVarName = attributeVarName.replace('a_', 'gltf_a_dec_'); var size = Math.floor(Math.sqrt(decodeMatrix.length)); // replace usages of the original attribute with the decoded version, but not the declaration shader = replaceAllButFirstInString(shader, attributeVarName, decodedAttributeVarName); // declare decoded attribute var variableType; if (size > 2) { variableType = 'vec' + (size - 1); } else { variableType = 'float'; } shader = variableType + ' ' + decodedAttributeVarName + ';\n' + shader; // splice decode function into the shader - attributes are pre-multiplied with the decode matrix // uniform in the shader (32-bit floating point) var decode = ''; if (size === 5) { // separate scale and translate since glsl doesn't have mat5 shader = 'uniform mat4 ' + decodeUniformVarNameScale + ';\n' + shader; shader = 'uniform vec4 ' + decodeUniformVarNameTranslate + ';\n' + shader; decode = '\n' + 'void main() {\n' + ' ' + decodedAttributeVarName + ' = ' + decodeUniformVarNameScale + ' * ' + attributeVarName + ' + ' + decodeUniformVarNameTranslate + ';\n' + ' ' + newMain + '();\n' + '}\n'; quantizedUniforms[decodeUniformVarNameScale] = {mat : 4}; quantizedUniforms[decodeUniformVarNameTranslate] = {vec : 4}; } else { shader = 'uniform mat' + size + ' ' + decodeUniformVarName + ';\n' + shader; decode = '\n' + 'void main() {\n' + ' ' + decodedAttributeVarName + ' = ' + variableType + '(' + decodeUniformVarName + ' * vec' + size + '(' + attributeVarName + ',1.0));\n' + ' ' + newMain + '();\n' + '}\n'; quantizedUniforms[decodeUniformVarName] = {mat : size}; } shader = ShaderSource.replaceMain(shader, newMain); shader += decode; } } } } return { shader : shader, uniforms : quantizedUniforms }; }; ModelUtility.toClipCoordinatesGLSL = function(gltf, shader) { var positionName = ModelUtility.getAttributeOrUniformBySemantic(gltf, 'POSITION'); var decodedPositionName = positionName.replace('a_', 'gltf_a_dec_'); if (shader.indexOf(decodedPositionName) !== -1) { positionName = decodedPositionName; } var modelViewProjectionName = ModelUtility.getAttributeOrUniformBySemantic(gltf, 'MODELVIEWPROJECTION', undefined, true); if (!defined(modelViewProjectionName) || shader.indexOf(modelViewProjectionName) === -1) { var projectionName = ModelUtility.getAttributeOrUniformBySemantic(gltf, 'PROJECTION', undefined, true); var modelViewName = ModelUtility.getAttributeOrUniformBySemantic(gltf, 'MODELVIEW', undefined, true); if (shader.indexOf('czm_instanced_modelView ') !== -1) { modelViewName = 'czm_instanced_modelView'; } else if (!defined(modelViewName)) { modelViewName = ModelUtility.getAttributeOrUniformBySemantic(gltf, 'CESIUM_RTC_MODELVIEW', undefined, true); } modelViewProjectionName = projectionName + ' * ' + modelViewName; } return modelViewProjectionName + ' * vec4(' + positionName + '.xyz, 1.0)'; }; ModelUtility.modifyFragmentShaderForLogDepth = function(shader) { shader = ShaderSource.replaceMain(shader, 'czm_depth_main'); shader += '\n' + 'void main() \n' + '{ \n' + ' czm_depth_main(); \n' + ' czm_writeLogDepth(); \n' + '} \n'; return shader; }; ModelUtility.modifyVertexShaderForLogDepth = function(shader, toClipCoordinatesGLSL) { shader = ShaderSource.replaceMain(shader, 'czm_depth_main'); shader += '\n' + 'void main() \n' + '{ \n' + ' czm_depth_main(); \n' + ' czm_vertexLogDepth(' + toClipCoordinatesGLSL + '); \n' + '} \n'; return shader; }; function getScalarUniformFunction(value) { var that = { value : value, clone : function(source, result) { return source; }, func : function() { return that.value; } }; return that; } function getVec2UniformFunction(value) { var that = { value : Cartesian2.fromArray(value), clone : Cartesian2.clone, func : function() { return that.value; } }; return that; } function getVec3UniformFunction(value) { var that = { value : Cartesian3.fromArray(value), clone : Cartesian3.clone, func : function() { return that.value; } }; return that; } function getVec4UniformFunction(value) { var that = { value : Cartesian4.fromArray(value), clone : Cartesian4.clone, func : function() { return that.value; } }; return that; } function getMat2UniformFunction(value) { var that = { value : Matrix2.fromColumnMajorArray(value), clone : Matrix2.clone, func : function() { return that.value; } }; return that; } function getMat3UniformFunction(value) { var that = { value : Matrix3.fromColumnMajorArray(value), clone : Matrix3.clone, func : function() { return that.value; } }; return that; } function getMat4UniformFunction(value) { var that = { value : Matrix4.fromColumnMajorArray(value), clone : Matrix4.clone, func : function() { return that.value; } }; return that; } /////////////////////////////////////////////////////////////////////////// function DelayLoadedTextureUniform(value, textures, defaultTexture) { this._value = undefined; this._textureId = value.index; this._textures = textures; this._defaultTexture = defaultTexture; } defineProperties(DelayLoadedTextureUniform.prototype, { value : { get : function() { // Use the default texture (1x1 white) until the model's texture is loaded if (!defined(this._value)) { var texture = this._textures[this._textureId]; if (defined(texture)) { this._value = texture; } else { return this._defaultTexture; } } return this._value; }, set : function(value) { this._value = value; } } }); DelayLoadedTextureUniform.prototype.clone = function(source) { return source; }; DelayLoadedTextureUniform.prototype.func = undefined; /////////////////////////////////////////////////////////////////////////// function getTextureUniformFunction(value, textures, defaultTexture) { var uniform = new DelayLoadedTextureUniform(value, textures, defaultTexture); // Define function here to access closure since 'this' can't be // used when the Renderer sets uniforms. uniform.func = function() { return uniform.value; }; return uniform; } var gltfUniformFunctions = {}; gltfUniformFunctions[WebGLConstants.FLOAT] = getScalarUniformFunction; gltfUniformFunctions[WebGLConstants.FLOAT_VEC2] = getVec2UniformFunction; gltfUniformFunctions[WebGLConstants.FLOAT_VEC3] = getVec3UniformFunction; gltfUniformFunctions[WebGLConstants.FLOAT_VEC4] = getVec4UniformFunction; gltfUniformFunctions[WebGLConstants.INT] = getScalarUniformFunction; gltfUniformFunctions[WebGLConstants.INT_VEC2] = getVec2UniformFunction; gltfUniformFunctions[WebGLConstants.INT_VEC3] = getVec3UniformFunction; gltfUniformFunctions[WebGLConstants.INT_VEC4] = getVec4UniformFunction; gltfUniformFunctions[WebGLConstants.BOOL] = getScalarUniformFunction; gltfUniformFunctions[WebGLConstants.BOOL_VEC2] = getVec2UniformFunction; gltfUniformFunctions[WebGLConstants.BOOL_VEC3] = getVec3UniformFunction; gltfUniformFunctions[WebGLConstants.BOOL_VEC4] = getVec4UniformFunction; gltfUniformFunctions[WebGLConstants.FLOAT_MAT2] = getMat2UniformFunction; gltfUniformFunctions[WebGLConstants.FLOAT_MAT3] = getMat3UniformFunction; gltfUniformFunctions[WebGLConstants.FLOAT_MAT4] = getMat4UniformFunction; gltfUniformFunctions[WebGLConstants.SAMPLER_2D] = getTextureUniformFunction; // GLTF_SPEC: Support SAMPLER_CUBE. https://github.com/KhronosGroup/glTF/issues/40 ModelUtility.createUniformFunction = function(type, value, textures, defaultTexture) { return gltfUniformFunctions[type](value, textures, defaultTexture); }; function scaleFromMatrix5Array(matrix) { return [matrix[0], matrix[1], matrix[2], matrix[3], matrix[5], matrix[6], matrix[7], matrix[8], matrix[10], matrix[11], matrix[12], matrix[13], matrix[15], matrix[16], matrix[17], matrix[18]]; } function translateFromMatrix5Array(matrix) { return [matrix[20], matrix[21], matrix[22], matrix[23]]; } ModelUtility.createUniformsForDracoQuantizedAttributes = function(decodedAttributes) { var uniformMap = {}; for (var attribute in decodedAttributes) { if (decodedAttributes.hasOwnProperty(attribute)) { var decodedData = decodedAttributes[attribute]; var quantization = decodedData.quantization; if (!defined(quantization)) { continue; } if (attribute.charAt(0) === '_'){ attribute = attribute.substring(1); } var uniformVarName = 'gltf_u_dec_' + attribute.toLowerCase(); if (quantization.octEncoded) { var uniformVarNameRangeConstant = uniformVarName + '_rangeConstant'; var rangeConstant = (1 << quantization.quantizationBits) - 1.0; uniformMap[uniformVarNameRangeConstant] = getScalarUniformFunction(rangeConstant).func; continue; } var uniformVarNameNormConstant = uniformVarName + '_normConstant'; var normConstant = quantization.range / (1 << quantization.quantizationBits); uniformMap[uniformVarNameNormConstant] = getScalarUniformFunction(normConstant).func; var uniformVarNameMin = uniformVarName + '_min'; switch (decodedData.componentsPerAttribute) { case 1: uniformMap[uniformVarNameMin] = getScalarUniformFunction(quantization.minValues).func; break; case 2: uniformMap[uniformVarNameMin] = getVec2UniformFunction(quantization.minValues).func; break; case 3: uniformMap[uniformVarNameMin] = getVec3UniformFunction(quantization.minValues).func; break; case 4: uniformMap[uniformVarNameMin] = getVec4UniformFunction(quantization.minValues).func; break; } } } return uniformMap; }; ModelUtility.createUniformsForQuantizedAttributes = function(gltf, primitive, quantizedUniforms) { var accessors = gltf.accessors; var setUniforms = {}; var uniformMap = {}; var attributes = primitive.attributes; for (var attribute in attributes) { if (attributes.hasOwnProperty(attribute)) { var accessorId = attributes[attribute]; var a = accessors[accessorId]; var extensions = a.extensions; if (attribute.charAt(0) === '_') { attribute = attribute.substring(1); } if (defined(extensions)) { var quantizedAttributes = extensions.WEB3D_quantized_attributes; if (defined(quantizedAttributes)) { var decodeMatrix = quantizedAttributes.decodeMatrix; var uniformVariable = 'gltf_u_dec_' + attribute.toLowerCase(); switch (a.type) { case AttributeType.SCALAR: uniformMap[uniformVariable] = getMat2UniformFunction(decodeMatrix).func; setUniforms[uniformVariable] = true; break; case AttributeType.VEC2: uniformMap[uniformVariable] = getMat3UniformFunction(decodeMatrix).func; setUniforms[uniformVariable] = true; break; case AttributeType.VEC3: uniformMap[uniformVariable] = getMat4UniformFunction(decodeMatrix).func; setUniforms[uniformVariable] = true; break; case AttributeType.VEC4: // VEC4 attributes are split into scale and translate because there is no mat5 in GLSL var uniformVariableScale = uniformVariable + '_scale'; var uniformVariableTranslate = uniformVariable + '_translate'; uniformMap[uniformVariableScale] = getMat4UniformFunction(scaleFromMatrix5Array(decodeMatrix)).func; uniformMap[uniformVariableTranslate] = getVec4UniformFunction(translateFromMatrix5Array(decodeMatrix)).func; setUniforms[uniformVariableScale] = true; setUniforms[uniformVariableTranslate] = true; break; } } } } } // If there are any unset quantized uniforms in this program, they should be set to the identity for (var quantizedUniform in quantizedUniforms) { if (quantizedUniforms.hasOwnProperty(quantizedUniform)) { if (!setUniforms[quantizedUniform]) { var properties = quantizedUniforms[quantizedUniform]; if (defined(properties.mat)) { if (properties.mat === 2) { uniformMap[quantizedUniform] = getMat2UniformFunction(Matrix2.IDENTITY).func; } else if (properties.mat === 3) { uniformMap[quantizedUniform] = getMat3UniformFunction(Matrix3.IDENTITY).func; } else if (properties.mat === 4) { uniformMap[quantizedUniform] = getMat4UniformFunction(Matrix4.IDENTITY).func; } } if (defined(properties.vec)) { if (properties.vec === 4) { uniformMap[quantizedUniform] = getVec4UniformFunction([0, 0, 0, 0]).func; } } } } } return uniformMap; }; // This doesn't support LOCAL, which we could add if it is ever used. var scratchTranslationRtc = new Cartesian3(); var gltfSemanticUniforms = { MODEL : function(uniformState, model) { return function() { return uniformState.model; }; }, VIEW : function(uniformState, model) { return function() { return uniformState.view; }; }, PROJECTION : function(uniformState, model) { return function() { return uniformState.projection; }; }, MODELVIEW : function(uniformState, model) { return function() { return uniformState.modelView; }; }, CESIUM_RTC_MODELVIEW : function(uniformState, model) { // CESIUM_RTC extension var mvRtc = new Matrix4(); return function() { if (defined(model._rtcCenter)) { Matrix4.getTranslation(uniformState.model, scratchTranslationRtc); Cartesian3.add(scratchTranslationRtc, model._rtcCenter, scratchTranslationRtc); Matrix4.multiplyByPoint(uniformState.view, scratchTranslationRtc, scratchTranslationRtc); return Matrix4.setTranslation(uniformState.modelView, scratchTranslationRtc, mvRtc); } return uniformState.modelView; }; }, MODELVIEWPROJECTION : function(uniformState, model) { return function() { return uniformState.modelViewProjection; }; }, MODELINVERSE : function(uniformState, model) { return function() { return uniformState.inverseModel; }; }, VIEWINVERSE : function(uniformState, model) { return function() { return uniformState.inverseView; }; }, PROJECTIONINVERSE : function(uniformState, model) { return function() { return uniformState.inverseProjection; }; }, MODELVIEWINVERSE : function(uniformState, model) { return function() { return uniformState.inverseModelView; }; }, MODELVIEWPROJECTIONINVERSE : function(uniformState, model) { return function() { return uniformState.inverseModelViewProjection; }; }, MODELINVERSETRANSPOSE : function(uniformState, model) { return function() { return uniformState.inverseTransposeModel; }; }, MODELVIEWINVERSETRANSPOSE : function(uniformState, model) { return function() { return uniformState.normal; }; }, VIEWPORT : function(uniformState, model) { return function() { return uniformState.viewportCartesian4; }; } // JOINTMATRIX created in createCommand() }; ModelUtility.getGltfSemanticUniforms = function() { return gltfSemanticUniforms; }; return ModelUtility; });
import * as actionTypes from './types'; import fetch from './fetch'; export const serverRecordStart = () => { return { type: actionTypes.SERVER_RECORD_START }; }; export const serverRecordSuccess = (data) => { return { type: actionTypes.SERVER_RECORD_SUCCESS, servers: data.servers }; }; export const serverRecordError = (error) => { return { type: actionTypes.SERVER_RECORD_ERROR, error: error }; }; export const fetchServers = () => { return dispatch => { dispatch(serverRecordStart()); fetch.get('servers') .then(response => { dispatch(serverRecordSuccess(response.data)); }) .catch(error => { dispatch(serverRecordError(error)); }); }; };
/** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * Facebook, Inc. ("Facebook") owns all right, title and interest, including * all intellectual property and other proprietary rights, in and to the React * Native CustomComponents software (the "Software"). Subject to your * compliance with these terms, you are hereby granted a non-exclusive, * worldwide, royalty-free copyright license to (1) use and copy the Software; * and (2) reproduce and distribute the Software as part of your own software * ("Your Software"). Facebook reserves all rights not expressly granted to * you in this license agreement. * * THE SOFTWARE AND DOCUMENTATION, IF ANY, ARE PROVIDED "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES (INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE) ARE DISCLAIMED. * IN NO EVENT SHALL FACEBOOK OR ITS AFFILIATES, OFFICERS, DIRECTORS OR * EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @providesModule NavigationHeader * @flow */ 'use strict'; const NavigationHeaderBackButton = require('./NavigationHeaderBackButton'); const NavigationHeaderStyleInterpolator = require('./NavigationHeaderStyleInterpolator'); const NavigationHeaderTitle = require('./NavigationHeaderTitle'); const NavigationPropTypes = require('../NavigationPropTypes'); import React, { Component } from 'react'; // const TVEventHandler = require('TVEventHandler'); import { Animated, Platform, StyleSheet, View, TVEventHandler } from 'react-native'; import type { NavigationSceneRendererProps, NavigationStyleInterpolator, } from 'NavigationTypeDefinition'; type SubViewProps = NavigationSceneRendererProps & { onNavigateBack: ?Function, }; type SubViewRenderer = (subViewProps: SubViewProps) => ?React.Element<any>; type DefaultProps = { renderLeftComponent: SubViewRenderer, renderRightComponent: SubViewRenderer, renderTitleComponent: SubViewRenderer, statusBarHeight: number | Animated.Value, }; type Props = NavigationSceneRendererProps & { onNavigateBack: ?Function, renderLeftComponent: SubViewRenderer, renderRightComponent: SubViewRenderer, renderTitleComponent: SubViewRenderer, style?: any, viewProps?: any, statusBarHeight: number | Animated.Value, }; type SubViewName = 'left' | 'title' | 'right'; const APPBAR_HEIGHT = Platform.OS === 'ios' ? 44 : 56; const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 20 : 0; const PropTypes = require('prop-types');; class NavigationHeader extends React.PureComponent<DefaultProps, Props, any> { props: Props; static defaultProps = { renderTitleComponent: (props: SubViewProps) => { const title = String(props.scene.route.title || ''); return <NavigationHeaderTitle>{title}</NavigationHeaderTitle>; }, renderLeftComponent: (props: SubViewProps) => { if (props.scene.index === 0 || !props.onNavigateBack) { return null; } return <NavigationHeaderBackButton onPress={props.onNavigateBack} />; }, renderRightComponent: (props: SubViewProps) => { return null; }, statusBarHeight: STATUSBAR_HEIGHT, }; static propTypes = { ...NavigationPropTypes.SceneRendererProps, onNavigateBack: PropTypes.func, renderLeftComponent: PropTypes.func, renderRightComponent: PropTypes.func, renderTitleComponent: PropTypes.func, style: View.propTypes.style, statusBarHeight: PropTypes.number, viewProps: PropTypes.shape(View.propTypes), }; _tvEventHandler: TVEventHandler; componentDidMount(): void { this._tvEventHandler = new TVEventHandler(); this._tvEventHandler.enable(this, function(cmp, evt) { if (evt && evt.eventType === 'menu') { cmp.props.onNavigateBack && cmp.props.onNavigateBack(); } }); } componentWillUnmount(): void { if (this._tvEventHandler) { this._tvEventHandler.disable(); delete this._tvEventHandler; } } render(): React.Element<any> { const { scenes, style, viewProps } = this.props; const scenesProps = scenes.map(scene => { const props = NavigationPropTypes.extractSceneRendererProps(this.props); props.scene = scene; return props; }); const barHeight = this.props.statusBarHeight instanceof Animated.Value ? Animated.add(this.props.statusBarHeight, new Animated.Value(APPBAR_HEIGHT)) : APPBAR_HEIGHT + this.props.statusBarHeight; return ( <Animated.View style={[styles.appbar, { height: barHeight }, style]} {...viewProps}> {scenesProps.map(this._renderLeft, this)} {scenesProps.map(this._renderTitle, this)} {scenesProps.map(this._renderRight, this)} </Animated.View> ); } _renderLeft = (props: NavigationSceneRendererProps): ?React.Element<any> => { return this._renderSubView( props, 'left', this.props.renderLeftComponent, NavigationHeaderStyleInterpolator.forLeft ); }; _renderTitle = (props: NavigationSceneRendererProps): ?React.Element<any> => { return this._renderSubView( props, 'title', this.props.renderTitleComponent, NavigationHeaderStyleInterpolator.forCenter ); }; _renderRight = (props: NavigationSceneRendererProps): ?React.Element<any> => { return this._renderSubView( props, 'right', this.props.renderRightComponent, NavigationHeaderStyleInterpolator.forRight ); }; _renderSubView( props: NavigationSceneRendererProps, name: SubViewName, renderer: SubViewRenderer, styleInterpolator: NavigationStyleInterpolator ): ?React.Element<any> { const { scene, navigationState } = props; const { index, isStale, key } = scene; const offset = navigationState.index - index; if (Math.abs(offset) > 2) { // Scene is far away from the active scene. Hides it to avoid unnecessary // rendering. return null; } const subViewProps = { ...props, onNavigateBack: this.props.onNavigateBack }; const subView = renderer(subViewProps); if (subView === null) { return null; } const pointerEvents = offset !== 0 || isStale ? 'none' : 'box-none'; return ( <Animated.View pointerEvents={pointerEvents} key={name + '_' + key} style={[styles[name], { marginTop: this.props.statusBarHeight }, styleInterpolator(props)]} > {subView} </Animated.View> ); } static HEIGHT = APPBAR_HEIGHT + STATUSBAR_HEIGHT; static Title = NavigationHeaderTitle; static BackButton = NavigationHeaderBackButton; } const styles = StyleSheet.create({ appbar: { alignItems: 'center', backgroundColor: Platform.OS === 'ios' ? '#EFEFF2' : '#FFF', borderBottomColor: 'rgba(0, 0, 0, .15)', borderBottomWidth: Platform.OS === 'ios' ? StyleSheet.hairlineWidth : 0, elevation: 4, flexDirection: 'row', justifyContent: 'flex-start', }, title: { bottom: 0, left: APPBAR_HEIGHT, position: 'absolute', right: APPBAR_HEIGHT, top: 0, }, left: { bottom: 0, left: 0, position: 'absolute', top: 0, }, right: { bottom: 0, position: 'absolute', right: 0, top: 0, }, }); module.exports = NavigationHeader;
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Tour = void 0; const typeorm_1 = require("typeorm"); let Tour = class Tour { }; __decorate([ typeorm_1.PrimaryGeneratedColumn(), __metadata("design:type", String) ], Tour.prototype, "state_number", void 0); __decorate([ typeorm_1.Column(), __metadata("design:type", Number) ], Tour.prototype, "id_card", void 0); __decorate([ typeorm_1.Column(), __metadata("design:type", String) ], Tour.prototype, "rental_period", void 0); __decorate([ typeorm_1.Column(), __metadata("design:type", String) ], Tour.prototype, "provision", void 0); __decorate([ typeorm_1.Column(), __metadata("design:type", String) ], Tour.prototype, "mark", void 0); __decorate([ typeorm_1.Column(), __metadata("design:type", String) ], Tour.prototype, "model", void 0); __decorate([ typeorm_1.Column(), __metadata("design:type", String) ], Tour.prototype, "price_rental", void 0); Tour = __decorate([ typeorm_1.Entity() ], Tour); exports.Tour = Tour; //# sourceMappingURL=tour.entity.js.map
window.onload = function(){ /* Creating an ability to format a String */ if(!String.prototype.format) { var format = function() { var args = arguments; var result = this.replace(/{(\d+)}/g, function(match, number) { return typeof args[number] != 'undefined' ? args[number] : match; }) return result; } String.prototype.format = format; }; var nextPage = function(callback) { if(this.page < this.pages) { this.page += 1; } }; var prevPage = function() { if(this.page > 1) { this.page -= 1; } }; var getPhotos = function() { return this.photos; }; var googleNextPage = function(){ this.page += 1; this.start += 8; }; var googlePrevPage = function(){ if(this.page > 1){ this.page -= 1; this.start -= 8; } }; var getGooglePhotos = function() { return this.photos; }; var loadJSON = function(url, success, error) { var ajax = new XMLHttpRequest(); var processResponse = function(){ if(success && ajax.status == 200 && ajax.readyState == 4){ return success(ajax.responseText); }; if(error || ajax.status == 404 && ajax.readyState == 4) { return error(ajax.responseText); } }; ajax.onreadystatechange = processResponse; ajax.open("GET", url, true); ajax.send(); }; var jsonGoogleApi = function(response){ var response = JSON.parse(response); var data = response.items; if(!data){ console.log('There is no data from Google'); return; } images.google.start = response.queries.request[0].startIndex; images.google.pages = Math.ceil(Number(response.queries.request[0].totalResults)/8); images.google.photos = []; for(var i=0; i < data.length; i++){ var p = data[i]; var photo = {}; photo.url = p.link; // thumbnail width 150 photo.thumbnail = p.image.thumbnailLink; images.google.photos.push(photo); }; }; var jsonFlickrApi = function(response){ if(response.stat != "ok"){ alert('Unable to get photos from Flickr:' + response.message); return; } var data = response.photos; images.flickr.pages = Math.ceil(Number(data.total)/8); images.flickr.photos = []; for(var i=0; i < data.photo.length; i++){ var p = data.photo[i]; var photo = {}; photo.url = "https://farm{0}.staticflickr.com/{1}/{2}_{3}.jpg".format(p.farm, p.server, p.id, p.secret); // t for thumbnail, 100 on longest side photo.thumbnail = "https://farm{0}.staticflickr.com/{1}/{2}_{3}_{4}.jpg".format(p.farm, p.server, p.id, p.secret, "q"); images.flickr.photos.push(photo); }; }; var jsonUrlApi = function(response){ var data = JSON.parse(response); if(data.status != "ok"){ alert('Unable to get photos from your url'); return; } data = data.urls; for(var i=0; i<data.length; i++){ data[i].thumbnail = data[i].url; }; images.url.pages = Math.ceil(data.length / 8); images.url.photos = data; } var constructUrl = function(type){ if(type == 'flickr'){ return "https://api.flickr.com/services/rest/?" + "method=flickr.photos.search" + "&api_key=" + FLICKR_API_KEY + "&format=json" + "&license=1,2,3,4,5,6,7" + "&sort=relevance" + "&media=photos" + "&per_page=8" + "&page=" + images.flickr.page + "&text=" + images.query; }; if(type == 'google'){ return "https://www.googleapis.com/customsearch/v1?" + "key=" + GOOGLE_API_KEY + "&cx=" + GOOGLE_SENGINE_ID + "&searchType=image" + "&imgType=photos" + "&num=8" + "&start=" + images.google.start + "&safe=high" + "&rights=cc_publicdomain,cc_attribute,cc_sharealike,cc_noncommercial,cc_nonderived" + "&q=" + images.query; }; if(type == 'url'){ return MEDIA_FIELD_API + "?url=" + encodeURIComponent(images.url.query); } }; var querySearch = function(type, callback) { var url = constructUrl(type); loadJSON(url, function(data){ if(callback){ callback(data); } }); }; var images = { query: '', flickr: { page: 1, pages: 0, nextPage: nextPage, prevPage: prevPage, getPhotos: getPhotos, photos: [], sync: function(callback){ querySearch('flickr',function(data){ eval(data); if(callback){ callback(data); } }); } }, google: { page: 1, start: 1, pages: 0, nextPage: googleNextPage, prevPage: googlePrevPage, getPhotos: getGooglePhotos, photos: [], sync: function(callback){ querySearch('google',function(data){ jsonGoogleApi(data); if(callback){ callback(data); } }); } }, url: { query: '', page: 1, pages: 0, photos: [], nextPage: function(){ if(this.pages > this.page){ this.page += 1; } }, prevPage: function(){ if(this.page > 1){ this.page -= 1; } }, getPhotos: function(){ var start = (this.page - 1) * 8; var end = (this.page * 8) < this.photos.length ? (this.page * 8) : this.photos.length; return this.photos.slice(start, end); }, sync: function(callback){ querySearch('url', function(data) { jsonUrlApi(data); if(callback){ callback(data); } }); } } }; var view = {}; view.search = {}; view.url = {}; view.image = document.getElementById('media_widget_image'); view.image_hidden = document.getElementById('media_widget_image_hidden'); view.search.button = document.getElementById('searchButton'); view.search.input = document.getElementById('searchInput'); view.url.button = document.getElementById('urlButton'); view.url.input = document.getElementById('urlInput'); view.search.wrapper = document.getElementById('flickr_google_wrapper'); view.url.wrapper = document.getElementById('url_wrapper'); view.search.button.onclick = function(e) { e.preventDefault(); var query = view.search.input.value; images.query = query; images.flickr.page = 1; images.google.page = 1; images.flickr.sync(function(data){ view.search.drawWrapper(); view.drawThumbnails(images.flickr.getPhotos(), view.search.ul); view.search.page.innerHTML = images.flickr.page + " of " + images.flickr.pages; }); images.google.sync(); }; view.url.button.onclick = function(e) { e.preventDefault(); images.url.query = view.url.input.value; images.url.page = 1; images.url.sync(function(data){ view.url.drawWrapper(); view.drawThumbnails(images.url.getPhotos(), view.url.ul); view.url.page.innerHTML = images.url.page + " of " + images.url.pages; }); }; view.search.drawWrapper = function() { view.search.wrapper.innerHTML = '<div class="media_widget_row" style="text-align:center;">' + '<input type="radio" name="search" value="flickr" id="flickr" checked>Flickr ' + '<input type="radio" name="search" value="google" id="google">Google' + '</div>' + '<ul id="flickr_google" class="media_widget_thumbnails" style="margin-left:0px;margin-bottom:0px;padding-left:0px;">' + '</ul>' + '<div class="media_widget_row" style="text-align:center;">' + '<a id="flickr_google_prev" href="#">&lt;prev</a>' + ' page <span id="flickr_google_page"></span> ' + '<a id="flickr_google_next" href="#">next&gt;</a>' + '</div>'; view.search.ul = document.getElementById('flickr_google'); view.search.next = document.getElementById('flickr_google_next'); view.search.prev = document.getElementById('flickr_google_prev'); view.search.page = document.getElementById('flickr_google_page'); view.search.flickr = document.getElementById('flickr'); view.search.google = document.getElementById('google'); view.search.next.onclick = function(e) { e.preventDefault(); if(view.search.flickr.checked){ images.flickr.nextPage(); images.flickr.sync(function(data){ view.drawThumbnails(images.flickr.getPhotos(), view.search.ul); view.search.page.innerHTML = images.flickr.page + " of " + images.flickr.pages; }); } else{ images.google.nextPage(); images.google.sync(function(data){ view.drawThumbnails(images.google.getPhotos(), view.search.ul); view.search.page.innerHTML = images.google.page + " of " + images.google.pages; }); }; }; view.search.prev.onclick = function(e) { e.preventDefault(); var photos = []; if(view.search.flickr.checked){ images.flickr.prevPage(); images.flickr.sync(function(data){ view.drawThumbnails(images.flickr.getPhotos(), view.search.ul); view.search.page.innerHTML = images.flickr.page + " of " + images.flickr.pages; }); } else{ images.google.prevPage(); images.google.sync(function(data){ view.drawThumbnails(images.google.getPhotos(), view.search.ul); view.search.page.innerHTML = images.google.page + " of " + images.google.pages; }); }; }; view.search.flickr.onclick = function(){ var photos = images.flickr.getPhotos(); view.search.page.innerHTML = images.flickr.page + " of " + images.flickr.pages; view.drawThumbnails(photos, view.search.ul); }; view.search.google.onclick = function(){ var photos = images.google.getPhotos(); view.search.page.innerHTML = images.google.page + " of " + images.google.pages; view.drawThumbnails(photos, view.search.ul); }; }; view.url.drawWrapper = function() { view.url.wrapper.innerHTML = '<ul id="url" class="media_widget_thumbnails" style="margin-left:0px;margin-bottom:0px;padding-left:0px;">' + '</ul>' + '<div class="media_widget_row" style="text-align:center;">' + '<a id="url_prev" href="#">&lt;prev</a>' + ' page <span id="url_page">1</span> ' + '<a id="url_next" href="#">next&gt;</a>' + '</div>'; view.url.ul = document.getElementById('url'); view.url.next = document.getElementById('url_next'); view.url.prev = document.getElementById('url_prev'); view.url.page = document.getElementById('url_page'); view.url.next.onclick = function(e) { e.preventDefault(); images.url.nextPage(); var photos = images.url.getPhotos(); view.drawThumbnails(photos, view.url.ul); view.url.page.innerHTML = images.url.page + " of " + images.url.pages; }; view.url.prev.onclick = function(e) { e.preventDefault(); images.url.prevPage(); var photos = images.url.getPhotos(); view.drawThumbnails(photos, view.url.ul); view.url.page.innerHTML = images.url.page + " of " + images.url.pages; }; }; view.drawThumbnails = function(photos, ul){ var li = ' <li style="list-style-type:none; display:inline;">' + '<a href="#"><img id="thumbnail_{0}" class="media_widget_thumbnail" src="{1}" style="width:150px;"></a>' + '</li>'; var thumbnails = ''; for(var i = 0; i < photos.length; i++){ thumbnails += li.format(i, photos[i].thumbnail); } if(photos.length == 0){ thumbnails = "There is nothing found." } ul.innerHTML = ''; ul.innerHTML = thumbnails; var onThumbnailClick = function(photo){ return function(e){ e.preventDefault(); view.image.src = photo.url; view.image_hidden.value = photo.url; }; }; var thumbnails = ul.getElementsByClassName('media_widget_thumbnail'); for(var i=0; i<thumbnails.length; i++){ thumbnails[i].onclick = onThumbnailClick(photos[i]); } }; };
export default { props: ['categoriesdata', 'isauth'], data() { return { categories: this.categoriesdata, isAuth: this.isauth, paginate: ['categories'] } }, methods: { deleteCategory(category, index){ this.$swal({ text: 'Estas seguro de eliminar esta categoría? Se eliminarà los enlaces de la categoría también!', showDenyButton: true, confirmButtonText: `Eliminar`, denyButtonText: `Me equivocado`, icon: 'warning' }).then((result) => { if (result.isConfirmed) { axios.delete(`/categories/${category.id}`) .then(()=>{ this.paginate.categories.list.splice(index, 1); this.$swal({ text: 'Se ha eliminado la categoría correctamente', icon: 'success' }) }).catch(err => { this.$swal({ text: 'Opps! Ha producido un error en momento de eliminar la categoría', showCloseButton: true, icon: 'error' }); }) } else if (result.isDenied) { this.$swal({ text: 'Se ha cancelado la acción de eliminar la categoría', icon: 'info' }) } }) } } }
const did_you_mean = require("./app/didyoumean"); require("dotenv").config(); const api_key = process.env.API_KEY; const se_id = process.env.SE_ID; let query = process.argv[2]; if(query !== null){ let search = new did_you_mean.did_you_mean(query,api_key,se_id, (body)=>{ try{ console.log(JSON.parse(body).spelling.correctedQuery); }catch(error){ console.log("No spelling correction."); } }).query_google(); }
import variable from "./../variables/platform"; export default (variables = variable) => { const textTheme = { fontSize: variables.DefaultFontSize, fontFamily: variables.fontFamily, color: variables.textColor, ".note": { color: "#a7a7a7", fontSize: variables.noteFontSize } }; return textTheme; };
const influxPage = require(__srcdir + '/pages/influxPage.js'); const { By } = require('selenium-webdriver'); const pageTitle = '[data-testid=\'page-title\']'; const createCheckButton = '[data-testid=create-check]'; const createEndpointButton = '[data-testid=create-endpoint]'; const createRuleButton = '[data-testid=create-rule]'; const checksFilterInput = '[data-testid=\'filter--input checks\']'; const checksQuestionMark = '[data-testid=\'Checks--question-mark\']'; const checksTooltipContents = '[data-testid=\'Checks--question-mark--tooltip--contents\']'; const alertingTab = '[data-testid=alerting-tab--%TABNAME%]'; const createCheckDropdown = '[data-testid=\'checks--column\'] [data-testid=\'dropdown-menu--contents\']'; const createCheckDropdownItem = '[data-testid=\'dropdown-menu--contents\'] [data-testid=create-%ITEM%-check]'; const endpointsFilterInput = '[data-testid=\'filter--input endpoints\']'; const endpointsQuestionMark = '[data-testid=\'Notification Endpoints--question-mark\']'; const endpointsTooltipContents = '[data-testid=\'Notification Endpoints--question-mark--tooltip--contents\']'; const rulesFilterInput = '[data-testid=\'filter--input rules\']'; const rulesQuestionMark = '[data-testid=\'Notification Rules--question-mark\']'; const rulesTooltipContents = '[data-testid=\'Notification Rules--question-mark--tooltip--contents\']'; const firstTimeThresholdCheckCreateButton = '[data-testid=\'checks--column\'] [data-testid=panel--body] [data-testid=button][title=\'Threshold Check\']'; const firstTimeDeadmanCheckCreateButton = '[data-testid=\'checks--column\'] [data-testid=panel--body] [data-testid=button][title=\'Deadman Check\']'; const emptyStateColumnText = '[data-testid=\'%COL%--column\'] [data-testid=\'empty-state--text\']'; //Resource card const checkCardName = '//*[@data-testid=\'check-card--name\'][./*[text()=\'%NAME%\']]'; const checkCardNameEditButton = '//*[./*/*[text()=\'%NAME%\']]//*[@data-testid=\'check-card--name-button\']'; const checkCardNameInput = '[data-testid=check-card--input]'; const checkCardDescription = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'resource-list--editable-description\']'; const checkCardDescriptionEditButton = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'resource-list--editable-description\']//*[@data-testid=\'icon\']'; const checkCardDescriptionInput = '[data-testid=check-card] [data-testid=input-field]'; const checkCardAddLabelButton = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'inline-labels--add\']'; const checkCardLabelEmpty = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'inline-labels--empty\']'; const checkCardLabelPill = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'label--pill %LABEL%\']'; const checkCardLabelRemove = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'label--pill--delete %LABEL%\']'; const checkCardCloneButton = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'context-menu\'][./*[contains(@class,\'duplicate\')]]'; const checkCardCloneConfirm = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'context-menu-item\'][text()=\'Clone\']'; const checkCardOpenHistory = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'context-history-menu\'][./*[contains(@class,\'eye-open\')]]'; const checkCardOpenHistoryConfirm = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'context-history-task\']'; const checkCardDeleteButton = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'context-delete-menu\']'; const checkCardDeleteConfirm = '//*[@data-testid=\'check-card\'][.//*[text()=\'%NAME%\']]//*[@data-testid=\'context-delete-task\']' //Create Endpoint Popup const epPopupEndpointDropdownButton = '[data-testid=endpoint--dropdown--button]'; const epPopupEndpointNameInput = '[data-testid=endpoint-name--input]'; const epPopupEndpointDescriptionText = '[data-testid=endpoint-description--textarea]'; const epPopupCancelButton = '[data-testid=endpoint-cancel--button]'; const epPopupSaveButton = '[data-testid=endpoint-save--button]'; //Query Builder const qbSelectorListItem = '[data-testid=\'selector-list %ITEM%\']'; const urlCtx = 'alerting'; class alertsPage extends influxPage { constructor(driver){ super(driver); } async isLoaded(){ await super.isLoaded([{type: 'css', selector: pageTitle}, {type: 'css', selector: createCheckButton}, {type: 'css', selector: createEndpointButton}, {type: 'css', selector: createRuleButton}, {type: 'css', selector: checksFilterInput}, {type: 'css', selector: endpointsFilterInput}, {type: 'css', selector: rulesFilterInput}, ], urlCtx); } async getPageTitle(){ return await this.driver.findElement(By.css(pageTitle)); } async getAlertingTab(tabName){ return await this.driver.findElement(By.css(alertingTab.replace('%TABNAME%', tabName))); } async getCreateCheckButton(){ return await this.driver.findElement(By.css(createCheckButton)); } async getCreateEndpointButton(){ return await this.driver.findElement(By.css(createEndpointButton)); } async getCreateRuleButton(){ return await this.driver.findElement(By.css(createRuleButton)); } async getChecksQuestionMark(){ return await this.driver.findElement(By.css(checksQuestionMark)); } async getChecksFilterInput(){ return await this.driver.findElement(By.css(checksFilterInput)); } async getChecksTooltipContents(){ return await this.driver.findElement(By.css(checksTooltipContents)); } static getChecksTooltipContentsSelector(){ return { type: 'css', selector: checksTooltipContents }; } async getEndpointsQuestionMark(){ return await this.driver.findElement(By.css(endpointsQuestionMark)); } async getEndpointsFilterInput(){ return await this.driver.findElement(By.css(endpointsFilterInput)); } async getEndpointsTooltipContents(){ return await this.driver.findElement(By.css(endpointsTooltipContents)); } static getEndpointsTooltipContentsSelector(){ return { type: 'css', selector: endpointsTooltipContents }; } async getRulesFilterInput(){ return await this.driver.findElement(By.css(rulesFilterInput)); } async getRulesQuestionMark(){ return await this.driver.findElement(By.css(rulesQuestionMark)); } async getRulesTooltipContents(){ return await this.driver.findElement(By.css(rulesTooltipContents)); } static getRulesTooltipContentsSelector(){ return { type: 'css', selector: rulesTooltipContents }; } async getFirstTimeThresholdCheckCreateButton(){ return await this.driver.findElement(By.css(firstTimeThresholdCheckCreateButton)); } async getFirstTimeDeadmanCheckCreateButton(){ return await this.driver.findElement(By.css(firstTimeDeadmanCheckCreateButton)); } async getCreateCheckDropdownItem(item){ return await this.driver.findElement(By.css(createCheckDropdownItem.replace('%ITEM%', item.toLowerCase()))); } static getCreateCheckDropdownSelector(){ return { type: 'css', selector: createCheckDropdown } } async getEpPopupEndpointDropdownButton(){ return await this.driver.findElement(By.css(epPopupEndpointDropdownButton)); } async getEpPopupEndpointNameInput(){ return await this.driver.findElement(By.css(epPopupEndpointNameInput)); } async getEpPopupEndpointDescriptionText(){ return await this.driver.findElement(By.css(epPopupEndpointDescriptionText)); } async getEpPopupCancelButton(){ return await this.driver.findElement(By.css(epPopupCancelButton)); } async getEpPopupSaveButton(){ return await this.driver.findElement(By.css(epPopupSaveButton)); } async getQbSelectorListItem(item){ return await this.driver.findElement(By.css(qbSelectorListItem.replace('%ITEM%', item))) } async getCheckCardName(name){ return await this.driver.findElement(By.xpath(checkCardName.replace('%NAME%', name))); } static getCheckCardNameSelector(name){ return {type: 'xpath', selector: checkCardName.replace('%NAME%', name)} } async getCheckCardNameEditButton(name){ return await this.driver.findElement(By.xpath(checkCardNameEditButton.replace('%NAME%', name))); } async getCheckCardNameInput(){ return await this.driver.findElement(By.css(checkCardNameInput)); } async getCheckCardDescription(name){ return await this.driver.findElement(By.xpath(checkCardDescription.replace('%NAME%', name))); } async getCheckCardDescriptionEditButton(name){ return await this.driver.findElement(By.xpath(checkCardDescriptionEditButton.replace('%NAME%', name))); } async getCheckCardDescriptionInput(){ return await this.driver.findElement(By.css(checkCardDescriptionInput)); } async getCheckCardAddLabelButton(name){ return await this.driver.findElement(By.xpath(checkCardAddLabelButton.replace('%NAME%', name))); } async getCheckCardLabelEmpty(name){ return await this.driver.findElement(By.xpath(checkCardLabelEmpty.replace('%NAME%', name))); } async getCheckCardLabelPill(name, label){ return await this.driver.findElement(By.xpath(checkCardLabelPill .replace('%NAME%', name) .replace('%LABEL%', label))); } static getCheckCardLabelPillSelector(name, label){ return { type: 'xpath', selector: checkCardLabelPill .replace('%NAME%', name) .replace('%LABEL%', label)} } async getCheckCardLabelRemove(name, label){ return await this.driver.findElement(By.xpath(checkCardLabelRemove .replace('%NAME%', name) .replace('%LABEL%', label))); } async getCheckCardCloneButton(name){ return await this.driver.findElement(By.xpath(checkCardCloneButton.replace('%NAME%', name))) } async getCheckCardCloneConfirm(name){ return await this.driver.findElement(By.xpath(checkCardCloneConfirm.replace('%NAME%', name))) } async getEmptyStateColumnText(col){ return await this.driver.findElement(By.css(emptyStateColumnText.replace('%COL%', col))); } async getCheckCardOpenHistory(name){ return await this.driver.findElement(By.xpath(checkCardOpenHistory.replace('%NAME%', name))) } async getCheckCardOpenHistoryConfirm(name){ return await this.driver.findElement(By.xpath(checkCardOpenHistoryConfirm.replace('%NAME%', name))); } async getCheckCardDeleteButton(name){ return await this.driver.findElement(By.xpath(checkCardDeleteButton.replace('%NAME%', name))); } async getCheckCardDeleteConfirm(name){ return await this.driver.findElement(By.xpath(checkCardDeleteConfirm.replace('%NAME%', name))); } } module.exports = alertsPage;
//@flow import React from 'react' import Select from 'part:@sanity/components/selects/default' import RadioSelect from 'part:@sanity/components/selects/radio' import PatchEvent, {set} from '../PatchEvent' import FormField from 'part:@sanity/components/formfields/default' import type {Type, Marker} from '../typedefs' import {uniqueId} from 'lodash' const EMPTY_ITEM = {title: '', value: undefined} function toSelectItems(list) { return typeof list[0] === 'string' ? list.map(item => ({title: item, value: item})) : list } type Props = { type: Type, level: number, value: ?string, readOnly: ?boolean, onChange: PatchEvent => void, markers: Array<Marker> } export default class StringSelect extends React.Component<Props> { _input: ?(RadioSelect | Select) name = uniqueId('RadioName') static defaultProps = { value: '' } handleChange = (item: Object) => { const {onChange} = this.props onChange(PatchEvent.from(set(typeof item === 'string' ? item : item.value))) } focus() { if (this._input) { this._input.focus() } } setInput = (input: ?(RadioSelect | Select)) => { this._input = input } render() { const {value, readOnly, markers, type, level, ...rest} = this.props const items = toSelectItems(type.options.list || []) const currentItem = items.find(item => item.value === value) const isRadio = type.options && type.options.layout === 'radio' return ( <FormField markers={markers} level={level} label={type.title} description={type.description}> {isRadio ? ( // todo: make separate inputs <RadioSelect {...rest} name={this.name} legend={type.title} items={items} onChange={this.handleChange} value={currentItem} direction={type.options.direction || 'vertical'} ref={this.setInput} readOnly={readOnly} /> ) : ( <Select {...rest} label={type.title} value={currentItem} placeholder={type.placeholder} onChange={this.handleChange} items={[EMPTY_ITEM].concat(items)} ref={this.setInput} readOnly={readOnly} /> )} </FormField> ) } }
import axios from 'axios'; const axiosInstance = axios.create({ baseURL: 'https://vc-api.dmitrysviridov.com/api/v1/', }); const villageAPI = { async getOffersByVillagerId(villagerId, token) { return axiosInstance.get('offers/allowedOffers', { params: { page: -1, size: -1, villagerId, }, headers: { Authorization: 'Bearer ' + token, }, }); }, async makeNewDeal(offerId, token) { return axiosInstance.post( 'deals', { offerId, }, { headers: { Authorization: 'Bearer ' + token, }, } ); }, async getVillagerInfo(villagerId, token) { return axiosInstance.get(`villagers/villagerWithExtraData/${villagerId}`, { headers: { Authorization: 'Bearer ' + token, }, }); }, }; export default villageAPI;
module.exports = { testEnvironment: "jsdom", clearMocks: true, transform: { '^.+\\.js$': 'babel-jest', }, coveragePathIgnorePatterns: [ 'node_modules', 'test-components', 'test-utils' ], }
import { shallow } from 'enzyme'; import React from 'react'; import NotFoundPage from '../../components/NotFoundPage'; test('should render NotFoundPage correctly', () => { const wrapper = shallow(<NotFoundPage/>); expect(wrapper).toMatchSnapshot(); });
import { isDefined } from '../../core/utils/type'; import tagHelper from './excel.tag_helper'; import patternFillHelper from './excel.pattern_fill_helper'; const fillHelper = { tryCreateTag: function(sourceObj) { let result = null; if(isDefined(sourceObj)) { result = { patternFill: patternFillHelper.tryCreateTag(sourceObj.patternFill) }; if(fillHelper.isEmpty(result)) { result = null; } } return result; }, tryCreateFillFromSimpleFormat: function({ backgroundColor, fillPatternType, fillPatternColor } = {}) { if(isDefined(backgroundColor) && !(isDefined(fillPatternType) && isDefined(fillPatternColor))) { return { patternFill: { patternType: 'solid', foregroundColor: { rgb: backgroundColor } } }; } else if(isDefined(fillPatternType) && isDefined(fillPatternColor)) { return { patternFill: { patternType: fillPatternType, foregroundColor: { rgb: fillPatternColor }, backgroundColor: { rgb: backgroundColor }, } }; } }, copySimpleFormat: function(source, target) { if(source.backgroundColor !== undefined) { target.backgroundColor = source.backgroundColor; } if(source.fillPatternType !== undefined) { target.fillPatternType = source.fillPatternType; } if(source.fillPatternColor !== undefined) { target.fillPatternColor = source.fillPatternColor; } }, copy: function(source) { let result = null; if(isDefined(source)) { result = {}; if(source.patternFill !== undefined) { result.patternFill = patternFillHelper.copy(source.patternFill); } } return result; }, areEqual: function(leftTag, rightTag) { return fillHelper.isEmpty(leftTag) && fillHelper.isEmpty(rightTag) || ( isDefined(leftTag) && isDefined(rightTag) && patternFillHelper.areEqual(leftTag.patternFill, rightTag.patternFill) ); }, isEmpty: function(tag) { return !isDefined(tag) || patternFillHelper.isEmpty(tag.patternFill); }, toXml: function(tag) { // §18.8.20 fill (Fill), 'ECMA-376 5th edition Part 1' (http://www.ecma-international.org/publications/standards/Ecma-376.htm) return tagHelper.toXml( 'fill', {}, patternFillHelper.toXml(tag.patternFill) ); } }; export default fillHelper;
/* Copyright (c)2006-2017 Nicholas K. Dionysopoulos @license GNU General Public License version 3, or later */ if("undefined"==typeof Solo)var Solo={};"undefined"==typeof Solo.Backup&&(Solo.Backup={URLs:{},tag:"",backupid:null,currentDomain:null,domains:{},commentEditorSave:null,maxExecutionTime:14,runtimeBias:75,srpInfo:{},returnUrl:"",config_angiekey:"",defaultDescription:"",currentDescription:"",currentComment:"",jpsKey:"",timeoutTimer:null,resumeTimer:null,translations:{},resume:{enabled:!0,timeout:10,maxRetries:3,retry:0}}); Solo.Backup.timer=function(a){0>=a&&(a=10);setTimeout("Solo.Backup.timerTick()",a)};Solo.Backup.timerTick=function(){try{console.log("Timer tick")}catch(a){}Solo.Backup.resetTimeoutBar();Solo.Backup.startTimeoutBar(Solo.Backup.maxExecutionTime,Solo.Backup.runtimeBias);Solo.System.doAjax({ajax:"step",tag:Solo.Backup.tag,backupid:Solo.Backup.backupid},Solo.Backup.onStep,Solo.Backup.onError,!1)}; Solo.Backup.startTimeoutBar=function(a,b){var c=0;Solo.Backup.timeoutTimer=setInterval(function(){c++;var a=document.querySelector("#response-timer div.text");a&&(a.textContent=Solo.Backup.translations["UI-LASTRESPONSE"].replace("%s",c.toFixed(0)))},1E3)}; Solo.Backup.resetTimeoutBar=function(){Piecon.setOptions({color:"#333333",background:"#e0e0e0",shadow:"#000000",fallback:"force"});try{clearInterval(Solo.Backup.timeoutTimer)}catch(b){}var a=document.querySelector("#response-timer div.text");a&&(a.textContent=Solo.Backup.translations["UI-LASTRESPONSE"].replace("%s","0"))}; Solo.Backup.startRetryTimeoutBar=function(){var a=Solo.Backup.resume.timeout;Solo.Backup.resumeTimer=setInterval(function(){a--;document.getElementById("akeeba-retry-timeout").textContent=a.toFixed(0);0==a&&(clearInterval(Solo.Backup.resumeTimer),Solo.Backup.resumeBackup())},1E3)};Solo.Backup.resetRetryTimeoutBar=function(){clearInterval(Solo.Backup.resumeTimer);document.getElementById("akeeba-retry-timeout").textContent=Solo.Backup.resume.timeout.toFixed(0)}; Solo.Backup.renderBackupSteps=function(a){var b="label-success";""==a&&(b="label-default");document.getElementById("backup-steps").innerHTML="";for(var c=0;c<Solo.Backup.domains.length;c++){element=Solo.Backup.domains[c];var d=document.createElement("div");d.className="label ";d.innerHTML=element[1];Solo.System.data.set("domain",element[0]);document.getElementById("backup-steps").appendChild(d);element[0]==a?(b="label-default",this_class="label-info"):this_class=b;d.className+=" "+this_class}}; Solo.Backup.start=function(){try{console.log("Starting backup"),console.log(data)}catch(c){}if(window.AVGRUN){try{console.warn("AVG Antivirus with Link Checker detected. The backup WILL fail!")}catch(c){}if(!confirm(Solo.Backup.translations.SOLO_BACKUP_AVGWARNING))return}try{null!=Solo.Backup.commentEditorSave&&Solo.Backup.commentEditorSave()}catch(c){document.getElementById("comment").value=""}var a="";try{a=document.getElementById("jpskey").value()}catch(c){a=""}var b="";try{b=document.getElementById("angiekey").value()}catch(c){b= ""}document.getElementById("backup-setup").style.display="none";document.getElementById("backup-progress-pane").style.display="block";b&&""==Solo.Backup.config_angiekey&&(document.getElementById("angie-password-warning").style.display="block");Solo.System.notification.notify(Solo.Backup.translations["UI-BACKUPSTARTED"]+" "+(new Date).toLocaleString());Solo.Backup.renderBackupSteps("");Solo.Backup.startTimeoutBar(Solo.Backup.maxExecutionTime,Solo.Backup.runtimeBias);Solo.Backup.tag=Solo.Backup.srpInfo.tag; a={ajax:"start",description:document.getElementById("backup-description").value,comment:document.getElementById("comment").value,jpskey:a,angiekey:b};a=array_merge(a,Solo.Backup.srpInfo);Solo.System.doAjax(a,Solo.Backup.onStep,Solo.Backup.onError,!1)}; Solo.Backup.onStep=function(a){try{console.log("Running backup step"),console.log(a)}catch(d){}Solo.Backup.renderBackupSteps(a.Domain);Solo.Backup.currentDomain=a.Domain;document.querySelector("#backup-percentage div.bar").style.width=a.Progress+"%";100<=a.Progress?Piecon.setProgress(99):Piecon.setProgress(a.Progress);document.getElementById("backup-step").textContent=a.Step;document.getElementById("backup-substep").textContent=a.Substep;if(0<a.Warnings.length){-1==document.getElementById("backup-percentage").className.indexOf("progress-warning")&& (document.getElementById("backup-percentage").className+=" progress-warning");for(var b=0;b<a.Warnings.length;b++){warning=a.Warnings[b];Solo.System.notification.notify(Solo.Backup.translations["UI-BACKUPWARNING"],warning);var c=document.createElement("div");c.textContent=warning;document.getElementById("warnings-list").appendChild(c)}document.getElementById("backup-warnings-panel").style.display="block"}b=a.Error;if(""!=b){try{console.error("Got an error message"),console.log(b)}catch(d){}Solo.Backup.onError(b)}else if(1== a.HasRun){try{console.log("Backup complete"),console.log(b)}catch(d){}Solo.Backup.onDone()}else{empty(Solo.Backup.tag)&&(Solo.Backup.tag="backend");Solo.Backup.backupid=a.backupid;Solo.Backup.resume.retry=0;b=10;a.hasOwnProperty("sleepTime")&&(b=a.sleepTime);try{console.log("Starting tick timer with waitTime = "+b+" msec")}catch(d){}Solo.Backup.timer(b)}}; Solo.Backup.resumeBackup=function(){Solo.Backup.resetRetryTimeoutBar();document.getElementById("error-panel").style.display="none";document.getElementById("retry-panel").style.display="none";document.getElementById("backup-progress-pane").style.display="block";document.getElementById("warnings-list").innerHTML&&(document.getElementById("backup-warnings-panel").style.display="block");Solo.System.notification.notify(Solo.Backup.translations["UI-BACKUPRESUME"]+" "+(new Date).toLocaleString());Solo.Backup.timer()}; Solo.Backup.cancelResume=function(){Solo.Backup.resetRetryTimeoutBar();var a=document.getElementById("backup-error-message-retry").innerHTML;Solo.Backup.endWithError(a)}; Solo.Backup.onError=function(a){Solo.Backup.resume.enabled||Solo.Backup.endWithError(a);if(Solo.Backup.resume.retry>=Solo.Backup.resume.maxRetries)Solo.Backup.endWithError(a);else{Solo.Backup.resume.retry++;Solo.Backup.resetRetryTimeoutBar();var b=Solo.Backup.translations["UI-BACKUPHALT_DESC"].replace("%d",Solo.Backup.resume.timeout.toFixed(0));Solo.System.notification.notify(Solo.Backup.translations["UI-BACKUPHALT"],b);document.getElementById("backup-progress-pane").style.display="none";document.getElementById("backup-warnings-panel").style.display= "none";document.getElementById("error-panel").style.display="none";document.getElementById("backup-error-message-retry").textContent=a;document.getElementById("retry-panel").style.display="block";Solo.Backup.startRetryTimeoutBar()}}; Solo.Backup.endWithError=function(a){Solo.Backup.resetTimeoutBar();try{Piecon.reset()}catch(e){}var b=!1;document.getElementById("backup-progress-pane").style.display="none";document.getElementById("backup-warnings-panel").style.display="none";document.getElementById("retry-panel").style.display="none";var c=Solo.Backup.URLs.LogURL+"&tag="+Solo.Backup.tag,d=Solo.Backup.URLs.AliceURL+"&log="+Solo.Backup.tag;Solo.Backup.backupid&&(c=c+"."+encodeURIComponent(Solo.Backup.backupid),d=d+"."+encodeURIComponent(Solo.Backup.backupid)); "finale"==Solo.Backup.currentDomain&&(b=!0,d+="&autorun=1");document.getElementById("ab-viewlog-error").setAttribute("href",c);document.getElementById("ab-alice-error").setAttribute("href",d);Solo.System.notification.notify(Solo.Backup.translations["UI-BACKUPFAILED"],a);Solo.System.doAjax({ajax:"pushFail",tag:Solo.Backup.tag,backupid:Solo.Backup.backupid,errorMessage:a},function(a){});document.getElementById("backup-error-message").textContent=a;document.getElementById("error-panel").style.display= "block";b&&setTimeout(function(){window.location=d},500)}; Solo.Backup.onDone=function(){Solo.System.notification.notify(Solo.Backup.translations["UI-BACKUPFINISHED"]+" "+(new Date).toLocaleString());Solo.Backup.resetTimeoutBar();try{Piecon.reset()}catch(b){}document.getElementById("backup-progress-pane").style.display="none";document.getElementById("backup-complete").style.display="block";document.getElementById("backup-warnings-panel").style.width="100%";var a=Solo.Backup.URLs.LogURL+"&tag="+Solo.Backup.tag;Solo.Backup.backupid&&(a=a+"."+encodeURIComponent(Solo.Backup.backupid)); try{document.getElementById("ab-viewlog-success").setAttribute("href",a)}catch(b){}""!=Solo.Backup.returnUrl&&(window.location=Solo.Backup.returnUrl)}; Solo.Backup.restoreDefaultOptions=function(){document.getElementById("backup-description").value=Solo.Backup.defaultDescription;var a=document.getElementById("angiekey");a&&(a.value="ChromeIsDumb",a.value=Solo.Backup.config_angiekey);if(a=document.getElementById("jpskey"))a.value="ChromeIsDumb",a.value=Solo.Backup.jpsKey;document.getElementById("comment").value="ChromeIsDumb";document.getElementById("comment").value=""}; Solo.Backup.restoreCurrentOptions=function(){document.getElementById("backup-description").value=Solo.Backup.currentDescription;var a=document.getElementById("angiekey");a&&(a.value="ChromeIsDumb",a.value=Solo.Backup.config_angiekey);if(a=document.getElementById("jpskey"))a.value="ChromeIsDumb",a.value=Solo.Backup.jpsKey;document.getElementById("comment").value="ChromeIsDumb";document.getElementById("comment").value=Solo.Backup.currentComment}; Solo.Backup.flipProfile=function(){document.getElementById("flipDescription").value=document.getElementById("backup-description").value;document.getElementById("flipComment").value=document.getElementById("comment").value;document.forms.flipForm.submit()}; //# sourceMappingURL=backup.min.map
define(["exports", "../../../lit/index.js", "../../simple-toolbar/lib/simple-button-grid.js", "./hax-ui-styles.js", "./hax-store.js"], function (_exports, _index, _simpleButtonGrid, _haxUiStyles, _haxStore) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.HaxPicker = void 0; var _templateObject_f1776270feb911eb8439e3eec9305af7, _templateObject2_f1776270feb911eb8439e3eec9305af7, _templateObject3_f1776270feb911eb8439e3eec9305af7, _templateObject4_f1776270feb911eb8439e3eec9305af7; function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = babelHelpers.getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = babelHelpers.getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return babelHelpers.possibleConstructorReturn(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** `hax-picker` A picker for selecting an item from a list of apps / hax gizmos which require a decision to be made. This is used when multiple things match either on upload in the add operation of the app or in the gizmo selection to render through, such as having multiple ways of presenting an image. * @demo demo/index.html @microcopy - the mental model for this element - data - this is the app data model for an element which expresses itself to hax */ var HaxPicker = /*#__PURE__*/function (_LitElement) { babelHelpers.inherits(HaxPicker, _LitElement); var _super = _createSuper(HaxPicker); function HaxPicker() { var _this; babelHelpers.classCallCheck(this, HaxPicker); _this = _super.call(this); _this._elements = []; _this.selectionList = []; _this.pickerType = "gizmo"; return _this; } babelHelpers.createClass(HaxPicker, [{ key: "render", value: function render() { var _this2 = this; return (0, _index.html)(_templateObject_f1776270feb911eb8439e3eec9305af7 || (_templateObject_f1776270feb911eb8439e3eec9305af7 = babelHelpers.taggedTemplateLiteral(["\n ", "\n <simple-button-grid cols=\"100px\">\n ", "\n </simple-button-grid>\n "])), !!this.keywords ? (0, _index.html)(_templateObject2_f1776270feb911eb8439e3eec9305af7 || (_templateObject2_f1776270feb911eb8439e3eec9305af7 = babelHelpers.taggedTemplateLiteral([" <div id=\"filters\">\n <simple-icon-button-lite\n icon=\"editable-table:filter", "\"\n label=\"Toggle Filters\"\n tooltip-position=\"right\"\n @click=\"", "\"\n >\n </simple-icon-button-lite>\n <simple-fields-field\n ?hidden=\"", "\"\n id=\"hax-gizmo-filters\"\n label=\"Filters\"\n type=\"checkbox\"\n .options=\"", "\"\n @value-changed=\"", "\"\n >\n </simple-fields-field>\n </div>"])), !this.filterOn ? "" : "-off", function (e) { return _this2.filterOn = !_this2.filterOn; }, !this.filterOn, this.keywords, this._handleFilters) : "", this.selectionList.map(function (element, index) { return !_this2._isFiltered(element.keywords) ? "" : (0, _index.html)(_templateObject3_f1776270feb911eb8439e3eec9305af7 || (_templateObject3_f1776270feb911eb8439e3eec9305af7 = babelHelpers.taggedTemplateLiteral(["\n <hax-tray-button\n show-text-label\n id=\"picker-item-", "\"\n @click=\"", "\"\n data-selected=\"", "\"\n ?disabled=\"", "\"\n label=\"", "\"\n icon=\"", "\"\n icon-position=\"top\"\n ></hax-tray-button>\n "])), index, _this2._selected, index, _haxStore.HAXStore.activeGizmo && _haxStore.HAXStore.activeGizmo.tag == element.tag, element.title, element.icon); })); } }, { key: "buildOptions", value: /** * Present options to the user with a modal and selection method that * shifts itself to be above everything (stack order) * @param [array] elements a list of elements for presenting to the user * to select between. */ function buildOptions(elements) { var _this3 = this; var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "element"; var title = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "Select an option"; var pickerType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "gizmo"; // wipe existing this.pickerType = pickerType; var tmp = [], addKeywords = function addKeywords(i) { elements[i].gizmo.keywords.forEach(function (keyword) { keyword = (keyword || "").toLowerCase(); var sanitized = keyword.replace(/[\s\W]*/, ""); if (sanitized.length > 0) _this3.keywords[keyword] = keyword; }); }; this.keywords = {}; switch (pickerType) { // hax gizmo selector case "gizmo": for (var i in elements) { elements[i].__type = type; tmp.push({ icon: elements[i].gizmo.icon, title: elements[i].gizmo.title, color: elements[i].gizmo.color, tag: elements[i].gizmo.tag, keywords: elements[i].gizmo.keywords }); addKeywords(i); } break; // app selector case "app": for (var i in elements) { tmp.push({ icon: elements[i].details.icon, title: elements[i].details.title, color: elements[i].details.color, tag: elements[i].gizmo.tag, keywords: elements[i].gizmo.keywords }); addKeywords(i); } break; // we don't know what to do with this default: tmp = elements; break; } this._elements = elements; this.selectionList = babelHelpers.toConsumableArray(tmp); // try to focus on option 0 setTimeout(function () { _this3.shadowRoot.querySelector("#picker-item-0").focus(); }, 50); } }, { key: "_handleFilters", value: function _handleFilters(e) { var filters = this.shadowRoot && this.shadowRoot.querySelector("#hax-gizmo-filters") ? this.shadowRoot.querySelector("#hax-gizmo-filters") : undefined; if (filters) this.filters = filters.value; } }, { key: "_isFiltered", value: function _isFiltered(keywords) { var i = 0, filtered = !this.filterOn || !this.filters || this.filters.length < 1; while (!filtered && i < this.filters.length) { if (keywords.includes(this.filters[i])) filtered = true; i++; } return filtered; } /** * Handle the user selecting an app. */ }, { key: "_selected", value: function _selected(e) { var key = e.target.getAttribute("data-selected"); e.preventDefault(); e.stopPropagation(); if (babelHelpers.typeof(this._elements[key]) !== (typeof undefined === "undefined" ? "undefined" : babelHelpers.typeof(undefined))) { // haxElement is a unique case if (this.pickerType == "gizmo") { this._elements[key].replace = true; this.dispatchEvent(new CustomEvent("hax-insert-content", { bubbles: true, cancelable: true, composed: true, detail: this._elements[key] })); } else { // bubble this up this.dispatchEvent(new CustomEvent("hax-app-picker-selection", { bubbles: true, cancelable: true, composed: true, detail: this._elements[key] })); } } this.close(); } }, { key: "close", value: function close() { window.dispatchEvent(new CustomEvent("simple-modal-hide", { bubbles: true, cancelable: true, detail: {} })); } }], [{ key: "styles", get: function get() { return [].concat(babelHelpers.toConsumableArray(_haxUiStyles.HaxComponentStyles), [(0, _index.css)(_templateObject4_f1776270feb911eb8439e3eec9305af7 || (_templateObject4_f1776270feb911eb8439e3eec9305af7 = babelHelpers.taggedTemplateLiteral(["\n simple-button-grid {\n overflow-y: auto;\n margin: var(--hax-ui-spacing-sm);\n --simple-button-grid-cols: 100px;\n }\n #filters {\n min-height: 24px;\n }\n simple-icon-button-lite {\n float: right;\n margin-left: -24px;\n }\n simple-fields-field::part(fieldset-legend) {\n line-height: 24px;\n }\n simple-fields-field::part(fieldset-options) {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n }\n simple-fields-field::part(option) {\n display: flex;\n flex-wrap: no-wrap;\n align-items: center;\n justify-content: space-between;\n margin: 0 var(--simple-fields-margin-small, 8px);\n flex-direction: row-reverse;\n }\n simple-fields-field::part(option-inner) {\n flex: 0 0 auto;\n margin: 0 calc(var(--simple-fields-margin-small, 8px) * 0.5) 0 0;\n }\n simple-fields-field::part(option-label) {\n flex: 1 1 auto;\n margin: 0;\n font-size: var(--hax-ui-font-size-sm, 13px);\n }\n :host([filter-on]) simple-button-grid {\n margin-bottom: var(--simple-fields-margin-small, 8px);\n }\n :host([filter-on]) #hax-gizmo-filters {\n margin-bottom: 0;\n }\n :host([filter-on]) ::part(fieldset-options) {\n padding-bottom: var(--simple-fields-margin-small, 8px);\n }\n "])))]); } }, { key: "tag", get: function get() { return "hax-picker"; } }, { key: "properties", get: function get() { return { /** * raw element set */ _elements: { type: Array }, keywords: { type: Object }, /** * Refactored list for selection purposes */ selectionList: { type: Array }, /** * Allow multiple uses */ pickerType: { type: String, attribute: "picker-type" }, filters: { type: Array }, filterOn: { type: Boolean, attribute: "filter-on", reflect: true } }; } }]); return HaxPicker; }(_index.LitElement); _exports.HaxPicker = HaxPicker; window.customElements.define(HaxPicker.tag, HaxPicker); });
import DB from "~/node_common/database"; export const user = (entity) => { return { type: "USER", id: entity.id, username: entity.username, slates: entity.slates ? entity.slates : [], data: { name: entity.data.name ? entity.data.name : "", photo: entity.data.photo ? entity.data.photo : "", body: entity.data.body ? entity.data.body : "", }, }; }; export const slate = (entity) => { return { type: "SLATE", id: entity.id, slatename: entity.slatename, data: { ownerId: entity.data.ownerId, name: entity.data.name ? entity.data.name : "", body: entity.data.body ? entity.data.body : "", objects: entity.data.objects, layouts: entity.data.layouts, }, }; }; export const doSlates = async ({ serializedUsers, slates }) => { const userToSlatesMap = {}; const sanitized = slates.map((d) => { let o = null; if (userToSlatesMap[d.data.ownerId]) { userToSlatesMap[d.data.ownerId].push(d); } if (!userToSlatesMap[d.data.ownerId]) { userToSlatesMap[d.data.ownerId] = [d]; } if (d.data.ownerId) { o = serializedUsers.find((e) => d.data.ownerId === e.id); } return { ...d, owner: o }; }); return { serializedSlates: JSON.parse(JSON.stringify(sanitized)), userToSlatesMap, }; }; export const doTrusted = async ({ users, trusted, serializedUsersMap, serializedSlatesMap, }) => { trusted.forEach((each) => { if (each.target_user_id && !serializedUsersMap[each.target_user_id]) { users.push(each.target_user_id); } }); let userEntities = []; try { console.log({ query: `CHECK_TO_SERIALIZE` }); if (users.length) { console.log({ query: `(${users.length}) USERS_FOR_SERIALIZATION` }); userEntities = await DB.select("id", "username", "data") .from("users") .whereIn("id", users); } } catch (e) { console.log("FAILED TO SERIALIZE"); return { serializedTrusted: trusted, serializedUsersMap, serializedSlatesMap, }; } const sanitized = trusted.map((data) => { let u = null; let o = null; if (data.target_user_id) { if (serializedUsersMap[data.target_user_id]) { u = serializedUsersMap[data.target_user_id]; } else { u = userEntities.find((e) => data.target_user_id === e.id); u = user(u); serializedUsersMap[data.target_user_id] = u; } } if (data.owner_user_id) { if (serializedUsersMap[data.owner_user_id]) { o = serializedUsersMap[data.owner_user_id]; } else { o = userEntities.find((e) => data.owner_user_id === e.id); o = user(o); serializedUsersMap[data.owner_user_id] = o; } } return { ...data, user: u, owner: o }; }); return { serializedTrusted: JSON.parse(JSON.stringify(sanitized)), serializedUsersMap, serializedSlatesMap, }; }; export const doPendingTrusted = async ({ users, pendingTrusted, serializedUsersMap, serializedSlatesMap, }) => { pendingTrusted.forEach((each) => { if (each.owner_user_id && !serializedUsersMap[each.owner_user_id]) { users.push(each.owner_user_id); } }); let userEntities = []; try { console.log({ query: `CHECK_TO_SERIALIZE` }); if (users.length) { console.log({ query: `(${users.length}) USERS_FOR_SERIALIZATION` }); userEntities = await DB.select("id", "username", "data") .from("users") .whereIn("id", users); } } catch (e) { console.log("FAILED TO SERIALIZE"); return { serializedPendingTrusted: pendingTrusted, serializedUsersMap, serializedSlatesMap, }; } const sanitized = pendingTrusted.map((data) => { let u = null; let o = null; if (data.target_user_id) { if (serializedUsersMap[data.target_user_id]) { u = serializedUsersMap[data.target_user_id]; } else { u = userEntities.find((e) => data.target_user_id === e.id); u = user(u); serializedUsersMap[data.target_user_id] = u; } } if (data.owner_user_id) { if (serializedUsersMap[data.owner_user_id]) { o = serializedUsersMap[data.owner_user_id]; } else { o = userEntities.find((e) => data.owner_user_id === e.id); o = user(o); serializedUsersMap[data.owner_user_id] = o; } } return { ...data, user: u, owner: o }; }); return { serializedPendingTrusted: JSON.parse(JSON.stringify(sanitized)), serializedUsersMap, serializedSlatesMap, }; }; export const doSubscriptions = async ({ users, slates, subscriptions, serializedUsersMap, serializedSlatesMap, }) => { subscriptions.forEach((each) => { if (each.target_user_id && !serializedUsersMap[each.target_user_id]) { users.push(each.target_user_id); } if (each.target_slate_id && !serializedSlatesMap[each.target_slate_id]) { slates.push(each.target_slate_id); } }); let userEntities = []; try { console.log({ query: `CHECK_TO_SERIALIZE` }); if (users.length) { console.log({ query: `(${users.length}) USERS_FOR_SERIALIZATION` }); userEntities = await DB.select("id", "username", "data") .from("users") .whereIn("id", users); } } catch (e) { console.log("FAILED TO SERIALIZE"); return { serializedSubscriptions: subscriptions, serializedUsersMap, serializedSlatesMap, }; } let slateEntities = []; try { console.log({ query: `CHECK_TO_SERIALIZE` }); if (slates.length) { console.log({ query: `(${slates.length}) SLATES_FOR_SERIALIZATION` }); slateEntities = await DB.select("id", "slatename", "data") .from("slates") .whereIn("id", slates); } } catch (e) { console.log("FAILED TO SERIALIZE"); return { serializedSubscriptions: subscriptions, serializedUsersMap, serializedSlatesMap, }; } const sanitized = subscriptions.map((data) => { let u = null; let o = null; let s = null; if (data.target_user_id) { if (serializedUsersMap[data.target_user_id]) { u = serializedUsersMap[data.target_user_id]; } else { u = userEntities.find((e) => data.target_user_id === e.id); u = user(u); serializedUsersMap[data.target_user_id] = u; } } if (data.owner_user_id) { if (serializedUsersMap[data.owner_user_id]) { o = serializedUsersMap[data.owner_user_id]; } else { o = userEntities.find((e) => data.owner_user_id === e.id); o = user(o); serializedUsersMap[data.owner_user_id] = o; } } if (data.target_slate_id) { if (serializedSlatesMap[data.target_slate_id]) { s = serializedSlatesMap[data.target_slate_id]; } else { s = slateEntities.find((e) => data.target_slate_id === e.id); s = slate(s); serializedSlatesMap[data.target_slate_id] = s; } } return { ...data, user: u, owner: o, slate: s }; }); return { serializedSubscriptions: JSON.parse(JSON.stringify(sanitized)), serializedUsersMap, serializedSlatesMap, }; }; export const doSubscribers = async ({ users, slates, subscribers, serializedUsersMap, serializedSlatesMap, }) => { subscribers.forEach((each) => { if (each.owner_user_id && !serializedUsersMap[each.owner_user_id]) { users.push(each.owner_user_id); } }); let userEntities = []; try { console.log({ query: `CHECK_TO_SERIALIZE` }); if (users.length) { console.log({ query: `(${users.length}) USERS_FOR_SERIALIZATION` }); userEntities = await DB.select("id", "username", "data") .from("users") .whereIn("id", users); } } catch (e) { console.log("FAILED TO SERIALIZE"); return { serializedSubscribers: subscribers, serializedUsersMap, serializedSlatesMap, }; } const sanitized = subscribers.map((data) => { let u = null; let o = null; let s = null; if (data.owner_user_id) { if (serializedUsersMap[data.owner_user_id]) { o = serializedUsersMap[data.owner_user_id]; } else { o = userEntities.find((e) => data.owner_user_id === e.id); o = user(o); serializedUsersMap[data.owner_user_id] = o; } } if (data.target_user_id) { if (serializedUsersMap[data.target_user_id]) { u = serializedUsersMap[data.target_user_id]; } else { u = userEntities.find((e) => data.target_user_id === e.id); u = user(u); serializedUsersMap[data.target_user_id] = u; } } return { ...data, user: u, owner: o, slate: s }; }); return { serializedSubscribers: JSON.parse(JSON.stringify(sanitized)), serializedUsersMap, serializedSlatesMap, }; };
const path = require('path'); const commonjs = require('rollup-plugin-commonjs'); const nodeResolve = require('rollup-plugin-node-resolve'); const replace = require('rollup-plugin-replace'); const { terser } = require('rollup-plugin-terser'); const typescript = require('rollup-plugin-typescript2'); const packageJson = require('./package.json'); const dependencies = Object.keys(packageJson.dependencies); const peerDependencies = Object.keys(packageJson.peerDependencies); const PRODUCT_NAME = 'keyknox'; const FORMAT = { CJS: 'cjs', ES: 'es', UMD: 'umd', }; const sourcePath = path.join(__dirname, 'src'); const outputPath = path.join(__dirname, 'dist'); const createEntry = format => ({ external: format === FORMAT.UMD ? peerDependencies : dependencies.concat(peerDependencies), input: path.join(sourcePath, 'index.ts'), output: { format, file: path.join(outputPath, `keyknox.${format}.js`), name: 'Keyknox', globals: { 'virgil-sdk': 'Virgil', }, }, plugins: [ replace({ 'process.env.PRODUCT_NAME': JSON.stringify(PRODUCT_NAME), 'process.env.PRODUCT_VERSION': JSON.stringify(packageJson.version), }), format === FORMAT.UMD && nodeResolve({ browser: true, preferBuiltins: false }), format === FORMAT.UMD && commonjs(), typescript({ exclude: ['**/*.test.ts'], useTsconfigDeclarationDir: true, }), terser(), ], }); module.exports = Object.values(FORMAT).map(createEntry);
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function parseBucketArn(construct, props) { // if we have an explicit bucket ARN, use it. if (props.bucketArn) { return props.bucketArn; } if (props.bucketName) { return construct.node.stack.formatArn({ // S3 Bucket names are globally unique in a partition, // and so their ARNs have empty region and account components region: '', account: '', service: 's3', resource: props.bucketName }); } throw new Error('Cannot determine bucket ARN. At least `bucketArn` or `bucketName` is needed'); } exports.parseBucketArn = parseBucketArn; function parseBucketName(construct, props) { // if we have an explicit bucket name, use it. if (props.bucketName) { return props.bucketName; } // if we have a string arn, we can extract the bucket name from it. if (props.bucketArn) { const resolved = construct.node.resolve(props.bucketArn); if (typeof (resolved) === 'string') { const components = construct.node.stack.parseArn(resolved); if (components.service !== 's3') { throw new Error('Invalid ARN. Expecting "s3" service:' + resolved); } if (components.resourceName) { throw new Error(`Bucket ARN must not contain a path`); } return components.resource; } } // no bucket name is okay since it's optional. return undefined; } exports.parseBucketName = parseBucketName; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInV0aWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFHQSxTQUFnQixjQUFjLENBQUMsU0FBeUIsRUFBRSxLQUF3QjtJQUVoRiw2Q0FBNkM7SUFDN0MsSUFBSSxLQUFLLENBQUMsU0FBUyxFQUFFO1FBQ25CLE9BQU8sS0FBSyxDQUFDLFNBQVMsQ0FBQztLQUN4QjtJQUVELElBQUksS0FBSyxDQUFDLFVBQVUsRUFBRTtRQUNwQixPQUFPLFNBQVMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLFNBQVMsQ0FBQztZQUNwQyxzREFBc0Q7WUFDdEQsNkRBQTZEO1lBQzdELE1BQU0sRUFBRSxFQUFFO1lBQ1YsT0FBTyxFQUFFLEVBQUU7WUFDWCxPQUFPLEVBQUUsSUFBSTtZQUNiLFFBQVEsRUFBRSxLQUFLLENBQUMsVUFBVTtTQUMzQixDQUFDLENBQUM7S0FDSjtJQUVELE1BQU0sSUFBSSxLQUFLLENBQUMsNkVBQTZFLENBQUMsQ0FBQztBQUNqRyxDQUFDO0FBbkJELHdDQW1CQztBQUVELFNBQWdCLGVBQWUsQ0FBQyxTQUF5QixFQUFFLEtBQXdCO0lBRWpGLDhDQUE4QztJQUM5QyxJQUFJLEtBQUssQ0FBQyxVQUFVLEVBQUU7UUFDcEIsT0FBTyxLQUFLLENBQUMsVUFBVSxDQUFDO0tBQ3pCO0lBRUQsbUVBQW1FO0lBQ25FLElBQUksS0FBSyxDQUFDLFNBQVMsRUFBRTtRQUVuQixNQUFNLFFBQVEsR0FBRyxTQUFTLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLENBQUM7UUFDekQsSUFBSSxPQUFNLENBQUMsUUFBUSxDQUFDLEtBQUssUUFBUSxFQUFFO1lBQ2pDLE1BQU0sVUFBVSxHQUFHLFNBQVMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxRQUFRLENBQUMsQ0FBQztZQUMzRCxJQUFJLFVBQVUsQ0FBQyxPQUFPLEtBQUssSUFBSSxFQUFFO2dCQUMvQixNQUFNLElBQUksS0FBSyxDQUFDLHNDQUFzQyxHQUFHLFFBQVEsQ0FBQyxDQUFDO2FBQ3BFO1lBQ0QsSUFBSSxVQUFVLENBQUMsWUFBWSxFQUFFO2dCQUMzQixNQUFNLElBQUksS0FBSyxDQUFDLG9DQUFvQyxDQUFDLENBQUM7YUFDdkQ7WUFDRCxPQUFPLFVBQVUsQ0FBQyxRQUFRLENBQUM7U0FDNUI7S0FDRjtJQUVELDhDQUE4QztJQUM5QyxPQUFPLFNBQVMsQ0FBQztBQUNuQixDQUFDO0FBekJELDBDQXlCQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjZGsgPSByZXF1aXJlKCdAYXdzLWNkay9jZGsnKTtcbmltcG9ydCB7IEJ1Y2tldEltcG9ydFByb3BzIH0gZnJvbSAnLi9idWNrZXQnO1xuXG5leHBvcnQgZnVuY3Rpb24gcGFyc2VCdWNrZXRBcm4oY29uc3RydWN0OiBjZGsuSUNvbnN0cnVjdCwgcHJvcHM6IEJ1Y2tldEltcG9ydFByb3BzKTogc3RyaW5nIHtcblxuICAvLyBpZiB3ZSBoYXZlIGFuIGV4cGxpY2l0IGJ1Y2tldCBBUk4sIHVzZSBpdC5cbiAgaWYgKHByb3BzLmJ1Y2tldEFybikge1xuICAgIHJldHVybiBwcm9wcy5idWNrZXRBcm47XG4gIH1cblxuICBpZiAocHJvcHMuYnVja2V0TmFtZSkge1xuICAgIHJldHVybiBjb25zdHJ1Y3Qubm9kZS5zdGFjay5mb3JtYXRBcm4oe1xuICAgICAgLy8gUzMgQnVja2V0IG5hbWVzIGFyZSBnbG9iYWxseSB1bmlxdWUgaW4gYSBwYXJ0aXRpb24sXG4gICAgICAvLyBhbmQgc28gdGhlaXIgQVJOcyBoYXZlIGVtcHR5IHJlZ2lvbiBhbmQgYWNjb3VudCBjb21wb25lbnRzXG4gICAgICByZWdpb246ICcnLFxuICAgICAgYWNjb3VudDogJycsXG4gICAgICBzZXJ2aWNlOiAnczMnLFxuICAgICAgcmVzb3VyY2U6IHByb3BzLmJ1Y2tldE5hbWVcbiAgICB9KTtcbiAgfVxuXG4gIHRocm93IG5ldyBFcnJvcignQ2Fubm90IGRldGVybWluZSBidWNrZXQgQVJOLiBBdCBsZWFzdCBgYnVja2V0QXJuYCBvciBgYnVja2V0TmFtZWAgaXMgbmVlZGVkJyk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBwYXJzZUJ1Y2tldE5hbWUoY29uc3RydWN0OiBjZGsuSUNvbnN0cnVjdCwgcHJvcHM6IEJ1Y2tldEltcG9ydFByb3BzKTogc3RyaW5nIHwgdW5kZWZpbmVkIHtcblxuICAvLyBpZiB3ZSBoYXZlIGFuIGV4cGxpY2l0IGJ1Y2tldCBuYW1lLCB1c2UgaXQuXG4gIGlmIChwcm9wcy5idWNrZXROYW1lKSB7XG4gICAgcmV0dXJuIHByb3BzLmJ1Y2tldE5hbWU7XG4gIH1cblxuICAvLyBpZiB3ZSBoYXZlIGEgc3RyaW5nIGFybiwgd2UgY2FuIGV4dHJhY3QgdGhlIGJ1Y2tldCBuYW1lIGZyb20gaXQuXG4gIGlmIChwcm9wcy5idWNrZXRBcm4pIHtcblxuICAgIGNvbnN0IHJlc29sdmVkID0gY29uc3RydWN0Lm5vZGUucmVzb2x2ZShwcm9wcy5idWNrZXRBcm4pO1xuICAgIGlmICh0eXBlb2YocmVzb2x2ZWQpID09PSAnc3RyaW5nJykge1xuICAgICAgY29uc3QgY29tcG9uZW50cyA9IGNvbnN0cnVjdC5ub2RlLnN0YWNrLnBhcnNlQXJuKHJlc29sdmVkKTtcbiAgICAgIGlmIChjb21wb25lbnRzLnNlcnZpY2UgIT09ICdzMycpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdJbnZhbGlkIEFSTi4gRXhwZWN0aW5nIFwiczNcIiBzZXJ2aWNlOicgKyByZXNvbHZlZCk7XG4gICAgICB9XG4gICAgICBpZiAoY29tcG9uZW50cy5yZXNvdXJjZU5hbWUpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBCdWNrZXQgQVJOIG11c3Qgbm90IGNvbnRhaW4gYSBwYXRoYCk7XG4gICAgICB9XG4gICAgICByZXR1cm4gY29tcG9uZW50cy5yZXNvdXJjZTtcbiAgICB9XG4gIH1cblxuICAvLyBubyBidWNrZXQgbmFtZSBpcyBva2F5IHNpbmNlIGl0J3Mgb3B0aW9uYWwuXG4gIHJldHVybiB1bmRlZmluZWQ7XG59XG4iXX0=
const EventEmitter = require('events') const ObservableStore = require('obs-store') const createId = require('./random-id') const assert = require('assert') const sigUtil = require('eth-sig-util') const log = require('loglevel') /** * Represents, and contains data about, an 'eth_signTypedData' type signature request. These are created when a * signature for an eth_signTypedData call is requested. * * @typedef {Object} TypedMessage * @property {number} id An id to track and identify the message object * @property {Object} msgParams The parameters to pass to the eth_signTypedData method once the signature request is * approved. * @property {Object} msgParams.metamaskId Added to msgParams for tracking and identification within ETCMask. * @property {Object} msgParams.from The address that is making the signature request. * @property {string} msgParams.data A hex string conversion of the raw buffer data of the signature request * @property {number} time The epoch time at which the this message was created * @property {string} status Indicates whether the signature request is 'unapproved', 'approved', 'signed' or 'rejected' * @property {string} type The json-prc signing method for which a signature request has been made. A 'Message' will * always have a 'eth_signTypedData' type. * */ module.exports = class TypedMessageManager extends EventEmitter { /** * Controller in charge of managing - storing, adding, removing, updating - TypedMessage. * * @typedef {Object} TypedMessage * @param {Object} opts @deprecated * @property {Object} memStore The observable store where TypedMessage are saved. * @property {Object} memStore.unapprovedTypedMessages A collection of all TypedMessages in the 'unapproved' state * @property {number} memStore.unapprovedTypedMessagesCount The count of all TypedMessages in this.memStore.unapprobedMsgs * @property {array} messages Holds all messages that have been created by this TypedMessage * */ constructor (opts) { super() this.memStore = new ObservableStore({ unapprovedTypedMessages: {}, unapprovedTypedMessagesCount: 0, }) this.messages = [] } /** * A getter for the number of 'unapproved' TypedMessages in this.messages * * @returns {number} The number of 'unapproved' TypedMessages in this.messages * */ get unapprovedTypedMessagesCount () { return Object.keys(this.getUnapprovedMsgs()).length } /** * A getter for the 'unapproved' TypedMessages in this.messages * * @returns {Object} An index of TypedMessage ids to TypedMessages, for all 'unapproved' TypedMessages in * this.messages * */ getUnapprovedMsgs () { return this.messages.filter(msg => msg.status === 'unapproved') .reduce((result, msg) => { result[msg.id] = msg; return result }, {}) } /** * Creates a new TypedMessage with an 'unapproved' status using the passed msgParams. this.addMsg is called to add * the new TypedMessage to this.messages, and to save the unapproved TypedMessages from that list to * this.memStore. Before any of this is done, msgParams are validated * * @param {Object} msgParams The params for the eth_sign call to be made after the message is approved. * @returns {number} The id of the newly created TypedMessage. * */ addUnapprovedMessage (msgParams) { this.validateParams(msgParams) log.debug(`TypedMessageManager addUnapprovedMessage: ${JSON.stringify(msgParams)}`) // create txData obj with parameters and meta data var time = (new Date()).getTime() var msgId = createId() var msgData = { id: msgId, msgParams: msgParams, time: time, status: 'unapproved', type: 'eth_signTypedData', } this.addMsg(msgData) // signal update this.emit('update') return msgId } /** * Helper method for this.addUnapprovedMessage. Validates that the passed params have the required properties. * * @param {Object} params The params to validate * */ validateParams (params) { assert.equal(typeof params, 'object', 'Params should ben an object.') assert.ok('data' in params, 'Params must include a data field.') assert.ok('from' in params, 'Params must include a from field.') assert.ok(Array.isArray(params.data), 'Data should be an array.') assert.equal(typeof params.from, 'string', 'From field must be a string.') assert.doesNotThrow(() => { sigUtil.typedSignatureHash(params.data) }, 'Expected EIP712 typed data') } /** * Adds a passed TypedMessage to this.messages, and calls this._saveMsgList() to save the unapproved TypedMessages from that * list to this.memStore. * * @param {Message} msg The TypedMessage to add to this.messages * */ addMsg (msg) { this.messages.push(msg) this._saveMsgList() } /** * Returns a specified TypedMessage. * * @param {number} msgId The id of the TypedMessage to get * @returns {TypedMessage|undefined} The TypedMessage with the id that matches the passed msgId, or undefined * if no TypedMessage has that id. * */ getMsg (msgId) { return this.messages.find(msg => msg.id === msgId) } /** * Approves a TypedMessage. Sets the message status via a call to this.setMsgStatusApproved, and returns a promise * with any the message params modified for proper signing. * * @param {Object} msgParams The msgParams to be used when eth_sign is called, plus data added by ETCMask. * @param {Object} msgParams.metamaskId Added to msgParams for tracking and identification within ETCMask. * @returns {Promise<object>} Promises the msgParams object with metamaskId removed. * */ approveMessage (msgParams) { this.setMsgStatusApproved(msgParams.metamaskId) return this.prepMsgForSigning(msgParams) } /** * Sets a TypedMessage status to 'approved' via a call to this._setMsgStatus. * * @param {number} msgId The id of the TypedMessage to approve. * */ setMsgStatusApproved (msgId) { this._setMsgStatus(msgId, 'approved') } /** * Sets a TypedMessage status to 'signed' via a call to this._setMsgStatus and updates that TypedMessage in * this.messages by adding the raw signature data of the signature request to the TypedMessage * * @param {number} msgId The id of the TypedMessage to sign. * @param {buffer} rawSig The raw data of the signature request * */ setMsgStatusSigned (msgId, rawSig) { const msg = this.getMsg(msgId) msg.rawSig = rawSig this._updateMsg(msg) this._setMsgStatus(msgId, 'signed') } /** * Removes the metamaskId property from passed msgParams and returns a promise which resolves the updated msgParams * * @param {Object} msgParams The msgParams to modify * @returns {Promise<object>} Promises the msgParams with the metamaskId property removed * */ prepMsgForSigning (msgParams) { delete msgParams.metamaskId return Promise.resolve(msgParams) } /** * Sets a TypedMessage status to 'rejected' via a call to this._setMsgStatus. * * @param {number} msgId The id of the TypedMessage to reject. * */ rejectMsg (msgId) { this._setMsgStatus(msgId, 'rejected') } // // PRIVATE METHODS // /** * Updates the status of a TypedMessage in this.messages via a call to this._updateMsg * * @private * @param {number} msgId The id of the TypedMessage to update. * @param {string} status The new status of the TypedMessage. * @throws A 'TypedMessageManager - TypedMessage not found for id: "${msgId}".' if there is no TypedMessage * in this.messages with an id equal to the passed msgId * @fires An event with a name equal to `${msgId}:${status}`. The TypedMessage is also fired. * @fires If status is 'rejected' or 'signed', an event with a name equal to `${msgId}:finished` is fired along * with the TypedMessage * */ _setMsgStatus (msgId, status) { const msg = this.getMsg(msgId) if (!msg) throw new Error('TypedMessageManager - Message not found for id: "${msgId}".') msg.status = status this._updateMsg(msg) this.emit(`${msgId}:${status}`, msg) if (status === 'rejected' || status === 'signed') { this.emit(`${msgId}:finished`, msg) } } /** * Sets a TypedMessage in this.messages to the passed TypedMessage if the ids are equal. Then saves the * unapprovedTypedMsgs index to storage via this._saveMsgList * * @private * @param {msg} TypedMessage A TypedMessage that will replace an existing TypedMessage (with the same * id) in this.messages * */ _updateMsg (msg) { const index = this.messages.findIndex((message) => message.id === msg.id) if (index !== -1) { this.messages[index] = msg } this._saveMsgList() } /** * Saves the unapproved TypedMessages, and their count, to this.memStore * * @private * @fires 'updateBadge' * */ _saveMsgList () { const unapprovedTypedMessages = this.getUnapprovedMsgs() const unapprovedTypedMessagesCount = Object.keys(unapprovedTypedMessages).length this.memStore.updateState({ unapprovedTypedMessages, unapprovedTypedMessagesCount }) this.emit('updateBadge') } }
$(document).ready(function(){ $('.salir, .logoMenu').click(function(){ $('.mascara').fadeOut('slow'); }); $('.quienSomos').click(function(){ $('#formPqr').fadeOut('slow'); $('#somos').toggle('bounce'); }); $('.menuIngles').click(function(){ $('#formPqr').fadeOut('slow'); $('#ingles').toggle('clip'); }); $('.menuFran').click(function(){ $('#formPqr').fadeOut('slow'); $('#frances').toggle('fold'); }); $('.menuPqr').click(function(){ $('#formPqr').toggle('clip'); }); $('#btnGrupal').click(function(){ $('#grupal').toggle('highlight'); }); $('#btnPer').click(function(){ $('#personal').toggle('puff'); }); $('#btnInt').click(function(){ $('#internacional').toggle('pulsate'); }); $('#btnSk').click(function(){ $('#skype').toggle('scale'); }); $('#btnApoyo').click(function(){ $('#apoyo').toggle('shake'); }); $('#btnIc').click(function(){ $('#icfes').toggle('size'); }); $('#btnVaca').click(function(){ $('#vacacional').toggle('slide'); }); $('#btnPis').click(function(){ $('#pis').toggle('bounce'); }); $('#btnCon').click(function(){ $('#conversacion').toggle('scale'); }); });
// 这样做是为了让所有读取的代码都知道正确的env。 process.env.BABEL_ENV = 'test'; process.env.NODE_ENV = 'test'; process.env.PUBLIC_URL = ''; // 使脚本在未处理的拒绝中崩溃而不是静默 // 忽略它们 在将来,承诺拒绝是不会被处理的 // 用一个非零的退出码终止Node.js进程。 process.on('unhandledRejection', err => { throw err; }); const jest = require('jest'); const argv = process.argv.slice(2); // console.log(argv, argv[argv.length -1]) // 除非在CI或覆盖模式下监听 // if (argv[argv.length - 1].indexOf('--coverage') < 0) { // argv.push('--watch'); // } jest.run(argv);
/*! p5.min.js v0.3.13 December 10, 2014 */ var shim=function(){window.requestDraw=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}()}({}),constants=function(){var t=Math.PI;return{ARROW:"default",CROSS:"crosshair",HAND:"pointer",MOVE:"move",TEXT:"text",WAIT:"wait",HALF_PI:t/2,PI:t,QUARTER_PI:t/4,TAU:2*t,TWO_PI:2*t,DEGREES:"degrees",RADIANS:"radians",CORNER:"corner",CORNERS:"corners",RADIUS:"radius",RIGHT:"right",LEFT:"left",CENTER:"center",POINTS:"points",LINES:"lines",TRIANGLES:"triangles",TRIANGLE_FAN:"triangles_fan",TRIANGLE_STRIP:"triangles_strip",QUADS:"quads",QUAD_STRIP:"quad_strip",CLOSE:"close",OPEN:"open",CHORD:"chord",PIE:"pie",PROJECT:"square",SQUARE:"butt",ROUND:"round",BEVEL:"bevel",MITER:"miter",RGB:"rgb",HSB:"hsb",AUTO:"auto",ALT:18,BACKSPACE:8,CONTROL:17,DELETE:46,DOWN_ARROW:40,ENTER:13,ESCAPE:27,LEFT_ARROW:37,OPTION:18,RETURN:13,RIGHT_ARROW:39,SHIFT:16,TAB:9,UP_ARROW:38,BLEND:"normal",ADD:"lighter",DARKEST:"darken",LIGHTEST:"lighten",DIFFERENCE:"difference",EXCLUSION:"exclusion",MULTIPLY:"multiply",SCREEN:"screen",REPLACE:"source-over",OVERLAY:"overlay",HARD_LIGHT:"hard-light",SOFT_LIGHT:"soft-light",DODGE:"color-dodge",BURN:"color-burn",NORMAL:"normal",ITALIC:"italic",BOLD:"bold",LINEAR:"linear",QUADRATIC:"quadratic",BEZIER:"bezier",CURVE:"curve"}}({}),core=function(t,e,r){"use strict";var r=r,o=function(t,e){this._setupDone=!1,this._pixelDensity=window.devicePixelRatio||1,this._startTime=(new Date).getTime(),this._userNode=e,this._curElement=null,this._elements=[],this._preloadCount=0,this._updateInterval=0,this._isGlobal=!1,this._loop=!0,this._styles=[],this._defaultCanvasSize={width:100,height:100},this._events={mousemove:null,mousedown:null,mouseup:null,click:null,mousewheel:null,mouseover:null,mouseout:null,keydown:null,keyup:null,keypress:null,touchstart:null,touchmove:null,touchend:null,resize:null,blur:null},this._loadingScreenId="p5_loading",this._start=function(){if(this._userNode&&"string"==typeof this._userNode&&(this._userNode=document.getElementById(this._userNode)),this._loadingScreen=document.getElementById(this._loadingScreenId),!this._loadingScreen){this._loadingScreen=document.createElement("loadingDiv"),this._loadingScreen.innerHTML="loading...",this._loadingScreen.style.position="absolute";var t=this._userNode||document.body;t.appendChild(this._loadingScreen)}this.createCanvas(this._defaultCanvasSize.width,this._defaultCanvasSize.height,!0);var e=this.preload||window.preload,r=this._isGlobal?window:this;e?(this._preloadMethods.forEach(function(t){r[t]=function(e){return r._preload(t,e)}}),e(),0===this._preloadCount&&(this._setup(),this._runFrames(),this._draw())):(this._setup(),this._runFrames(),this._draw())}.bind(this),this._preload=function(t,e){var r=this._isGlobal?window:this;return r._setProperty("_preloadCount",r._preloadCount+1),o.prototype[t].call(r,e,function(){r._setProperty("_preloadCount",r._preloadCount-1),0===r._preloadCount&&(r._setup(),r._runFrames(),r._draw())})}.bind(this),this._setup=function(){var t=this._isGlobal?window:this;"function"==typeof t.preload&&this._preloadMethods.forEach(function(e){t[e]=o.prototype[e]}),"function"==typeof t.setup&&t.setup(),this.canvas.style.visibility="",this.canvas.className=this.canvas.className.replace("p5_hidden",""),this._setupDone=!0,this._loadingScreen.parentNode.removeChild(this._loadingScreen)}.bind(this),this._draw=function(){var t=this.setup||window.setup,e=(new Date).getTime();this._frameRate=1e3/(e-this._lastFrameTime),this._lastFrameTime=e;var r=this.draw||window.draw;this._loop&&(this._drawInterval&&clearInterval(this._drawInterval),this._drawInterval=setTimeout(function(){window.requestDraw(this._draw.bind(this))}.bind(this),1e3/this._targetFrameRate)),"function"==typeof r&&(this.push(),"undefined"==typeof t&&this.scale(this._pixelDensity,this._pixelDensity),this._registeredMethods.pre.forEach(function(t){t.call(this)}),r(),this._registeredMethods.post.forEach(function(t){t.call(this)}),this.pop()),this._updatePMouseCoords(),this._updatePTouchCoords()}.bind(this),this._runFrames=function(){this._updateInterval&&clearInterval(this._updateInterval),this._updateInterval=setInterval(function(){this._setProperty("frameCount",this.frameCount+1)}.bind(this),1e3/this._targetFrameRate)}.bind(this),this._setProperty=function(t,e){this[t]=e,this._isGlobal&&(window[t]=e)}.bind(this),this.remove=function(){if(this._curElement){this._loop=!1,this._drawInterval&&clearTimeout(this._drawInterval),this._updateInterval&&clearTimeout(this._updateInterval);for(var t in this._events)window.removeEventListener(t,this._events[t]);for(var e=0;e<this._elements.length;e++){var r=this._elements[e];r.elt.parentNode&&r.elt.parentNode.removeChild(r.elt);for(var n in r._events)r.elt.removeEventListener(n,r._events[n])}var i=this;if(this._registeredMethods.remove.forEach(function(t){"undefined"!=typeof t&&t.call(i)}),this._isGlobal){for(var s in o.prototype)try{delete window[s]}catch(a){window[s]=void 0}for(var h in this)if(this.hasOwnProperty(h))try{delete window[h]}catch(a){window[h]=void 0}}}}.bind(this);for(var n in r)o.prototype[n]=r[n];if(t)t(this);else{this._isGlobal=!0;for(var i in o.prototype)if("function"==typeof o.prototype[i]){var s=i.substring(2);this._events.hasOwnProperty(s)||(window[i]=o.prototype[i].bind(this))}else window[i]=o.prototype[i];for(var a in this)this.hasOwnProperty(a)&&(window[a]=this[a])}for(var h in this._events){var p=this["on"+h];if(p){var u=p.bind(this);window.addEventListener(h,u),this._events[h]=u}}var l=this;window.addEventListener("focus",function(){l._setProperty("focused",!0)}),window.addEventListener("blur",function(){l._setProperty("focused",!1)}),"complete"===document.readyState?this._start():window.addEventListener("load",this._start.bind(this),!1)};return o.prototype._preloadMethods=["loadJSON","loadImage","loadStrings","loadXML","loadShape","loadTable"],o.prototype._registeredMethods={pre:[],post:[],remove:[]},o.prototype.registerPreloadMethod=function(t){o.prototype._preloadMethods.push(t)}.bind(this),o.prototype.registerMethod=function(t,e){o.prototype._registeredMethods.hasOwnProperty(t)||(o.prototype._registeredMethods[t]=[]),o.prototype._registeredMethods[t].push(e)}.bind(this),o}({},shim,constants),p5Color=function(t,e,r){var o=e,r=r;return o.Color=function(t,e){if(e instanceof Array)this.rgba=e;else{var n=o.Color._getFormattedColor.apply(t,e);t._colorMode===r.HSB?(this.hsba=n,this.rgba=o.Color._getRGB(n)):this.rgba=n}var i=o.Color._normalizeColorArray.call(t,this.rgba);return this.colorString=o.Color._getColorString(i),this},o.Color._getFormattedColor=function(){if(arguments[0]instanceof Array)return o.Color.getNormalizedColor.apply(this,arguments[0]);var t,e,n,i;return arguments.length>=3?(t=arguments[0],e=arguments[1],n=arguments[2],i="number"==typeof arguments[3]?arguments[3]:255):(this._colorMode===r.RGB?t=e=n=arguments[0]:(t=n=arguments[0],e=0),i="number"==typeof arguments[1]?arguments[1]:255),[t,e,n,i]},o.Color._normalizeColorArray=function(t){var e=this._colorMode===r.RGB,o=e?this._maxRGB:this._maxHSB;return t[0]*=255/o[0],t[1]*=255/o[1],t[2]*=255/o[2],t[3]*=255/o[3],t},o.Color._getRGB=function(t){var e=t[0],r=t[1],o=t[2];e/=255,r/=255,o/=255;var n=[];if(0===r)n=[Math.round(255*o),Math.round(255*o),Math.round(255*o),t[3]];else{var i=6*e;6===i&&(i=0);var s,a,h,p=Math.floor(i),u=o*(1-r),l=o*(1-r*(i-p)),c=o*(1-r*(1-(i-p)));0===p?(s=o,a=c,h=u):1===p?(s=l,a=o,h=u):2===p?(s=u,a=o,h=c):3===p?(s=u,a=l,h=o):4===p?(s=c,a=u,h=o):(s=o,a=u,h=l),n=[Math.round(255*s),Math.round(255*a),Math.round(255*h),t[3]]}return n},o.Color._getHSB=function(t){var e,r,o=t[0]/255,n=t[1]/255,i=t[2]/255,s=Math.min(o,n,i),a=Math.max(o,n,i),h=a-s,p=a;if(0===h)e=0,r=0;else{r=h/a;var u=((a-o)/6+h/2)/h,l=((a-n)/6+h/2)/h,c=((a-i)/6+h/2)/h;o===a?e=c-l:n===a?e=1/3+u-c:i===a&&(e=2/3+l-u),0>e&&(e+=1),e>1&&(e-=1)}return[Math.round(255*e),Math.round(255*r),Math.round(255*p),t[3]]},o.Color._getColorString=function(t){for(var e=0;3>e;e++)t[e]=Math.floor(t[e]);var r="undefined"!=typeof t[3]?t[3]/255:1;return"rgba("+t[0]+","+t[1]+","+t[2]+","+r+")"},o.Color._getCanvasColor=function(){if(arguments[0]instanceof o.Color){if(1===arguments.length)return arguments[0].colorString;var t=arguments[0].rgba;return t[3]=arguments[1],t=o.Color._normalizeColorArray.call(this,t),o.Color._getColorString(t)}if(arguments[0]instanceof Array){if(1===arguments.length)return o.Color._getColorString(arguments[0]);var e=this._colorMode===r.RGB,n=e?this._maxRGB[3]:this._maxHSB[3];return arguments[0][3]=255*arguments[1]/n,o.Color._getColorString(arguments[0])}var i=o.Color._getFormattedColor.apply(this,arguments);return i=o.Color._normalizeColorArray.call(this,i),this._colorMode===r.HSB&&(i=o.Color._getRGB(i)),o.Color._getColorString(i)},o.Color}({},core,constants),p5Element=function(t,e){function r(t,e,r){var o=e.bind(r);r.elt.addEventListener(t,o,!1),r._events[t]=o}var o=e;return o.Element=function(t,e){this.elt=t,this._pInst=e,this._events={},this.width=this.elt.offsetWidth,this.height=this.elt.offsetHeight},o.Element.prototype.parent=function(t){return"string"==typeof t?t=document.getElementById(t):t instanceof o.Element&&(t=t.elt),t.appendChild(this.elt),this},o.Element.prototype.id=function(t){return this.elt.id=t,this},o.Element.prototype.class=function(t){return this.elt.className+=" "+t,this},o.Element.prototype.mousePressed=function(t){return r("mousedown",t,this),r("touchstart",t,this),this},o.Element.prototype.mouseWheel=function(t){return r("mousewheel",t,this),this},o.Element.prototype.mouseReleased=function(t){return r("mouseup",t,this),r("touchend",t,this),this},o.Element.prototype.mouseClicked=function(t){return r("click",t,this),this},o.Element.prototype.mouseMoved=function(t){return r("mousemove",t,this),r("touchmove",t,this),this},o.Element.prototype.mouseOver=function(t){return r("mouseover",t,this),this},o.Element.prototype.mouseOut=function(t){return r("mouseout",t,this),this},o.Element.prototype.touchStarted=function(t){return r("touchstart",t,this),r("mousedown",t,this),this},o.Element.prototype.touchMoved=function(t){return r("touchmove",t,this),r("mousemove",t,this),this},o.Element.prototype.touchEnded=function(t){return r("touchend",t,this),r("mouseup",t,this),this},o.Element.prototype._setProperty=function(t,e){this[t]=e},o.Element}({},core),p5Graphics=function(t,e,r){var o=e,r=r;return o.Graphics=function(t,e,r){o.Element.call(this,t,e),this.canvas=t,this.drawingContext=this.canvas.getContext("2d"),this._pInst=e,r?(this._isMainCanvas=!0,this._pInst._setProperty("_curElement",this),this._pInst._setProperty("canvas",this.canvas),this._pInst._setProperty("drawingContext",this.drawingContext),this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height)):(this.canvas.style.display="none",this._styles=[])},o.Graphics.prototype=Object.create(o.Element.prototype),o.Graphics.prototype._applyDefaults=function(){this.drawingContext.fillStyle="#FFFFFF",this.drawingContext.strokeStyle="#000000",this.drawingContext.lineCap=r.ROUND,this.drawingContext.font="normal 12px sans-serif"},o.Graphics.prototype.resize=function(t,e){this.width=t,this.height=e,this.elt.width=t*this._pInst._pixelDensity,this.elt.height=e*this._pInst._pixelDensity,this.elt.style.width=t+"px",this.elt.style.height=e+"px",this._isMainCanvas&&(this._pInst._setProperty("width",this.width),this._pInst._setProperty("height",this.height)),this.drawingContext.scale(this._pInst._pixelDensity,this._pInst._pixelDensity)},o.Graphics}({},core,constants),filters=function(){"use strict";function t(t){var e=3.5*t|0;if(e=1>e?1:248>e?e:248,o!==e){o=e,n=1+o<<1,i=new Int32Array(n),s=new Array(n);for(var r=0;n>r;r++)s[r]=new Int32Array(256);for(var a,h,p,u,l=1,c=e-1;e>l;l++){i[e+l]=i[c]=h=c*c,p=s[e+l],u=s[c--];for(var d=0;256>d;d++)p[d]=u[d]=h*d}a=i[e]=e*e,p=s[e];for(var f=0;256>f;f++)p[f]=a*f}}function e(e,a){for(var h=r._toPixels(e),p=e.width,u=e.height,l=p*u,c=new Int32Array(l),d=0;l>d;d++)c[d]=r._getARGB(h,d);var f,g,y,m,w,v,_,x,C,b,S=new Int32Array(l),R=new Int32Array(l),T=new Int32Array(l),E=new Int32Array(l),M=0;t(a);var P,A,I,k;for(A=0;u>A;A++){for(P=0;p>P;P++){if(m=y=g=w=f=0,v=P-o,0>v)b=-v,v=0;else{if(v>=p)break;b=0}for(I=b;n>I&&!(v>=p);I++){var D=c[v+M];k=s[I],w+=k[(-16777216&D)>>>24],g+=k[(16711680&D)>>16],y+=k[(65280&D)>>8],m+=k[255&D],f+=i[I],v++}_=M+P,S[_]=w/f,R[_]=g/f,T[_]=y/f,E[_]=m/f}M+=p}for(M=0,x=-o,C=x*p,A=0;u>A;A++){for(P=0;p>P;P++){if(m=y=g=w=f=0,0>x)b=_=-x,v=P;else{if(x>=u)break;b=0,_=x,v=P+C}for(I=b;n>I&&!(_>=u);I++)k=s[I],w+=k[S[v]],g+=k[R[v]],y+=k[T[v]],m+=k[E[v]],f+=i[I],_++,v+=p;c[P+M]=w/f<<24|g/f<<16|y/f<<8|m/f}M+=p,C+=p,x++}r._setPixels(h,c)}var r={};r._toPixels=function(t){return t instanceof ImageData?t.data:t.getContext("2d").getImageData(0,0,t.width,t.height).data},r._getARGB=function(t,e){var r=4*e;return t[r+3]<<24&4278190080|t[r]<<16&16711680|t[r+1]<<8&65280|255&t[r+2]},r._setPixels=function(t,e){for(var r=0,o=0,n=t.length;n>o;o++)r=4*o,t[r+0]=(16711680&e[o])>>>16,t[r+1]=(65280&e[o])>>>8,t[r+2]=255&e[o],t[r+3]=(4278190080&e[o])>>>24},r._toImageData=function(t){return t instanceof ImageData?t:t.getContext("2d").getImageData(0,0,t.width,t.height)},r._createImageData=function(t,e){return r._tmpCanvas=document.createElement("canvas"),r._tmpCtx=r._tmpCanvas.getContext("2d"),this._tmpCtx.createImageData(t,e)},r.apply=function(t,e,r){var o=t.getContext("2d"),n=o.getImageData(0,0,t.width,t.height),i=e(n,r);i instanceof ImageData?o.putImageData(i,0,0,0,0,t.width,t.height):o.putImageData(n,0,0,0,0,t.width,t.height)},r.threshold=function(t,e){var o=r._toPixels(t);void 0===e&&(e=.5);for(var n=Math.floor(255*e),i=0;i<o.length;i+=4){var s,a=o[i],h=o[i+1],p=o[i+2],u=.2126*a+.7152*h+.0722*p;s=u>=n?255:0,o[i]=o[i+1]=o[i+2]=s}},r.gray=function(t){for(var e=r._toPixels(t),o=0;o<e.length;o+=4){var n=e[o],i=e[o+1],s=e[o+2],a=.2126*n+.7152*i+.0722*s;e[o]=e[o+1]=e[o+2]=a}},r.opaque=function(t){for(var e=r._toPixels(t),o=0;o<e.length;o+=4)e[o+3]=255;return e},r.invert=function(t){for(var e=r._toPixels(t),o=0;o<e.length;o+=4)e[o]=255-e[o],e[o+1]=255-e[o+1],e[o+2]=255-e[o+2]},r.posterize=function(t,e){var o=r._toPixels(t);if(2>e||e>255)throw new Error("Level must be greater than 2 and less than 255 for posterize");for(var n=e-1,i=0;i<o.length;i+=4){var s=o[i],a=o[i+1],h=o[i+2];o[i]=255*(s*e>>8)/n,o[i+1]=255*(a*e>>8)/n,o[i+2]=255*(h*e>>8)/n}},r.dilate=function(t){for(var e,o,n,i,s,a,h,p,u,l,c,d,f,g,y,m,w,v=r._toPixels(t),_=0,x=v.length?v.length/4:0,C=new Int32Array(x);x>_;)for(e=_,o=_+t.width;o>_;)n=i=r._getARGB(v,_),h=_-1,a=_+1,p=_-t.width,u=_+t.width,e>h&&(h=_),a>=o&&(a=_),0>p&&(p=0),u>=x&&(u=_),d=r._getARGB(v,p),c=r._getARGB(v,h),f=r._getARGB(v,u),l=r._getARGB(v,a),s=77*(n>>16&255)+151*(n>>8&255)+28*(255&n),y=77*(c>>16&255)+151*(c>>8&255)+28*(255&c),g=77*(l>>16&255)+151*(l>>8&255)+28*(255&l),m=77*(d>>16&255)+151*(d>>8&255)+28*(255&d),w=77*(f>>16&255)+151*(f>>8&255)+28*(255&f),y>s&&(i=c,s=y),g>s&&(i=l,s=g),m>s&&(i=d,s=m),w>s&&(i=f,s=w),C[_++]=i;r._setPixels(v,C)},r.erode=function(t){for(var e,o,n,i,s,a,h,p,u,l,c,d,f,g,y,m,w,v=r._toPixels(t),_=0,x=v.length?v.length/4:0,C=new Int32Array(x);x>_;)for(e=_,o=_+t.width;o>_;)n=i=r._getARGB(v,_),h=_-1,a=_+1,p=_-t.width,u=_+t.width,e>h&&(h=_),a>=o&&(a=_),0>p&&(p=0),u>=x&&(u=_),d=r._getARGB(v,p),c=r._getARGB(v,h),f=r._getARGB(v,u),l=r._getARGB(v,a),s=77*(n>>16&255)+151*(n>>8&255)+28*(255&n),y=77*(c>>16&255)+151*(c>>8&255)+28*(255&c),g=77*(l>>16&255)+151*(l>>8&255)+28*(255&l),m=77*(d>>16&255)+151*(d>>8&255)+28*(255&d),w=77*(f>>16&255)+151*(f>>8&255)+28*(255&f),s>y&&(i=c,s=y),s>g&&(i=l,s=g),s>m&&(i=d,s=m),s>w&&(i=f,s=w),C[_++]=i;r._setPixels(v,C)};var o,n,i,s;return r.blur=function(t,r){e(t,r)},r}({}),p5Image=function(t,e,r){"use strict";var o=e,n=r;return o.Image=function(t,e){this.width=t,this.height=e,this.canvas=document.createElement("canvas"),this.canvas.width=this.width,this.canvas.height=this.height,this.drawingContext=this.canvas.getContext("2d"),this.pixels=[]},o.Image.prototype._setProperty=function(t,e){this[t]=e},o.Image.prototype.loadPixels=function(){o.prototype.loadPixels.call(this)},o.Image.prototype.updatePixels=function(t,e,r,n){o.prototype.updatePixels.call(this,t,e,r,n)},o.Image.prototype.get=function(t,e,r,n){return o.prototype.get.call(this,t,e,r,n)},o.Image.prototype.set=function(t,e,r){o.prototype.set.call(this,t,e,r)},o.Image.prototype.resize=function(t,e){t=t||this.canvas.width,e=e||this.canvas.height;var r=document.createElement("canvas");r.width=t,r.height=e,r.getContext("2d").drawImage(this.canvas,0,0,this.canvas.width,this.canvas.height,0,0,r.width,r.height),this.canvas.width=this.width=t,this.canvas.height=this.height=e,this.drawingContext.drawImage(r,0,0,t,e,0,0,t,e),this.pixels.length>0&&this.loadPixels()},o.Image.prototype.copy=function(){o.prototype.copy.apply(this,arguments)},o.Image.prototype.mask=function(t){void 0===t&&(t=this);var e=this.drawingContext.globalCompositeOperation,r=1;t instanceof o.Graphics&&(r=t._pInst._pixelDensity);var n=[t,0,0,r*t.width,r*t.height,0,0,this.width,this.height];this.drawingContext.globalCompositeOperation="destination-out",this.copy.apply(this,n),this.drawingContext.globalCompositeOperation=e},o.Image.prototype.filter=function(t,e){n.apply(this.canvas,n[t.toLowerCase()],e)},o.Image.prototype.blend=function(){o.prototype.blend.apply(this,arguments)},o.Image.prototype.save=function(t,e){var r;if(e)switch(e.toLowerCase()){case"png":r="image/png";break;case"jpeg":r="image/jpeg";break;case"jpg":r="image/jpeg";break;default:r="image/png"}else e="png",r="image/png";var n="image/octet-stream",i=this.canvas.toDataURL(r);i=i.replace(r,n),o.prototype.downloadFile(i,t,e)},o.Image}({},core,filters),polargeometry=function(){return{degreesToRadians:function(t){return 2*Math.PI*t/360},radiansToDegrees:function(t){return 360*t/(2*Math.PI)}}}({}),p5Vector=function(t,e,r,o){"use strict";var n=e,i=r,o=o;return n.Vector=function(){var t,e,r;arguments[0]instanceof n?(this.p5=arguments[0],t=arguments[1][0]||0,e=arguments[1][1]||0,r=arguments[1][2]||0):(t=arguments[0]||0,e=arguments[1]||0,r=arguments[2]||0),this.x=t,this.y=e,this.z=r},n.Vector.prototype.set=function(t,e,r){return t instanceof n.Vector?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this):t instanceof Array?(this.x=t[0]||0,this.y=t[1]||0,this.z=t[2]||0,this):(this.x=t||0,this.y=e||0,this.z=r||0,this)},n.Vector.prototype.get=function(){return this.p5?new n.Vector(this.p5,[this.x,this.y,this.z]):new n.Vector(this.x,this.y,this.z)},n.Vector.prototype.add=function(t,e,r){return t instanceof n.Vector?(this.x+=t.x||0,this.y+=t.y||0,this.z+=t.z||0,this):t instanceof Array?(this.x+=t[0]||0,this.y+=t[1]||0,this.z+=t[2]||0,this):(this.x+=t||0,this.y+=e||0,this.z+=r||0,this)},n.Vector.prototype.sub=function(t,e,r){return t instanceof n.Vector?(this.x-=t.x||0,this.y-=t.y||0,this.z-=t.z||0,this):t instanceof Array?(this.x-=t[0]||0,this.y-=t[1]||0,this.z-=t[2]||0,this):(this.x-=t||0,this.y-=e||0,this.z-=r||0,this)},n.Vector.prototype.mult=function(t){return this.x*=t||0,this.y*=t||0,this.z*=t||0,this},n.Vector.prototype.div=function(t){return this.x/=t,this.y/=t,this.z/=t,this},n.Vector.prototype.mag=function(){return Math.sqrt(this.magSq())},n.Vector.prototype.magSq=function(){var t=this.x,e=this.y,r=this.z;return t*t+e*e+r*r},n.Vector.prototype.dot=function(t,e,r){return t instanceof n.Vector?this.dot(t.x,t.y,t.z):this.x*(t||0)+this.y*(e||0)+this.z*(r||0)},n.Vector.prototype.cross=function(t){var e=this.y*t.z-this.z*t.y,r=this.z*t.x-this.x*t.z,o=this.x*t.y-this.y*t.x;return this.p5?new n.Vector(this.p5,[e,r,o]):new n.Vector(e,r,o)},n.Vector.prototype.dist=function(t){var e=t.get().sub(this);return e.mag()},n.Vector.prototype.normalize=function(){return this.div(this.mag())},n.Vector.prototype.limit=function(t){var e=this.magSq();return e>t*t&&(this.div(Math.sqrt(e)),this.mult(t)),this},n.Vector.prototype.setMag=function(t){return this.normalize().mult(t)},n.Vector.prototype.heading=function(){var t=Math.atan2(this.y,this.x);return this.p5?this.p5._angleMode===o.RADIANS?t:i.radiansToDegrees(t):t},n.Vector.prototype.rotate=function(t){this.p5&&this.p5._angleMode===o.DEGREES&&(t=i.degreesToRadians(t));var e=this.heading()+t,r=this.mag();return this.x=Math.cos(e)*r,this.y=Math.sin(e)*r,this},n.Vector.prototype.lerp=function(t,e,r,o){return t instanceof n.Vector?this.lerp(t.x,t.y,t.z,e):(this.x+=(t-this.x)*o||0,this.y+=(e-this.y)*o||0,this.z+=(r-this.z)*o||0,this)},n.Vector.prototype.array=function(){return[this.x||0,this.y||0,this.z||0]},n.Vector.fromAngle=function(t){return this.p5&&this.p5._angleMode===o.DEGREES&&(t=i.degreesToRadians(t)),this.p5?new n.Vector(this.p5,[Math.cos(t),Math.sin(t),0]):new n.Vector(Math.cos(t),Math.sin(t),0)},n.Vector.random2D=function(){var t;return t=this.p5?this.p5.random(this.p5._angleMode===o.DEGREES?360:o.TWO_PI):Math.random()*Math.PI*2,this.fromAngle(t)},n.Vector.random3D=function(){var t,e;this.p5?(t=this.p5.random(0,o.TWO_PI),e=this.p5.random(-1,1)):(t=Math.random()*Math.PI*2,e=2*Math.random()-1);var r=Math.sqrt(1-e*e)*Math.cos(t),i=Math.sqrt(1-e*e)*Math.sin(t);return this.p5?new n.Vector(this.p5,[r,i,e]):new n.Vector(r,i,e)},n.Vector.add=function(t,e){return t.get().add(e)},n.Vector.sub=function(t,e){return t.get().sub(e)},n.Vector.mult=function(t,e){return t.get().mult(e)},n.Vector.div=function(t,e){return t.get().div(e)},n.Vector.dot=function(t,e){return t.dot(e)},n.Vector.cross=function(t,e){return t.cross(e)},n.Vector.dist=function(t,e){return t.dist(e)},n.Vector.lerp=function(t,e,r){return t.get().lerp(e,r)},n.Vector.angleBetween=function(t,e){var r=Math.acos(t.dot(e)/(t.mag()*e.mag()));return this.p5&&this.p5._angleMode===o.DEGREES&&(r=i.radiansToDegrees(r)),r},n.Vector}({},core,polargeometry,constants),p5TableRow=function(t,e){"use strict";var r=e;return r.TableRow=function(t,e){var r=[],o={};t&&(e=e||",",r=t.split(e));for(var n=0;n<r.length;n++){var i=n,s=r[n];o[i]=s}this.arr=r,this.obj=o,this.table=null},r.TableRow.prototype.set=function(t,e){if("string"==typeof t){var r=this.table.columns.indexOf(t);if(!(r>=0))throw'This table has no column named "'+t+'"';this.obj[t]=e,this.arr[r]=e}else{if(!(t<this.table.columns.length))throw"Column #"+t+" is out of the range of this table";this.arr[t]=e;var o=this.table.columns[t];this.obj[o]=e}},r.TableRow.prototype.setNum=function(t,e){var r=parseFloat(e,10);this.set(t,r)},r.TableRow.prototype.setString=function(t,e){var r=e.toString();this.set(t,r)},r.TableRow.prototype.get=function(t){return"string"==typeof t?this.obj[t]:this.arr[t]},r.TableRow.prototype.getNum=function(t){var e;if(e="string"==typeof t?parseFloat(this.obj[t],10):parseFloat(this.arr[t],10),"NaN"===e.toString())throw"Error: "+this.obj[t]+" is NaN (Not a Number)";return e},r.TableRow.prototype.getString=function(t){return"string"==typeof t?this.obj[t].toString():this.arr[t].toString()},r.TableRow}({},core),p5Table=function(t,e){"use strict";var r=e;return r.Table=function(){this.columns=[],this.rows=[]},r.Table.prototype.addRow=function(t){var e=t||new r.TableRow;if("undefined"==typeof e.arr||"undefined"==typeof e.obj)throw"invalid TableRow: "+e;return e.table=this,this.rows.push(e),e},r.Table.prototype.removeRow=function(t){this.rows[t].table=null;var e=this.rows.splice(t+1,this.rows.length);this.rows.pop(),this.rows=this.rows.concat(e)},r.Table.prototype.getRow=function(t){return this.rows[t]},r.Table.prototype.getRows=function(){return this.rows},r.Table.prototype.findRow=function(t,e){if("string"==typeof e){for(var r=0;r<this.rows.length;r++)if(this.rows[r].obj[e]===t)return this.rows[r]}else for(var o=0;o<this.rows.length;o++)if(this.rows[o].arr[e]===t)return this.rows[o];return null},r.Table.prototype.findRows=function(t,e){var r=[];if("string"==typeof e)for(var o=0;o<this.rows.length;o++)this.rows[o].obj[e]===t&&r.push(this.rows[o]);else for(var n=0;n<this.rows.length;n++)this.rows[n].arr[e]===t&&r.push(this.rows[n]);return r},r.Table.prototype.matchRow=function(t,e){if("number"==typeof e){for(var r=0;r<this.rows.length;r++)if(this.rows[r].arr[e].match(t))return this.rows[r]}else for(var o=0;o<this.rows.length;o++)if(this.rows[o].obj[e].match(t))return this.rows[o];return null},r.Table.prototype.matchRows=function(t,e){var r=[];if("number"==typeof e)for(var o=0;o<this.rows.length;o++)this.rows[o].arr[e].match(t)&&r.push(this.rows[o]);else for(var n=0;n<this.rows.length;n++)this.rows[n].obj[e].match(t)&&r.push(this.rows[n]);return r},r.Table.prototype.getColumn=function(t){var e=[];if("string"==typeof t)for(var r=0;r<this.rows.length;r++)e.push(this.rows[r].obj[t]);else for(var o=0;o<this.rows.length;o++)e.push(this.rows[o].arr[t]);return e},r.Table.prototype.clearRows=function(){delete this.rows,this.rows=[]},r.Table.prototype.addColumn=function(t){var e=t||null;this.columns.push(e)},r.Table.prototype.getColumnCount=function(){return this.columns.length},r.Table.prototype.getRowCount=function(){return this.rows.length},r.Table.prototype.removeTokens=function(t,e){for(var r=function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},o=[],n=0;n<t.length;n++)o.push(r(t.charAt(n)));var i=new RegExp(o.join("|"),"g");if("undefined"==typeof e)for(var s=0;s<this.columns.length;s++)for(var a=0;a<this.rows.length;a++){var h=this.rows[a].arr[s];h=h.replace(i,""),this.rows[a].arr[s]=h,this.rows[a].obj[this.columns[s]]=h}else if("string"==typeof e)for(var p=0;p<this.rows.length;p++){var u=this.rows[p].obj[e];u=u.replace(i,""),this.rows[p].obj[e]=u;var l=this.columns.indexOf(e);this.rows[p].arr[l]=u}else for(var c=0;c<this.rows.length;c++){var d=this.rows[c].arr[e];d=d.replace(i,""),this.rows[c].arr[e]=d,this.rows[c].obj[this.columns[e]]=d}},r.Table.prototype.trim=function(t){var e=new RegExp(" ","g");if("undefined"==typeof t)for(var r=0;r<this.columns.length;r++)for(var o=0;o<this.rows.length;o++){var n=this.rows[o].arr[r];n=n.replace(e,""),this.rows[o].arr[r]=n,this.rows[o].obj[this.columns[r]]=n}else if("string"==typeof t)for(var i=0;i<this.rows.length;i++){var s=this.rows[i].obj[t];s=s.replace(e,""),this.rows[i].obj[t]=s;var a=this.columns.indexOf(t);this.rows[i].arr[a]=s}else for(var h=0;h<this.rows.length;h++){var p=this.rows[h].arr[t];p=p.replace(e,""),this.rows[h].arr[t]=p,this.rows[h].obj[this.columns[t]]=p}},r.Table.prototype.removeColumn=function(t){var e,r;"string"==typeof t?(e=t,r=this.columns.indexOf(t),console.log("string")):(r=t,e=this.columns[t]);var o=this.columns.splice(r+1,this.columns.length);this.columns.pop(),this.columns=this.columns.concat(o);for(var n=0;n<this.rows.length;n++){var i=this.rows[n].arr,s=i.splice(r+1,i.length);i.pop(),this.rows[n].arr=i.concat(s),delete this.rows[n].obj[e]}},r.Table}({},core),colorcreating_reading=function(t,e){"use strict";var r=e;return r.prototype.alpha=function(t){if(t instanceof r.Color)return t.rgba[3];if(t instanceof Array)return t[3];throw new Error("Needs p5.Color or pixel array as argument.")},r.prototype.blue=function(t){if(t instanceof Array)return t[2];if(t instanceof r.Color)return t.rgba[2];throw new Error("Needs p5.Color or pixel array as argument.")},r.prototype.brightness=function(t){if(!t instanceof r.Color)throw new Error("Needs p5.Color as argument.");return t.hsba||(t.hsba=r.Color.getRGB(t.rgba),t.hsba=t.hsba.concat(t.rgba[3])),t.hsba[2]},r.prototype.color=function(){return arguments[0]instanceof Array?new r.Color(this,arguments[0],!0):new r.Color(this,arguments)},r.prototype.green=function(t){if(t instanceof Array)return t[1];if(t instanceof r.Color)return t.rgba[1];throw new Error("Needs p5.Color or pixel array as argument.")},r.prototype.hue=function(t){if(!t instanceof r.Color)throw new Error("Needs p5.Color as argument.");return t.hsba||(t.hsba=r.Color.getRGB(t.rgba)),t.hsba[0]},r.prototype.lerpColor=function(t,e,o){if(t instanceof Array){for(var n=[],i=0;i<t.length;i++)n.push(r.prototype.lerp(t[i],e[i],o));return n}if(t instanceof r.Color){for(var s=[],a=0;4>a;a++)s.push(r.prototype.lerp(t.rgba[a],e.rgba[a],o));return new r.Color(this,s)}return r.prototype.lerp(t,e,o)},r.prototype.red=function(t){if(t instanceof Array)return t[0];if(t instanceof r.Color)return t.rgba[0];throw new Error("Needs p5.Color or pixel array as argument.")},r.prototype.saturation=function(t){if(!t instanceof r.Color)throw new Error("Needs p5.Color as argument.");return t.hsba||(t.hsba=r.Color.getRGB(t.rgba),t.hsba=t.hsba.concat(t.rgba[3])),t.hsba[1]},r}({},core,p5Color),colorsetting=function(t,e,r){"use strict";var o=e,r=r;return o.prototype._doStroke=!0,o.prototype._doFill=!0,o.prototype._colorMode=r.RGB,o.prototype._maxRGB=[255,255,255,255],o.prototype._maxHSB=[255,255,255,255],o.prototype.background=function(){if(arguments[0]instanceof o.Image)this.image(arguments[0],0,0,this.width,this.height);else{var t=this.drawingContext.fillStyle,e=this.drawingContext;e.fillStyle=o.Color._getCanvasColor.apply(this,arguments),e.fillRect(0,0,this.width,this.height),e.fillStyle=t}},o.prototype.clear=function(){this.drawingContext.clearRect(0,0,this.width,this.height)},o.prototype.colorMode=function(){if(arguments[0]===r.RGB||arguments[0]===r.HSB){this._colorMode=arguments[0];var t=this._colorMode===r.RGB,e=t?this._maxRGB:this._maxHSB;2===arguments.length?(e[0]=arguments[1],e[1]=arguments[1],e[2]=arguments[1]):arguments.length>2&&(e[0]=arguments[1],e[1]=arguments[2],e[2]=arguments[3]),5===arguments.length&&(e[3]=arguments[4])}},o.prototype.fill=function(){this._setProperty("_doFill",!0);var t=this.drawingContext;t.fillStyle=o.Color._getCanvasColor.apply(this,arguments)},o.prototype.noFill=function(){this._setProperty("_doFill",!1)},o.prototype.noStroke=function(){this._setProperty("_doStroke",!1)},o.prototype.stroke=function(){this._setProperty("_doStroke",!0);var t=this.drawingContext;t.strokeStyle=o.Color._getCanvasColor.apply(this,arguments)},o}({},core,constants,p5Color),dataconversion=function(t,e){"use strict";var r=e;return r.prototype.float=function(t){return parseFloat(t)},r.prototype.int=function(t,e){return"string"==typeof t?(e=e||10,parseInt(t,e)):"number"==typeof t?0|t:"boolean"==typeof t?t?1:0:t instanceof Array?t.map(r.prototype.int):void 0},r}({},core),dataarray_functions=function(t,e){"use strict";var r=e;return r.prototype.append=function(t,e){return t.push(e),t},r.prototype.arrayCopy=function(t,e,r,o,n){var i,s;"undefined"!=typeof n?(s=Math.min(n,t.length),i=o,t=t.slice(e,s+e)):("undefined"!=typeof r?(s=r,s=Math.min(s,t.length)):s=t.length,i=0,r=e,t=t.slice(0,s)),Array.prototype.splice.apply(r,[i,s].concat(t))},r.prototype.concat=function(t,e){return t.concat(e)},r.prototype.reverse=function(t){return t.reverse()},r.prototype.shorten=function(t){return t.pop(),t},r.prototype.sort=function(t,e){var r=e?t.slice(0,Math.min(e,t.length)):t,o=e?t.slice(Math.min(e,t.length)):[];return r="string"==typeof r[0]?r.sort():r.sort(function(t,e){return t-e}),r.concat(o)},r.prototype.splice=function(t,e,r){return Array.prototype.splice.apply(t,[r,0].concat(e)),t},r.prototype.subset=function(t,e,r){return"undefined"!=typeof r?t.slice(e,e+r):t.slice(e,t.length)},r}({},core),datastring_functions=function(t,e){"use strict";function r(){var t=arguments[0],e=0>t,r=e?t.toString().substring(1):t.toString(),o=r.indexOf("."),n=-1!==o?r.substring(0,o):r,i=-1!==o?r.substring(o+1):"",s=e?"-":"";if(3===arguments.length){for(var a=0;a<arguments[1]-n.length;a++)s+="0";s+=n,s+=".",s+=i;for(var h=0;h<arguments[2]-i.length;h++)s+="0";return s}for(var p=0;p<Math.max(arguments[1]-n.length,0);p++)s+="0";return s+=r}function o(){var t=arguments[0].toString(),e=t.indexOf("."),r=-1!==e?t.substring(e):"",o=-1!==e?t.substring(0,e):t;return o=o.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),arguments.length>1&&(r=r.substring(0,arguments[1]+1)),o+r}function n(){return parseFloat(arguments[0])>0?"+"+arguments[0].toString():arguments[0].toString()}function i(){return parseFloat(arguments[0])>0?" "+arguments[0].toString():arguments[0].toString() }var s=e;return s.prototype.join=function(t,e){return t.join(e)},s.prototype.match=function(t,e){return t.match(e)},s.prototype.matchAll=function(t,e){for(var r=new RegExp(e,"g"),o=r.exec(t),n=[];null!==o;)n.push(o),o=r.exec(t);return n},s.prototype.nf=function(){if(arguments[0]instanceof Array){var t=arguments[1],e=arguments[2];return arguments[0].map(function(o){return r(o,t,e)})}return r.apply(this,arguments)},s.prototype.nfc=function(){if(arguments[0]instanceof Array){var t=arguments[1];return arguments[0].map(function(e){return o(e,t)})}return o.apply(this,arguments)},s.prototype.nfp=function(){var t=this.nf(arguments);return t instanceof Array?t.map(n):n(t)},s.prototype.nfs=function(){var t=this.nf(arguments);return t instanceof Array?t.map(i):i(t)},s.prototype.split=function(t,e){return t.split(e)},s.prototype.splitTokens=function(){var t=arguments.length>0?arguments[1]:/\s/g;return arguments[0].split(t).filter(function(t){return t})},s.prototype.trim=function(t){return t instanceof Array?t.map(this.trim):t.trim()},s}({},core),environment=function(t,e,r){"use strict";function o(t){var e=document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled;if(!e)throw new Error("Fullscreen not enabled in this browser.");t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}function n(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}var i=e,s=r,a=[s.ARROW,s.CROSS,s.HAND,s.MOVE,s.TEXT,s.WAIT];return i.prototype._frameRate=0,i.prototype._lastFrameTime=(new Date).getTime(),i.prototype._targetFrameRate=60,i.prototype.frameCount=0,i.prototype.focused=!0,i.prototype.cursor=function(t,e,r){var o="auto",n=this._curElement.elt;if(a.indexOf(t)>-1)o=t;else if("string"==typeof t){var i="";e&&r&&"number"==typeof e&&"number"==typeof r&&(i=e+" "+r),o="http://"!==t.substring(0,6)?"url("+t+") "+i+", auto":/\.(cur|jpg|jpeg|gif|png|CUR|JPG|JPEG|GIF|PNG)$/.test(t)?"url("+t+") "+i+", auto":t}n.style.cursor=o},i.prototype.frameRate=function(t){return"undefined"==typeof t?this._frameRate:(this._setProperty("_targetFrameRate",t),this._runFrames(),this)},i.prototype.getFrameRate=function(){return this.frameRate()},i.prototype.setFrameRate=function(t){return this.frameRate(t)},i.prototype.noCursor=function(){this._curElement.elt.style.cursor="none"},i.prototype.displayWidth=screen.width,i.prototype.displayHeight=screen.height,i.prototype.windowWidth=window.innerWidth,i.prototype.windowHeight=window.innerHeight,i.prototype.onresize=function(t){this._setProperty("windowWidth",window.innerWidth),this._setProperty("windowHeight",window.innerHeight);var e,r=this._isGlobal?window:this;"function"==typeof r.windowResized&&(e=r.windowResized(t),void 0===e||e||t.preventDefault())},i.prototype.width=0,i.prototype.height=0,i.prototype.fullscreen=function(t){return"undefined"==typeof t?document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement:void(t?o(document.documentElement):n())},i.prototype.devicePixelScaling=function(t){this._pixelDensity=t?window.devicePixelRatio||1:1,this.resizeCanvas(this.width,this.height)},i}({},core,constants),imageimage=function(t,e,r){"use strict";var o=e,r=r;return o.prototype._imageMode=r.CORNER,o.prototype._tint=null,o.prototype.createImage=function(t,e){return new o.Image(t,e)},o}({},core,constants),canvas=function(t,e){var e=e;return{modeAdjust:function(t,r,o,n,i){return i===e.CORNER?{x:t,y:r,w:o,h:n}:i===e.CORNERS?{x:t,y:r,w:o-t,h:n-r}:i===e.RADIUS?{x:t-o,y:r-n,w:2*o,h:2*n}:i===e.CENTER?{x:t-.5*o,y:r-.5*n,w:o,h:n}:void 0},arcModeAdjust:function(t,r,o,n,i){return i===e.CORNER?{x:t+.5*o,y:r+.5*n,w:o,h:n}:i===e.CORNERS?{x:t,y:r,w:o+t,h:n+r}:i===e.RADIUS?{x:t,y:r,w:2*o,h:2*n}:i===e.CENTER?{x:t,y:r,w:o,h:n}:void 0}}}({},constants),imageloading_displaying=function(t,e,r,o,n){"use strict";var i=e,s=r,o=o,n=n;return i.prototype.loadImage=function(t,e){var r=new Image,o=new i.Image(1,1,this);return r.onload=function(){o.width=o.canvas.width=r.width,o.height=o.canvas.height=r.height,o.canvas.getContext("2d").drawImage(r,0,0),"undefined"!=typeof e&&e(o)},0!==t.indexOf("data:image/")&&(r.crossOrigin="Anonymous"),r.src=t,o},i.prototype.image=function(t,e,r,n,i){var s=t.canvas||t.elt;e=e||0,r=r||0,n=n||t.width,i=i||t.height;var a=o.modeAdjust(e,r,n,i,this._imageMode);this._tint&&t.canvas?this.drawingContext.drawImage(this._getTintedImageCanvas(t),a.x,a.y,a.w,a.h):this.drawingContext.drawImage(s,a.x,a.y,a.w,a.h)},i.prototype.tint=function(){var t=i.Color._getFormattedColor.apply(this,arguments);t=i.Color._normalizeColorArray.call(this,t),this._tint=t},i.prototype.noTint=function(){this._tint=null},i.prototype._getTintedImageCanvas=function(t){if(!t.canvas)return t;var e=s._toPixels(t.canvas),r=document.createElement("canvas");r.width=t.canvas.width,r.height=t.canvas.height;for(var o=r.getContext("2d"),n=o.createImageData(t.canvas.width,t.canvas.height),i=n.data,a=0;a<e.length;a+=4){var h=e[a],p=e[a+1],u=e[a+2],l=e[a+3];i[a]=h*this._tint[0]/255,i[a+1]=p*this._tint[1]/255,i[a+2]=u*this._tint[2]/255,i[a+3]=l*this._tint[3]/255}return o.putImageData(n,0,0),r},i.prototype.imageMode=function(t){(t===n.CORNER||t===n.CORNERS||t===n.CENTER)&&(this._imageMode=t)},i}({},core,filters,canvas,constants),imagepixels=function(t,e,r){"use strict";var o=e,n=r;return o.prototype.pixels=[],o.prototype.blend=function(){var t=this.drawingContext.globalCompositeOperation,e=arguments[arguments.length-1],r=Array.prototype.slice.call(arguments,0,arguments.length-1);this.drawingContext.globalCompositeOperation=e,this.copy.apply(this,r),this.drawingContext.globalCompositeOperation=t},o.prototype.copy=function(){var t,e,r,o,n,i,s,a,h;if(9===arguments.length)t=arguments[0],e=arguments[1],r=arguments[2],o=arguments[3],n=arguments[4],i=arguments[5],s=arguments[6],a=arguments[7],h=arguments[8];else{if(8!==arguments.length)throw new Error("Signature not supported");e=arguments[0],r=arguments[1],o=arguments[2],n=arguments[3],i=arguments[4],s=arguments[5],a=arguments[6],h=arguments[7],t=this}var p=t.canvas.width/t.width;this.drawingContext.drawImage(t.canvas,p*e,p*r,p*o,p*n,i,s,a,h)},o.prototype.filter=function(t,e){n.apply(this.canvas,n[t.toLowerCase()],e)},o.prototype.get=function(t,e,r,n){if(void 0===t&&void 0===e&&void 0===r&&void 0===n?(t=0,e=0,r=this.width,n=this.height):void 0===r&&void 0===n&&(r=1,n=1),t>this.width||e>this.height||0>t||0>e)return[0,0,0,255];var i=this.drawingContext.getImageData(t,e,r,n),s=i.data;if(1===r&&1===n){for(var a=[],h=0;h<s.length;h+=4)a.push(s[h],s[h+1],s[h+2],s[h+3]);return a}r=Math.min(r,this.width),n=Math.min(n,this.height);var p=new o.Image(r,n);return p.canvas.getContext("2d").putImageData(i,0,0,0,0,r,n),p},o.prototype.loadPixels=function(){var t=this.width,e=this.height,r=this.drawingContext.getImageData(0,0,t,e);this._setProperty("imageData",r),this._setProperty("pixels",r.data)},o.prototype.set=function(t,e,r){if(r instanceof o.Image)this.drawingContext.drawImage(r.canvas,t,e),this.loadPixels.call(this);else{var n=4*(e*this.width+t);if(this.imageData||this.loadPixels.call(this),"number"==typeof r)n<this.pixels.length&&(this.pixels[n]=r,this.pixels[n+1]=r,this.pixels[n+2]=r,this.pixels[n+3]=255);else if(r instanceof Array){if(r.length<4)throw new Error("pixel array must be of the form [R, G, B, A]");n<this.pixels.length&&(this.pixels[n]=r[0],this.pixels[n+1]=r[1],this.pixels[n+2]=r[2],this.pixels[n+3]=r[3])}else r instanceof o.Color&&n<this.pixels.length&&(this.pixels[n]=r.rgba[0],this.pixels[n+1]=r.rgba[1],this.pixels[n+2]=r.rgba[2],this.pixels[n+3]=r.rgba[3])}},o.prototype.updatePixels=function(t,e,r,o){void 0===t&&void 0===e&&void 0===r&&void 0===o&&(t=0,e=0,r=this.width,o=this.height),this.drawingContext.putImageData(this.imageData,t,e,0,0,r,o)},o}({},core,filters,p5Color);!function(t,e,r){"undefined"!=typeof module&&module.exports?module.exports=r():"function"==typeof define&&define.amd?define("reqwest",r):e[t]=r()}("reqwest",this,function(){function handleReadyState(t,e,r){return function(){return t._aborted?r(t.request):void(t.request&&4==t.request[readyState]&&(t.request.onreadystatechange=noop,twoHundo.test(t.request.status)?e(t.request):r(t.request)))}}function setHeaders(t,e){var r,o=e.headers||{};o.Accept=o.Accept||defaultHeaders.accept[e.type]||defaultHeaders.accept["*"],e.crossOrigin||o[requestedWith]||(o[requestedWith]=defaultHeaders.requestedWith),o[contentType]||(o[contentType]=e.contentType||defaultHeaders.contentType);for(r in o)o.hasOwnProperty(r)&&"setRequestHeader"in t&&t.setRequestHeader(r,o[r])}function setCredentials(t,e){"undefined"!=typeof e.withCredentials&&"undefined"!=typeof t.withCredentials&&(t.withCredentials=!!e.withCredentials)}function generalCallback(t){lastValue=t}function urlappend(t,e){return t+(/\?/.test(t)?"&":"?")+e}function handleJsonp(t,e,r,o){var n=uniqid++,i=t.jsonpCallback||"callback",s=t.jsonpCallbackName||reqwest.getcallbackPrefix(n),a=new RegExp("((^|\\?|&)"+i+")=([^&]+)"),h=o.match(a),p=doc.createElement("script"),u=0,l=-1!==navigator.userAgent.indexOf("MSIE 10.0");return h?"?"===h[3]?o=o.replace(a,"$1="+s):s=h[3]:o=urlappend(o,i+"="+s),win[s]=generalCallback,p.type="text/javascript",p.src=o,p.async=!0,"undefined"==typeof p.onreadystatechange||l||(p.event="onclick",p.htmlFor=p.id="_reqwest_"+n),p.onload=p.onreadystatechange=function(){return p[readyState]&&"complete"!==p[readyState]&&"loaded"!==p[readyState]||u?!1:(p.onload=p.onreadystatechange=null,p.onclick&&p.onclick(),e(lastValue),lastValue=void 0,head.removeChild(p),void(u=1))},head.appendChild(p),{abort:function(){p.onload=p.onreadystatechange=null,r({},"Request is aborted: timeout",{}),lastValue=void 0,head.removeChild(p),u=1}}}function getRequest(t,e){var r,o=this.o,n=(o.method||"GET").toUpperCase(),i="string"==typeof o?o:o.url,s=o.processData!==!1&&o.data&&"string"!=typeof o.data?reqwest.toQueryString(o.data):o.data||null,a=!1;return"jsonp"!=o.type&&"GET"!=n||!s||(i=urlappend(i,s),s=null),"jsonp"==o.type?handleJsonp(o,t,e,i):(r=o.xhr&&o.xhr(o)||xhr(o),r.open(n,i,o.async===!1?!1:!0),setHeaders(r,o),setCredentials(r,o),win[xDomainRequest]&&r instanceof win[xDomainRequest]?(r.onload=t,r.onerror=e,r.onprogress=function(){},a=!0):r.onreadystatechange=handleReadyState(this,t,e),o.before&&o.before(r),a?setTimeout(function(){r.send(s)},200):r.send(s),r)}function Reqwest(t,e){this.o=t,this.fn=e,init.apply(this,arguments)}function setType(t){var e=t.match(/\.(json|jsonp|html|xml)(\?|$)/);return e?e[1]:"js"}function init(o,fn){function complete(t){for(o.timeout&&clearTimeout(self.timeout),self.timeout=null;self._completeHandlers.length>0;)self._completeHandlers.shift()(t)}function success(resp){resp="jsonp"!==type?self.request:resp;var filteredResponse=globalSetupOptions.dataFilter(resp.responseText,type),r=filteredResponse;try{resp.responseText=r}catch(e){}if(r)switch(type){case"json":try{resp=win.JSON?win.JSON.parse(r):eval("("+r+")")}catch(err){return error(resp,"Could not parse JSON in response",err)}break;case"js":resp=eval(r);break;case"html":resp=r;break;case"xml":resp=resp.responseXML&&resp.responseXML.parseError&&resp.responseXML.parseError.errorCode&&resp.responseXML.parseError.reason?null:resp.responseXML}for(self._responseArgs.resp=resp,self._fulfilled=!0,fn(resp),self._successHandler(resp);self._fulfillmentHandlers.length>0;)resp=self._fulfillmentHandlers.shift()(resp);complete(resp)}function error(t,e,r){for(t=self.request,self._responseArgs.resp=t,self._responseArgs.msg=e,self._responseArgs.t=r,self._erred=!0;self._errorHandlers.length>0;)self._errorHandlers.shift()(t,e,r);complete(t)}this.url="string"==typeof o?o:o.url,this.timeout=null,this._fulfilled=!1,this._successHandler=function(){},this._fulfillmentHandlers=[],this._errorHandlers=[],this._completeHandlers=[],this._erred=!1,this._responseArgs={};var self=this,type=o.type||setType(this.url);fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort()},o.timeout)),o.success&&(this._successHandler=function(){o.success.apply(o,arguments)}),o.error&&this._errorHandlers.push(function(){o.error.apply(o,arguments)}),o.complete&&this._completeHandlers.push(function(){o.complete.apply(o,arguments)}),this.request=getRequest.call(this,success,error)}function reqwest(t,e){return new Reqwest(t,e)}function normalize(t){return t?t.replace(/\r?\n/g,"\r\n"):""}function serial(t,e){var r,o,n,i,s=t.name,a=t.tagName.toLowerCase(),h=function(t){t&&!t.disabled&&e(s,normalize(t.attributes.value&&t.attributes.value.specified?t.value:t.text))};if(!t.disabled&&s)switch(a){case"input":/reset|button|image|file/i.test(t.type)||(r=/checkbox/i.test(t.type),o=/radio/i.test(t.type),n=t.value,(!(r||o)||t.checked)&&e(s,normalize(r&&""===n?"on":n)));break;case"textarea":e(s,normalize(t.value));break;case"select":if("select-one"===t.type.toLowerCase())h(t.selectedIndex>=0?t.options[t.selectedIndex]:null);else for(i=0;t.length&&i<t.length;i++)t.options[i].selected&&h(t.options[i])}}function eachFormElement(){var t,e,r=this,o=function(t,e){var o,n,i;for(o=0;o<e.length;o++)for(i=t[byTag](e[o]),n=0;n<i.length;n++)serial(i[n],r)};for(e=0;e<arguments.length;e++)t=arguments[e],/input|select|textarea/i.test(t.tagName)&&serial(t,r),o(t,["input","select","textarea"])}function serializeQueryString(){return reqwest.toQueryString(reqwest.serializeArray.apply(null,arguments))}function serializeHash(){var t={};return eachFormElement.apply(function(e,r){e in t?(t[e]&&!isArray(t[e])&&(t[e]=[t[e]]),t[e].push(r)):t[e]=r},arguments),t}function buildParams(t,e,r,o){var n,i,s,a=/\[\]$/;if(isArray(e))for(i=0;e&&i<e.length;i++)s=e[i],r||a.test(t)?o(t,s):buildParams(t+"["+("object"==typeof s?i:"")+"]",s,r,o);else if(e&&"[object Object]"===e.toString())for(n in e)buildParams(t+"["+n+"]",e[n],r,o);else o(t,e)}var win=window,doc=document,twoHundo=/^(20\d|1223)$/,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",requestedWith="X-Requested-With",head=doc[byTag]("head")[0],uniqid=0,callbackPrefix="reqwest_"+ +new Date,lastValue,xmlHttpRequest="XMLHttpRequest",xDomainRequest="XDomainRequest",noop=function(){},isArray="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},defaultHeaders={contentType:"application/x-www-form-urlencoded",requestedWith:xmlHttpRequest,accept:{"*":"text/javascript, text/html, application/xml, text/xml, */*",xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript",js:"application/javascript, text/javascript"}},xhr=function(t){if(t.crossOrigin===!0){var e=win[xmlHttpRequest]?new XMLHttpRequest:null;if(e&&"withCredentials"in e)return e;if(win[xDomainRequest])return new XDomainRequest;throw new Error("Browser does not support cross-origin requests")}return win[xmlHttpRequest]?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")},globalSetupOptions={dataFilter:function(t){return t}};return Reqwest.prototype={abort:function(){this._aborted=!0,this.request.abort()},retry:function(){init.call(this,this.o,this.fn)},then:function(t,e){return t=t||function(){},e=e||function(){},this._fulfilled?this._responseArgs.resp=t(this._responseArgs.resp):this._erred?e(this._responseArgs.resp,this._responseArgs.msg,this._responseArgs.t):(this._fulfillmentHandlers.push(t),this._errorHandlers.push(e)),this},always:function(t){return this._fulfilled||this._erred?t(this._responseArgs.resp):this._completeHandlers.push(t),this},fail:function(t){return this._erred?t(this._responseArgs.resp,this._responseArgs.msg,this._responseArgs.t):this._errorHandlers.push(t),this}},reqwest.serializeArray=function(){var t=[];return eachFormElement.apply(function(e,r){t.push({name:e,value:r})},arguments),t},reqwest.serialize=function(){if(0===arguments.length)return"";var t,e,r=Array.prototype.slice.call(arguments,0);return t=r.pop(),t&&t.nodeType&&r.push(t)&&(t=null),t&&(t=t.type),e="map"==t?serializeHash:"array"==t?reqwest.serializeArray:serializeQueryString,e.apply(null,r)},reqwest.toQueryString=function(t,e){var r,o,n=e||!1,i=[],s=encodeURIComponent,a=function(t,e){e="function"==typeof e?e():null==e?"":e,i[i.length]=s(t)+"="+s(e)};if(isArray(t))for(o=0;t&&o<t.length;o++)a(t[o].name,t[o].value);else for(r in t)t.hasOwnProperty(r)&&buildParams(r,t[r],n,a);return i.join("&").replace(/%20/g,"+")},reqwest.getcallbackPrefix=function(){return callbackPrefix},reqwest.compat=function(t,e){return t&&(t.type&&(t.method=t.type)&&delete t.type,t.dataType&&(t.type=t.dataType),t.jsonpCallback&&(t.jsonpCallbackName=t.jsonpCallback)&&delete t.jsonpCallback,t.jsonp&&(t.jsonpCallback=t.jsonp)),new Reqwest(t,e)},reqwest.ajaxSetup=function(t){t=t||{};for(var e in t)globalSetupOptions[e]=t[e]},reqwest});var inputfiles=function(t,e,r){"use strict";function o(t,e){var r={};if(e=e||[],"undefined"==typeof e)for(var o=0;o<t.length;o++)e[o.toString()]=o;for(var n=0;n<e.length;n++){var i=e[n],s=t[n];r[i]=s}return r}function n(t,e){for(var o,n=e[0],i={},s="",a=1;a<e.length;a++)"string"==typeof e[a]?s=e[a]:"object"==typeof e[a]?i=e[a]:"function"==typeof e[a]&&(o=e[a]);""===s&&(s=-1!==n.indexOf(".json")?"json":-1!==n.indexOf(".xml")?"xml":"text"),r({url:n,method:t,data:i,type:s,crossOrigin:!0,success:function(t){"undefined"!=typeof o&&o(t)}})}var i=e,r=r;return i.prototype.createInput=function(){throw"not yet implemented"},i.prototype.createReader=function(){throw"not yet implemented"},i.prototype.loadBytes=function(){throw"not yet implemented"},i.prototype.loadJSON=function(t,e){var o=[],n=-1===t.indexOf("http")?"json":"jsonp";return"string"==typeof arguments[2]&&("jsonp"===arguments[2]||"json"===arguments[2])&&(n=arguments[2]),r({url:t,type:n,crossOrigin:!0}).then(function(t){for(var r in t)o[r]=t[r];"undefined"!=typeof e&&e(t)}),o},i.prototype.loadStrings=function(t,e){var r=[],o=new XMLHttpRequest;return o.open("GET",t,!0),o.onreadystatechange=function(){if(4===o.readyState&&(200===o.status||0===o.status)){var t=o.responseText.match(/[^\r\n]+/g);for(var n in t)r[n]=t[n];"undefined"!=typeof e&&e(r)}},o.send(null),r},i.prototype.loadTable=function(t){for(var e=null,r=[],n=!1,s=",",a=1;a<arguments.length;a++)"function"==typeof arguments[a]?e=arguments[a]:"string"==typeof arguments[a]&&(r.push(arguments[a]),"header"===arguments[a]&&(n=!0),"csv"===arguments[a]?s=",":"tsv"===arguments[a]&&(s=" "));var h=[],p=new i.Table,u=new XMLHttpRequest;return u.open("GET",t,!0),u.onreadystatechange=function(){if(4===u.readyState&&(200===u.status||0===u.status)){var t=u.responseText.match(/[^\r\n]+/g);for(var r in t)h[r]=t[r];if("undefined"!=typeof e){var a,l;if(n)for(p.columns=new i.TableRow(h[0]).arr,a=1;a<h.length;a++)l=new i.TableRow(h[a],s),l.obj=o(l.arr,p.columns),p.addRow(l);else{for(a=0;a<h[0].split(s).length;a++)p.columns[a]=a.toString();for(a=0;a<h.length;a++)l=new i.TableRow(h[a],s),p.addRow(l)}e(p)}}},u.send(null),p},i.prototype.loadXML=function(t,e){var o=[];return r({url:t,type:"xml",crossOrigin:!0}).then(function(t){e(t)}),o},i.prototype.parseXML=function(){throw"not yet implemented"},i.prototype.selectFolder=function(){throw"not yet implemented"},i.prototype.selectInput=function(){throw"not yet implemented"},i.prototype.httpGet=function(){n("get",arguments)},i.prototype.httpPost=function(){n("post",arguments)},i}({},core,reqwest),inputkeyboard=function(t,e){"use strict";var r=e,o={};return r.prototype.isKeyPressed=!1,r.prototype.keyIsPressed=!1,r.prototype.key="",r.prototype.keyCode=0,r.prototype.onkeydown=function(t){this._setProperty("isKeyPressed",!0),this._setProperty("keyIsPressed",!0),this._setProperty("keyCode",t.which),o[t.which]=!0;var e=String.fromCharCode(t.which);e||(e=t.which),this._setProperty("key",e);var r=this.keyPressed||window.keyPressed;if("function"==typeof r&&!t.charCode){var n=r(t);n===!1&&t.preventDefault()}},r.prototype.onkeyup=function(t){var e=this.keyReleased||window.keyReleased;this._setProperty("isKeyPressed",!1),this._setProperty("keyIsPressed",!1),o[t.which]=!1;var r=String.fromCharCode(t.which);if(r||(r=t.which),this._setProperty("key",r),this._setProperty("keyCode",t.which),"function"==typeof e){var n=e(t);n===!1&&t.preventDefault()}},r.prototype.onkeypress=function(t){this._setProperty("keyCode",t.which),this._setProperty("key",String.fromCharCode(t.which));var e=this.keyTyped||window.keyTyped;if("function"==typeof e){var r=e(t);r===!1&&t.preventDefault()}},r.prototype.onblur=function(){o={}},r.prototype.keyIsDown=function(t){return o[t]},r}({},core),inputmouse=function(t,e,r){"use strict";function o(t,e){var r=t.getBoundingClientRect();return{x:e.clientX-r.left,y:e.clientY-r.top}}var n=e,r=r;return n.prototype.mouseX=0,n.prototype.mouseY=0,n.prototype.pmouseX=0,n.prototype.pmouseY=0,n.prototype.winMouseX=0,n.prototype.winMouseY=0,n.prototype.pwinMouseX=0,n.prototype.pwinMouseY=0,n.prototype.mouseButton=0,n.prototype.mouseIsPressed=!1,n.prototype.isMousePressed=!1,n.prototype._updateMouseCoords=function(t){if("touchstart"===t.type||"touchmove"===t.type||"touchend"===t.type)this._setProperty("mouseX",this.touchX),this._setProperty("mouseY",this.touchY);else if(null!==this._curElement){var e=o(this._curElement.elt,t);this._setProperty("mouseX",e.x),this._setProperty("mouseY",e.y)}this._setProperty("winMouseX",t.pageX),this._setProperty("winMouseY",t.pageY)},n.prototype._updatePMouseCoords=function(){this._setProperty("pmouseX",this.mouseX),this._setProperty("pmouseY",this.mouseY),this._setProperty("pwinMouseX",this.winMouseX),this._setProperty("pwinMouseY",this.winMouseY)},n.prototype._setMouseButton=function(t){1===t.button?this._setProperty("mouseButton",r.CENTER):2===t.button?this._setProperty("mouseButton",r.RIGHT):(this._setProperty("mouseButton",r.LEFT),("touchstart"===t.type||"touchmove"===t.type)&&(this._setProperty("mouseX",this.touchX),this._setProperty("mouseY",this.touchY)))},n.prototype.onmousemove=function(t){var e,r=this._isGlobal?window:this;this._updateMouseCoords(t),this.isMousePressed?"function"==typeof r.mouseDragged?(e=r.mouseDragged(t),e===!1&&t.preventDefault()):"function"==typeof r.touchMoved&&(e=r.touchMoved(t),e===!1&&t.preventDefault(),this._updateTouchCoords(t)):"function"==typeof r.mouseMoved&&(e=r.mouseMoved(t),e===!1&&t.preventDefault())},n.prototype.onmousedown=function(t){var e,r=this._isGlobal?window:this;this._setProperty("isMousePressed",!0),this._setProperty("mouseIsPressed",!0),this._setMouseButton(t),this._updateMouseCoords(t),"function"==typeof r.mousePressed?(e=r.mousePressed(t),e===!1&&t.preventDefault()):"function"==typeof r.touchStarted&&(e=r.touchStarted(t),e===!1&&t.preventDefault(),this._updateTouchCoords(t))},n.prototype.onmouseup=function(t){var e,r=this._isGlobal?window:this;this._setProperty("isMousePressed",!1),this._setProperty("mouseIsPressed",!1),"function"==typeof r.mouseReleased?(e=r.mouseReleased(t),e===!1&&t.preventDefault()):"function"==typeof r.touchEnded&&(e=r.touchEnded(t),e===!1&&t.preventDefault(),this._updateTouchCoords(t))},n.prototype.onclick=function(t){var e=this._isGlobal?window:this;if("function"==typeof e.mouseClicked){var r=e.mouseClicked(t);r===!1&&t.preventDefault()}},n.prototype.onmousewheel=function(t){var e=this._isGlobal?window:this;if("function"==typeof e.mouseWheel){var r=e.mouseWheel(t);r===!1&&t.preventDefault()}},n}({},core,constants),inputtime_date=function(t,e){"use strict";var r=e;return r.prototype.day=function(){return(new Date).getDate()},r.prototype.hour=function(){return(new Date).getHours()},r.prototype.minute=function(){return(new Date).getMinutes()},r.prototype.millis=function(){return(new Date).getTime()-this._startTime},r.prototype.month=function(){return(new Date).getMonth()+1},r.prototype.second=function(){return(new Date).getSeconds()},r.prototype.year=function(){return(new Date).getFullYear()},r}({},core),inputtouch=function(t,e){"use strict";function r(t,e,r){r=r||0;var o=t.getBoundingClientRect();return{x:e.changedTouches[r].pageX-o.left,y:e.changedTouches[r].pageY-o.top}}var o=e;return o.prototype.touchX=0,o.prototype.touchY=0,o.prototype.ptouchX=0,o.prototype.ptouchY=0,o.prototype.touches=[],o.prototype._updateTouchCoords=function(t){if("mousedown"===t.type||"mousemove"===t.type||"mouseup"===t.type)this._setProperty("touchX",this.mouseX),this._setProperty("touchY",this.mouseY);else{var e=r(this._curElement.elt,t,0);this._setProperty("touchX",e.x),this._setProperty("touchY",e.y);for(var o=[],n=0;n<t.changedTouches.length;n++){var i=r(this._curElement.elt,t,n);o[n]={x:i.x,y:i.y}}this._setProperty("touches",o)}},o.prototype._updatePTouchCoords=function(){this._setProperty("ptouchX",this.touchX),this._setProperty("ptouchY",this.touchY)},o.prototype.ontouchstart=function(t){var e,r=this._isGlobal?window:this;this._updateTouchCoords(t),"function"==typeof r.touchStarted?(e=r.touchStarted(t),e===!1&&t.preventDefault()):"function"==typeof r.mousePressed&&(e=r.mousePressed(t),e===!1&&t.preventDefault())},o.prototype.ontouchmove=function(t){var e,r=this._isGlobal?window:this;this._updateTouchCoords(t),"function"==typeof r.touchMoved?(e=r.touchMoved(t),e===!1&&t.preventDefault()):"function"==typeof r.mouseDragged&&(e=r.mouseDragged(t),e===!1&&t.preventDefault(),this._updateMouseCoords(t))},o.prototype.ontouchend=function(t){this._updateTouchCoords(t);var e,r=this._isGlobal?window:this;"function"==typeof r.touchEnded?(e=r.touchEnded(t),e===!1&&t.preventDefault()):"function"==typeof r.mouseReleased&&(e=r.mouseReleased(t),e===!1&&t.preventDefault(),this._updateMouseCoords(t))},o}({},core),mathmath=function(t,e){"use strict";var r=e;return r.prototype.createVector=function(){return new r.Vector(this,arguments)},r}({},core),mathcalculation=function(t,e){"use strict";var r=e;return r.prototype.abs=Math.abs,r.prototype.ceil=Math.ceil,r.prototype.constrain=function(t,e,r){return Math.max(Math.min(t,r),e)},r.prototype.dist=function(t,e,r,o){return Math.sqrt((r-t)*(r-t)+(o-e)*(o-e))},r.prototype.exp=Math.exp,r.prototype.floor=Math.floor,r.prototype.lerp=function(t,e,r){return r*(e-t)+t},r.prototype.log=Math.log,r.prototype.mag=function(t,e){return Math.sqrt(t*t+e*e)},r.prototype.map=function(t,e,r,o,n){return(t-e)/(r-e)*(n-o)+o},r.prototype.max=function(){return arguments[0]instanceof Array?Math.max.apply(null,arguments[0]):Math.max.apply(null,arguments)},r.prototype.min=function(){return arguments[0]instanceof Array?Math.min.apply(null,arguments[0]):Math.min.apply(null,arguments)},r.prototype.norm=function(t,e,r){return this.map(t,e,r,0,1)},r.prototype.pow=Math.pow,r.prototype.round=Math.round,r.prototype.sq=function(t){return t*t},r.prototype.sqrt=Math.sqrt,r}({},core),mathrandom=function(t,e){"use strict";var r=e,o=!1,n=function(){var t,e,r=4294967296,o=1664525,n=1013904223;return{setSeed:function(o){e=t=o||Math.round(Math.random()*r)},getSeed:function(){return t},rand:function(){return e=(o*e+n)%r,e/r}}}();r.prototype.randomSeed=function(t){n.setSeed(t),o=!0},r.prototype.random=function(t,e){var r;if(r=o?n.rand():Math.random(),0===arguments.length)return r;if(1===arguments.length)return r*t;if(t>e){var i=t;t=e,e=i}return r*(e-t)+t};var i,s=!1;return r.prototype.randomGaussian=function(t,e){var r,o,n,a;if(s)r=i,s=!1;else{do o=this.random(2)-1,n=this.random(2)-1,a=o*o+n*n;while(a>=1);a=Math.sqrt(-2*Math.log(a)/a),r=o*a,i=n*a,s=!0}var h=t||0,p=e||1;return r*p+h},r}({},core),mathnoise=function(t,e){"use strict";for(var r=e,o=4,n=1<<o,i=8,s=1<<i,a=4095,h=4,p=.5,u=.5,l=Math.floor(360/u),c=new Array(l),d=new Array(l),f=Math.PI/180,g=0;l>g;g++)c[g]=Math.sin(g*f*u),d[g]=Math.cos(g*f*u);var y=l;y>>=1;var m;return r.prototype.noise=function(t,e,r){if(e=e||0,r=r||0,null==m){m=new Array(a+1);for(var u=0;a+1>u;u++)m[u]=Math.random()}0>t&&(t=-t),0>e&&(e=-e),0>r&&(r=-r);for(var c,f,g,w,v,_=Math.floor(t),x=Math.floor(e),C=Math.floor(r),b=t-_,S=e-x,R=r-C,T=0,E=.5,M=function(t){return.5*(1-d[Math.floor(t*y)%l])},P=0;h>P;P++){var A=_+(x<<o)+(C<<i);c=M(b),f=M(S),g=m[A&a],g+=c*(m[A+1&a]-g),w=m[A+n&a],w+=c*(m[A+n+1&a]-w),g+=f*(w-g),A+=s,w=m[A&a],w+=c*(m[A+1&a]-w),v=m[A+n&a],v+=c*(m[A+n+1&a]-v),w+=f*(v-w),g+=M(R)*(w-g),T+=g*E,E*=p,_<<=1,b*=2,x<<=1,S*=2,C<<=1,R*=2,b>=1&&(_++,b--),S>=1&&(x++,S--),R>=1&&(C++,R--)}return T},r.prototype.noiseDetail=function(t,e){t>0&&(h=t),e>0&&(p=e)},r.prototype.noiseSeed=function(t){var e=function(){var t,e,r=4294967296,o=1664525,n=1013904223;return{setSeed:function(o){e=t=o||Math.round(Math.random()*r)},getSeed:function(){return t},rand:function(){return e=(o*e+n)%r,e/r}}}();e.setSeed(t),m=new Array(a+1);for(var r=0;a+1>r;r++)m[r]=e.rand()},r}({},core),mathtrigonometry=function(t,e,r,o){"use strict";var n=e,i=r,o=o;return n.prototype._angleMode=o.RADIANS,n.prototype.acos=function(t){return this._angleMode===o.RADIANS?Math.acos(t):i.radiansToDegrees(Math.acos(t))},n.prototype.asin=function(t){return this._angleMode===o.RADIANS?Math.asin(t):i.radiansToDegrees(Math.asin(t))},n.prototype.atan=function(t){return this._angleMode===o.RADIANS?Math.atan(t):i.radiansToDegrees(Math.atan(t))},n.prototype.atan2=function(t,e){return this._angleMode===o.RADIANS?Math.atan2(t,e):i.radiansToDegrees(Math.atan2(t,e))},n.prototype.cos=function(t){return Math.cos(this._angleMode===o.RADIANS?t:this.radians(t))},n.prototype.sin=function(t){return Math.sin(this._angleMode===o.RADIANS?t:this.radians(t))},n.prototype.tan=function(t){return Math.tan(this._angleMode===o.RADIANS?t:this.radians(t))},n.prototype.degrees=function(t){return i.radiansToDegrees(t)},n.prototype.radians=function(t){return i.degreesToRadians(t)},n.prototype.angleMode=function(t){(t===o.DEGREES||t===o.RADIANS)&&(this._angleMode=t)},n}({},core,polargeometry,constants),outputfiles=function(t,e){"use strict";function r(t,e){e||(e=""),t||(t="untitled");var r="";return t&&t.indexOf(".")>-1&&(r=t.split(".").pop()),e&&r!==e&&(r=e,t=t+"."+r),[t,r]}function o(t){document.body.removeChild(t.target)}var n=e;return window.URL=window.URL||window.webkitURL,n.prototype._pWriters=[],n.prototype.beginRaw=function(){throw"not yet implemented"},n.prototype.beginRecord=function(){throw"not yet implemented"},n.prototype.createOutput=function(){throw"not yet implemented"},n.prototype.createWriter=function(t,e){var r;for(var o in n.prototype._pWriters)if(n.prototype._pWriters[o].name===t)return r=new n.PrintWriter(t+window.millis(),e),n.prototype._pWriters.push(r),r;return r=new n.PrintWriter(t,e),n.prototype._pWriters.push(r),r},n.prototype.endRaw=function(){throw"not yet implemented"},n.prototype.endRecord=function(){throw"not yet implemented"},n.prototype.escape=function(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},n.PrintWriter=function(t,e){var r=this;this.name=t,this.content="",this.print=function(t){this.content+=t},this.println=function(t){this.content+=t+"\n"},this.flush=function(){this.content=""},this.close=function(){var o=[];o.push(this.content),n.prototype.writeFile(o,t,e);for(var i in n.prototype._pWriters)n.prototype._pWriters[i].name===this.name&&n.prototype._pWriters.splice(i,1);r.flush(),r={}}},n.prototype.saveBytes=function(){throw"not yet implemented"},n.prototype.save=function(){var t=arguments,e=this._curElement.elt;if(0===t.length)return void n.prototype.saveCanvas(e);if(t[0]instanceof n.Graphics)return void n.prototype.saveCanvas(t[0].elt,t[1],t[2]);if("string"==typeof t[0])n.prototype.saveCanvas(e,t[0]);else{var o=r(t[1],t[2])[1];switch(o){case"json":n.prototype.saveJSON(t[0],t[1],t[2]);break;case"txt":n.prototype.saveStrings(t[0],t[1],t[2]);break;default:t[0]instanceof Array?n.prototype.saveStrings(t[0],t[1],t[2]):t[0]instanceof n.Table?n.prototype.saveTable(t[0],t[1],t[2],t[3]):t[0]instanceof n.Image?n.prototype.saveCanvas(t[0].canvas,t[1]):t[0]instanceof n.SoundFile?n.prototype.saveSound(t[0],t[1],t[2],t[3]):t[0]instanceof Object&&n.prototype.saveJSON(t[0],t[1],t[2]) }}},n.prototype.saveJSON=function(t,e,r){var o;o=r?JSON.stringify(t):JSON.stringify(t,void 0,2),this.saveStrings(o.split("\n"),e,"json")},n.prototype.saveJSONObject=n.prototype.saveJSON,n.prototype.saveJSONArray=n.prototype.saveJSON,n.prototype.saveStream=function(){throw"not yet implemented"},n.prototype.saveStrings=function(t,e,r){var o=r||"txt",n=this.createWriter(e,o);for(var i in t)i<t.length-1?n.println(t[i]):n.print(t[i]);n.close(),n.flush()},n.prototype.saveXML=function(){throw"not yet implemented"},n.prototype.selectOutput=function(){throw"not yet implemented"},n.prototype.saveTable=function(t,e,r){var o=this.createWriter(e,r),i=t.columns,s=",";if("tsv"===r&&(s=" "),"html"!==r){if("0"!==i[0])for(var a=0;a<i.length;a++)a<i.length-1?o.print(i[a]+s):o.println(i[a]);for(var h=0;h<t.rows.length;h++){var p;for(p=0;p<t.rows[h].arr.length;p++)p<t.rows[h].arr.length-1?o.print(t.rows[h].arr[p]+s):h<t.rows.length-1?o.println(t.rows[h].arr[p]):o.print(t.rows[h].arr[p])}}else{o.println("<html>"),o.println("<head>");var u=' <meta http-equiv="content-type" content';if(u+='="text/html;charset=utf-8" />',o.println(u),o.println("</head>"),o.println("<body>"),o.println(" <table>"),"0"!==i[0]){o.println(" <tr>");for(var l=0;l<i.length;l++){var c=n.prototype.escape(i[l]);o.println(" <td>"+c),o.println(" </td>")}o.println(" </tr>")}for(var d=0;d<t.rows.length;d++){o.println(" <tr>");for(var f=0;f<t.columns.length;f++){var g=t.rows[d].getString(f),y=n.prototype.escape(g);o.println(" <td>"+y),o.println(" </td>")}o.println(" </tr>")}o.println(" </table>"),o.println("</body>"),o.print("</html>")}o.close(),o.flush()},n.prototype.writeFile=function(t,e,r){var o="application/octet-stream";n.prototype._isSafari()&&(o="text/plain");var i=new Blob(t,{type:o}),s=window.URL.createObjectURL(i);n.prototype.downloadFile(s,e,r)},n.prototype.downloadFile=function(t,e,i){var s=r(e,i),a=s[0],h=s[1],p=document.createElement("a");if(p.href=t,p.download=a,p.onclick=o,p.style.display="none",document.body.appendChild(p),n.prototype._isSafari()){var u="Hello, Safari user! To download this file...\n";u+="1. Go to File --> Save As.\n",u+='2. Choose "Page Source" as the Format.\n',u+='3. Name it with this extension: ."'+h+'"',alert(u)}p.click(),t=null},n.prototype._checkFileExtension=r,n.prototype._isSafari=function(){var t=Object.prototype.toString.call(window.HTMLElement);return t.indexOf("Constructor")>0},n}({},core),outputimage=function(t,e){"use strict";var r=e,o=[];return r.prototype.saveCanvas=function(t,e,o){o||(o=r.prototype._checkFileExtension(e,o)[1],""===o&&(o="png"));var n;if(t?n=t:this._curElement&&this._curElement.elt&&(n=this._curElement.elt),r.prototype._isSafari()){var i="Hello, Safari user!\n";i+="Now capturing a screenshot...\n",i+="To save this image,\n",i+="go to File --> Save As.\n",alert(i),window.location.href=n.toDataURL()}else{var s;if("undefined"==typeof o)o="png",s="image/png";else switch(o){case"png":s="image/png";break;case"jpeg":s="image/jpeg";break;case"jpg":s="image/jpeg";break;default:s="image/png"}var a="image/octet-stream",h=n.toDataURL(s);h=h.replace(s,a),r.prototype.downloadFile(h,e,o)}},r.prototype.saveFrames=function(t,e,n,i,s){var a=n||3;a=r.prototype.constrain(a,0,15),a=1e3*a;var h=i||15;h=r.prototype.constrain(h,0,22);var p=0,u=r.prototype._makeFrame,l=this._curElement.elt,c=setInterval(function(){u(t+p,e,l),p++},1e3/h);setTimeout(function(){if(clearInterval(c),s)s(o);else for(var t=0;t<o.length;t++){var e=o[t];r.prototype.downloadFile(e.imageData,e.filename,e.ext)}o=[]},a+.01)},r.prototype._makeFrame=function(t,e,r){var n;n=this?this._curElement.elt:r;var i;if(e)switch(e.toLowerCase()){case"png":i="image/png";break;case"jpeg":i="image/jpeg";break;case"jpg":i="image/jpeg";break;default:i="image/png"}else e="png",i="image/png";var s="image/octet-stream",a=n.toDataURL(i);a=a.replace(i,s);var h={};h.imageData=a,h.filename=t,h.ext=e,o.push(h)},r}({},core),outputtext_area=function(t,e){"use strict";var r=e;return r.prototype.print=window.console&&console.log?console.log.bind(console):function(){},r.prototype.println=r.prototype.print,r}({},core),renderingrendering=function(t,e,r){var o=e,r=r;return o.prototype.createCanvas=function(t,e,r){var n;return r?(n=document.createElement("canvas"),n.id="defaultCanvas"):n=this.canvas,this._setupDone||(n.className+=" p5_hidden",n.style.visibility="hidden"),this._userNode?this._userNode.appendChild(n):document.body.appendChild(n),this._defaultGraphics||(this._defaultGraphics=new o.Graphics(n,this,!0),this._elements.push(this._defaultGraphics)),this._defaultGraphics.resize(t,e),this._defaultGraphics._applyDefaults(),this._defaultGraphics},o.prototype.resizeCanvas=function(t,e){this._defaultGraphics&&(this._defaultGraphics.resize(t,e),this._defaultGraphics._applyDefaults(),this.redraw())},o.prototype.noCanvas=function(){this.canvas&&this.canvas.parentNode.removeChild(this.canvas)},o.prototype.createGraphics=function(t,e){var r=document.createElement("canvas"),n=this._userNode||document.body;n.appendChild(r);var i=new o.Graphics(r,this,!1);this._elements.push(i);for(var s in o.prototype)i.hasOwnProperty(s)||(i[s]="function"==typeof o.prototype[s]?o.prototype[s].bind(i):o.prototype[s]);return i.resize(t,e),i._applyDefaults(),i},o.prototype.blendMode=function(t){if(t!==r.BLEND&&t!==r.DARKEST&&t!==r.LIGHTEST&&t!==r.DIFFERENCE&&t!==r.MULTIPLY&&t!==r.EXCLUSION&&t!==r.SCREEN&&t!==r.REPLACE&&t!==r.OVERLAY&&t!==r.HARD_LIGHT&&t!==r.SOFT_LIGHT&&t!==r.DODGE&&t!==r.BURN&&t!==r.ADD&&t!==r.NORMAL)throw new Error("Mode "+t+" not recognized.");this.drawingContext.globalCompositeOperation=t},o}({},core,constants),shape2d_primitives=function(t,e,r,o){"use strict";var n=e,r=r,o=o;return n.prototype.arc=function(t,e,n,i,s,a,h){if(this._doStroke||this._doFill){this._angleMode===o.DEGREES&&(s=this.radians(s),a=this.radians(a));var p=this.drawingContext,u=r.arcModeAdjust(t,e,n,i,this._ellipseMode),l=u.h>u.w?u.h/2:u.w/2,c=u.h>u.w?u.w/u.h:1,d=u.h>u.w?1:u.h/u.w;return p.save(),p.scale(c,d),p.beginPath(),p.arc(u.x,u.y,l,s,a),this._doStroke&&p.stroke(),h===o.CHORD||h===o.OPEN?p.closePath():(h===o.PIE||void 0===h)&&(p.lineTo(u.x,u.y),p.closePath()),this._doFill&&p.fill(),this._doStroke&&h!==o.OPEN&&void 0!==h&&p.stroke(),p.restore(),this}},n.prototype.ellipse=function(t,e,o,n){if(this._doStroke||this._doFill){o=Math.abs(o),n=Math.abs(n);var i=this.drawingContext,s=r.modeAdjust(t,e,o,n,this._ellipseMode);if(i.beginPath(),o===n)i.arc(s.x+s.w/2,s.y+s.w/2,s.w/2,0,2*Math.PI,!1);else{var a=.5522848,h=s.w/2*a,p=s.h/2*a,u=s.x+s.w,l=s.y+s.h,c=s.x+s.w/2,d=s.y+s.h/2;i.moveTo(s.x,d),i.bezierCurveTo(s.x,d-p,c-h,s.y,c,s.y),i.bezierCurveTo(c+h,s.y,u,d-p,u,d),i.bezierCurveTo(u,d+p,c+h,l,c,l),i.bezierCurveTo(c-h,l,s.x,d+p,s.x,d),i.closePath()}return this._doFill&&i.fill(),this._doStroke&&i.stroke(),this}},n.prototype.line=function(t,e,r,o){if(this._doStroke){var n=this.drawingContext;if("rgba(0,0,0,0)"!==n.strokeStyle)return n.beginPath(),n.moveTo(t,e),n.lineTo(r,o),n.stroke(),this}},n.prototype.point=function(t,e){if(this._doStroke){var r=this.drawingContext,n=r.strokeStyle,i=r.fillStyle;if("rgba(0,0,0,0)"!==n)return t=Math.round(t),e=Math.round(e),r.fillStyle=n,r.lineWidth>1?(r.beginPath(),r.arc(t,e,r.lineWidth/2,0,o.TWO_PI,!1),r.fill()):r.fillRect(t,e,1,1),r.fillStyle=i,this}},n.prototype.quad=function(t,e,r,o,n,i,s,a){if(this._doStroke||this._doFill){var h=this.drawingContext;return h.beginPath(),h.moveTo(t,e),h.lineTo(r,o),h.lineTo(n,i),h.lineTo(s,a),h.closePath(),this._doFill&&h.fill(),this._doStroke&&h.stroke(),this}},n.prototype.rect=function(t,e,o,n){if(this._doStroke||this._doFill){var i=r.modeAdjust(t,e,o,n,this._rectMode),s=this.drawingContext;return this._doStroke&&s.lineWidth%2===1&&s.translate(.5,.5),s.beginPath(),s.rect(i.x,i.y,i.w,i.h),this._doFill&&s.fill(),this._doStroke&&s.stroke(),this._doStroke&&s.lineWidth%2===1&&s.translate(-.5,-.5),this}},n.prototype.triangle=function(t,e,r,o,n,i){if(this._doStroke||this._doFill){var s=this.drawingContext;return s.beginPath(),s.moveTo(t,e),s.lineTo(r,o),s.lineTo(n,i),s.closePath(),this._doFill&&s.fill(),this._doStroke&&s.stroke(),this}},n}({},core,canvas,constants),shapeattributes=function(t,e,r){"use strict";var o=e,r=r;return o.prototype._rectMode=r.CORNER,o.prototype._ellipseMode=r.CENTER,o.prototype.ellipseMode=function(t){return(t===r.CORNER||t===r.CORNERS||t===r.RADIUS||t===r.CENTER)&&(this._ellipseMode=t),this},o.prototype.noSmooth=function(){return this.drawingContext.mozImageSmoothingEnabled=!1,this.drawingContext.webkitImageSmoothingEnabled=!1,this},o.prototype.rectMode=function(t){return(t===r.CORNER||t===r.CORNERS||t===r.RADIUS||t===r.CENTER)&&(this._rectMode=t),this},o.prototype.smooth=function(){return this.drawingContext.mozImageSmoothingEnabled=!0,this.drawingContext.webkitImageSmoothingEnabled=!0,this},o.prototype.strokeCap=function(t){return(t===r.ROUND||t===r.SQUARE||t===r.PROJECT)&&(this.drawingContext.lineCap=t),this},o.prototype.strokeJoin=function(t){return(t===r.ROUND||t===r.BEVEL||t===r.MITER)&&(this.drawingContext.lineJoin=t),this},o.prototype.strokeWeight=function(t){return this.drawingContext.lineWidth="undefined"==typeof t||0===t?1e-4:t,this},o}({},core,constants),shapecurves=function(t,e){"use strict";var r=e,o=20,n=20;return r.prototype._curveTightness=0,r.prototype.bezier=function(t,e,r,o,n,i,s,a){return this._doStroke?(this.beginShape(),this.vertex(t,e),this.bezierVertex(r,o,n,i,s,a),this.endShape(),this.stroke(),this):void 0},r.prototype.bezierDetail=function(t){return o=t,this},r.prototype.bezierPoint=function(t,e,r,o,n){var i=1-n;return Math.pow(i,3)*t+3*Math.pow(i,2)*n*e+3*i*Math.pow(n,2)*r+Math.pow(n,3)*o},r.prototype.bezierTangent=function(t,e,r,o,n){var i=1-n;return 3*o*Math.pow(n,2)-3*r*Math.pow(n,2)+6*r*i*n-6*e*i*n+3*e*Math.pow(i,2)-3*t*Math.pow(i,2)},r.prototype.curve=function(t,e,r,o,n,i,s,a){return this._doStroke?(this.beginShape(),this.curveVertex(t,e),this.curveVertex(r,o),this.curveVertex(n,i),this.curveVertex(s,a),this.endShape(),this.stroke(),this):void 0},r.prototype.curveDetail=function(t){return n=t,this},r.prototype.curveTightness=function(t){this._setProperty("_curveTightness",t)},r.prototype.curvePoint=function(t,e,r,o,n){var i=n*n*n,s=n*n,a=-.5*i+s-.5*n,h=1.5*i-2.5*s+1,p=-1.5*i+2*s+.5*n,u=.5*i-.5*s;return t*a+e*h+r*p+o*u},r.prototype.curveTangent=function(t,e,r,o,n){var i=n*n,s=-3*i/2+2*n-.5,a=9*i/2-5*n,h=-9*i/2+4*n+.5,p=3*i/2-n;return t*s+e*a+r*h+o*p},r.prototype.curveTightness=function(){throw"not yet implemented"},r}({},core),shapevertex=function(t,e,r){"use strict";var o=e,r=r,n=null,i=[],s=[],a=!1,h=!1,p=!1,u=!1;return o.prototype._doFillStrokeClose=function(){this._doFill&&this.drawingContext.fill(),this._doStroke&&this.drawingContext.stroke(),this.drawingContext.closePath()},o.prototype.beginContour=function(){return s=[],u=!0,this},o.prototype.beginShape=function(t){return n=t===r.POINTS||t===r.LINES||t===r.TRIANGLES||t===r.TRIANGLE_FAN||t===r.TRIANGLE_STRIP||t===r.QUADS||t===r.QUAD_STRIP?t:null,i=[],s=[],this},o.prototype.bezierVertex=function(){if(0===i.length)throw"vertex() must be used once before calling bezierVertex()";a=!0;for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.isVert=!1,u?s.push(t):i.push(t),this},o.prototype.curveVertex=function(t,e){return h=!0,this.vertex(t,e),this},o.prototype.endContour=function(){var t=s[0].slice();t.isVert=s[0].isVert,t.moveTo=!1,s.push(t),i.push(i[0]);for(var e=0;e<s.length;e++)i.push(s[e]);return this},o.prototype.endShape=function(t){if(0===i.length)return this;if(!this._doStroke&&!this._doFill)return this;var e,o=t===r.CLOSE;o&&!u&&i.push(i[0]);var s,l,c=i.length;if(!h||n!==r.POLYGON&&null!==n)if(!a||n!==r.POLYGON&&null!==n)if(!p||n!==r.POLYGON&&null!==n)if(n===r.POINTS)for(s=0;c>s;s++)e=i[s],this._doStroke&&this.stroke(e[6]),this.point(e[0],e[1]);else if(n===r.LINES)for(s=0;c>s+1;s+=2)e=i[s],this._doStroke&&this.stroke(i[s+1][6]),this.line(e[0],e[1],i[s+1][0],i[s+1][1]);else if(n===r.TRIANGLES)for(s=0;c>s+2;s+=3)e=i[s],this.drawingContext.beginPath(),this.drawingContext.moveTo(e[0],e[1]),this.drawingContext.lineTo(i[s+1][0],i[s+1][1]),this.drawingContext.lineTo(i[s+2][0],i[s+2][1]),this.drawingContext.lineTo(e[0],e[1]),this._doFill&&(this.fill(i[s+2][5]),this.drawingContext.fill()),this._doStroke&&(this.stroke(i[s+2][6]),this.drawingContext.stroke()),this.drawingContext.closePath();else if(n===r.TRIANGLE_STRIP)for(s=0;c>s+1;s++)e=i[s],this.drawingContext.beginPath(),this.drawingContext.moveTo(i[s+1][0],i[s+1][1]),this.drawingContext.lineTo(e[0],e[1]),this._doStroke&&this.stroke(i[s+1][6]),this._doFill&&this.fill(i[s+1][5]),c>s+2&&(this.drawingContext.lineTo(i[s+2][0],i[s+2][1]),this._doStroke&&this.stroke(i[s+2][6]),this._doFill&&this.fill(i[s+2][5])),this._doFillStrokeClose();else if(n===r.TRIANGLE_FAN){if(c>2)for(this.drawingContext.beginPath(),this.drawingContext.moveTo(i[0][0],i[0][1]),this.drawingContext.lineTo(i[1][0],i[1][1]),this.drawingContext.lineTo(i[2][0],i[2][1]),this._doFill&&this.fill(i[2][5]),this._doStroke&&this.stroke(i[2][6]),this._doFillStrokeClose(),s=3;c>s;s++)e=i[s],this.drawingContext.beginPath(),this.drawingContext.moveTo(i[0][0],i[0][1]),this.drawingContext.lineTo(i[s-1][0],i[s-1][1]),this.drawingContext.lineTo(e[0],e[1]),this._doFill&&this.fill(e[5]),this._doStroke&&this.stroke(e[6]),this._doFillStrokeClose()}else if(n===r.QUADS)for(s=0;c>s+3;s+=4){for(e=i[s],this.drawingContext.beginPath(),this.drawingContext.moveTo(e[0],e[1]),l=1;4>l;l++)this.drawingContext.lineTo(i[s+l][0],i[s+l][1]);this.drawingContext.lineTo(e[0],e[1]),this._doFill&&this.fill(i[s+3][5]),this._doStroke&&this.stroke(i[s+3][6]),this._doFillStrokeClose()}else if(n===r.QUAD_STRIP){if(c>3)for(s=0;c>s+1;s+=2)e=i[s],this.drawingContext.beginPath(),c>s+3?(this.drawingContext.moveTo(i[s+2][0],i[s+2][1]),this.drawingContext.lineTo(e[0],e[1]),this.drawingContext.lineTo(i[s+1][0],i[s+1][1]),this.drawingContext.lineTo(i[s+3][0],i[s+3][1]),this._doFill&&this.fill(i[s+3][5]),this._doStroke&&this.stroke(i[s+3][6])):(this.drawingContext.moveTo(e[0],e[1]),this.drawingContext.lineTo(i[s+1][0],i[s+1][1])),this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),this.drawingContext.moveTo(i[0][0],i[0][1]),s=1;c>s;s++)e=i[s],e.isVert&&(e.moveTo?this.drawingContext.moveTo(e[0],e[1]):this.drawingContext.lineTo(e[0],e[1]));this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),s=0;c>s;s++)i[s].isVert?i[s].moveTo?this.drawingContext.moveTo([0],i[s][1]):this.drawingContext.lineTo(i[s][0],i[s][1]):this.drawingContext.quadraticCurveTo(i[s][0],i[s][1],i[s][2],i[s][3]);this._doFillStrokeClose()}else{for(this.drawingContext.beginPath(),s=0;c>s;s++)i[s].isVert?i[s].moveTo?this.drawingContext.moveTo(i[s][0],i[s][1]):this.drawingContext.lineTo(i[s][0],i[s][1]):this.drawingContext.bezierCurveTo(i[s][0],i[s][1],i[s][2],i[s][3],i[s][4],i[s][5]);this._doFillStrokeClose()}else if(c>3){var d=[],f=1-this._curveTightness;for(this.drawingContext.beginPath(),this.drawingContext.moveTo(i[1][0],i[1][1]),s=1;c>s+2;s++)e=i[s],d[0]=[e[0],e[1]],d[1]=[e[0]+(f*i[s+1][0]-f*i[s-1][0])/6,e[1]+(f*i[s+1][1]-f*i[s-1][1])/6],d[2]=[i[s+1][0]+(f*i[s][0]-f*i[s+2][0])/6,i[s+1][1]+(f*i[s][1]-f*i[s+2][1])/6],d[3]=[i[s+1][0],i[s+1][1]],this.drawingContext.bezierCurveTo(d[1][0],d[1][1],d[2][0],d[2][1],d[3][0],d[3][1]);this._doFillStrokeClose()}return h=!1,a=!1,p=!1,u=!1,o&&i.pop(),this},o.prototype.quadraticVertex=function(t,e,o,n){if(this._contourInited){var a={};return a.x=t,a.y=e,a.x3=o,a.y3=n,a.type=r.QUADRATIC,this._contourVertices.push(a),this}if(!(i.length>0))throw"vertex() must be used once before calling quadraticVertex()";p=!0;for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];return h.isVert=!1,u?s.push(h):i.push(h),this},o.prototype.vertex=function(t,e,r){var o=[];return o.isVert=!0,o[0]=t,o[1]=e,o[2]=0,o[3]=0,o[4]=0,o[5]=this.drawingContext.fillStyle,o[6]=this.drawingContext.strokeStyle,r&&(o.moveTo=r),u?(0===s.length&&(o.moveTo=!0),s.push(o)):i.push(o),this},o}({},core,constants),structure=function(t,e){"use strict";var r=e;return r.prototype.exit=function(){throw"exit() not implemented, see remove()"},r.prototype.noLoop=function(){this._loop=!1,this._drawInterval&&clearInterval(this._drawInterval)},r.prototype.loop=function(){this._loop=!0,this._draw()},r.prototype.push=function(){this.drawingContext.save(),this._styles.push({doStroke:this._doStroke,doFill:this._doFill,tint:this._tint,imageMode:this._imageMode,rectMode:this._rectMode,ellipseMode:this._ellipseMode,colorMode:this._colorMode,textFont:this.textFont,textLeading:this.textLeading,textSize:this.textSize,textStyle:this.textStyle})},r.prototype.pop=function(){this.drawingContext.restore();var t=this._styles.pop();this._doStroke=t.doStroke,this._doFill=t.doFill,this._tint=t.tint,this._imageMode=t.imageMode,this._rectMode=t.rectMode,this._ellipseMode=t.ellipseMode,this._colorMode=t.colorMode,this.textFont=t.textFont,this.textLeading=t.textLeading,this.textSize=t.textSize,this.textStyle=t.textStyle},r.prototype.pushStyle=function(){throw new Error("pushStyle() not used, see push()")},r.prototype.popStyle=function(){throw new Error("popStyle() not used, see pop()")},r.prototype.redraw=function(){var t=this._isGlobal?window:this;t.draw&&t.draw()},r.prototype.size=function(){throw"size() not implemented, see createCanvas()"},r}({},core),transform=function(t,e,r){"use strict";var o=e,r=r;return o.prototype.applyMatrix=function(t,e,r,o,n,i){return this.drawingContext.transform(t,e,r,o,n,i),this},o.prototype.popMatrix=function(){throw new Error("popMatrix() not used, see pop()")},o.prototype.printMatrix=function(){throw new Error("printMatrix() not implemented")},o.prototype.pushMatrix=function(){throw new Error("pushMatrix() not used, see push()")},o.prototype.resetMatrix=function(){return this.drawingContext.setTransform(),this},o.prototype.rotate=function(t){return this._angleMode===r.DEGREES&&(t=this.radians(t)),this.drawingContext.rotate(t),this},o.prototype.rotateX=function(){throw"not yet implemented"},o.prototype.rotateY=function(){throw"not yet implemented"},o.prototype.scale=function(){var t=1,e=1;return 1===arguments.length?t=e=arguments[0]:(t=arguments[0],e=arguments[1]),this.drawingContext.scale(t,e),this},o.prototype.shearX=function(t){return this._angleMode===r.DEGREES&&(t=this.radians(t)),this.drawingContext.transform(1,0,this.tan(t),1,0,0),this},o.prototype.shearY=function(t){return this._angleMode===r.DEGREES&&(t=this.radians(t)),this.drawingContext.transform(1,this.tan(t),0,1,0,0),this},o.prototype.translate=function(t,e){return this.drawingContext.translate(t,e),this},o}({},core,constants,outputtext_area),typographyattributes=function(t,e,r){"use strict";var o=e,r=r;return o.prototype._textLeading=15,o.prototype._textFont="sans-serif",o.prototype._textSize=12,o.prototype._textStyle=r.NORMAL,o.prototype._textAscent=null,o.prototype._textDescent=null,o.prototype.textAlign=function(t){(t===r.LEFT||t===r.RIGHT||t===r.CENTER)&&(this.drawingContext.textAlign=t)},o.prototype.textLeading=function(t){this._setProperty("_textLeading",t)},o.prototype.textSize=function(t){this._setProperty("_textSize",t),this._applyTextProperties()},o.prototype.textStyle=function(t){(t===r.NORMAL||t===r.ITALIC||t===r.BOLD)&&(this._setProperty("_textStyle",t),this._applyTextProperties())},o.prototype.textWidth=function(t){return this.drawingContext.measureText(t).width},o.prototype.textAscent=function(){return null==this._textAscent&&this._updateTextMetrics(),this._textAscent},o.prototype.textDescent=function(){return null==this._textDescent&&this._updateTextMetrics(),this._textDescent},o.prototype._applyTextProperties=function(){this._setProperty("_textAscent",null),this._setProperty("_textDescent",null);var t=this._textStyle+" "+this._textSize+"px "+this._textFont;this.drawingContext.font=t},o.prototype._updateTextMetrics=function(){var t=document.createElement("span");t.style.fontFamily=this._textFont,t.style.fontSize=this._textSize+"px",t.innerHTML="ABCjgq|";var e=document.createElement("div");e.style.display="inline-block",e.style.width="1px",e.style.height="0px";var r=document.createElement("div");r.appendChild(t),r.appendChild(e),r.style.height="0px",r.style.overflow="hidden",document.body.appendChild(r),e.style.verticalAlign="baseline";var o=this._calculateOffset(e),n=this._calculateOffset(t),i=o[1]-n[1];e.style.verticalAlign="bottom",o=this._calculateOffset(e),n=this._calculateOffset(t);var s=o[1]-n[1],a=s-i;document.body.removeChild(r),this._setProperty("_textAscent",i),this._setProperty("_textDescent",a)},o.prototype._calculateOffset=function(t){var e=0,r=0;if(t.offsetParent){do e+=t.offsetLeft,r+=t.offsetTop;while(t=t.offsetParent)}else e+=t.offsetLeft,r+=t.offsetTop;return[e,r]},o}({},core,constants),typographyloading_displaying=function(t,e){"use strict";var r=e;return r.prototype.text=function(t,e,r,o,n){"undefined"!=typeof o&&(r+=this._textLeading,n+=r),t=t.replace(/(\t)/g," ");for(var i=t.split("\n"),s=0;s<i.length;s++){for(var a="",h=i[s].split(" "),p=0;p<h.length;p++)if(r+this._textLeading<=n||"undefined"==typeof n){var u=a+h[p]+" ",l=this.drawingContext.measureText(u),c=l.width;"undefined"!=typeof o&&c>o?(this._doFill&&this.drawingContext.fillText(a,e,r),this._doStroke&&this.drawingContext.strokeText(a,e,r),a=h[p]+" ",r+=this._textLeading):a=u}this._doFill&&this.drawingContext.fillText(a,e,r),this._doStroke&&this.drawingContext.strokeText(a,e,r),r+=this._textLeading}},r.prototype.textFont=function(t){this._setProperty("_textFont",t),this._applyTextProperties()},r}({},core),src_app=function(t,e){"use strict";var r=e,o=function(){window.PHANTOMJS||(window.setup&&"function"==typeof window.setup||window.draw&&"function"==typeof window.draw)&&new r};return"complete"===document.readyState?o():window.addEventListener("load",o,!1),window.p5=r,r}({},core,p5Color,p5Element,p5Graphics,p5Image,p5Vector,p5TableRow,p5Table,colorcreating_reading,colorsetting,constants,dataconversion,dataarray_functions,datastring_functions,environment,imageimage,imageloading_displaying,imagepixels,inputfiles,inputkeyboard,inputmouse,inputtime_date,inputtouch,mathmath,mathcalculation,mathrandom,mathnoise,mathtrigonometry,outputfiles,outputimage,outputtext_area,renderingrendering,shape2d_primitives,shapeattributes,shapecurves,shapevertex,structure,transform,typographyattributes,typographyloading_displaying);
/* * Kendo UI v2014.3.1411 (http://www.telerik.com/kendo-ui) * Copyright 2015 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ !function(e,define){define([],e)}(function(){return function(e){var t=e.kendo||(e.kendo={cultures:{}});t.cultures["km-KH"]={name:"km-KH",numberFormat:{pattern:["- n"],decimals:2,",":",",".":".",groupSize:[3,0],percent:{pattern:["-n%","n%"],decimals:2,",":",",".":".",groupSize:[3,0],symbol:"%"},currency:{pattern:["-n$","n$"],decimals:2,",":",",".":".",groupSize:[3],symbol:"៛"}},calendars:{standard:{days:{names:["ថ្ងៃអាទិត្យ","ថ្ងៃច័ន្ទ","ថ្ងៃអង្គារ","ថ្ងៃពុធ","ថ្ងៃព្រហស្បតិ៍","ថ្ងៃសុក្រ","ថ្ងៃសៅរ៍"],namesAbbr:["អាទិ.","ច.","អ.","ពុ","ព្រហ.","សុ.","ស."],namesShort:["អា","ច","អ","ពុ","ព្","សុ","ស"]},months:{names:["មករា","កុម្ភៈ","មិនា","មេសា","ឧសភា","មិថុនា","កក្កដា","សីហា","កញ្ញា","តុលា","វិច្ឆិកា","ធ្នូ",""],namesAbbr:["១","២","៣","៤","៥","៦","៧","៨","៩","១០","១១","១២",""]},AM:["ព្រឹក","ព្រឹក","ព្រឹក"],PM:["ល្ងាច","ល្ងាច","ល្ងាច"],patterns:{d:"yyyy-MM-dd",D:"d MMMM yyyy",F:"d MMMM yyyy HH:mm:ss",g:"yyyy-MM-dd H:mm tt",G:"yyyy-MM-dd HH:mm:ss",m:"'ថ្ងៃទី' dd 'ខែ' MM",M:"'ថ្ងៃទី' dd 'ខែ' MM",s:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",t:"H:mm tt",T:"HH:mm:ss",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"'ខែ' MM 'ឆ្នាំ' yyyy",Y:"'ខែ' MM 'ឆ្នាំ' yyyy"},"/":"-",":":":",firstDay:0}}}}(this),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});
/*! UIkit 2.19.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ !function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-accordion",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(i){var a=t.$(i),o="auto";if(a.is(":visible"))o=a.outerHeight();else{var e={position:a.css("position"),visibility:a.css("visibility"),display:a.css("display")};o=a.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),a.css(e)}return o}return t.component("accordion",{defaults:{showfirst:!0,collapse:!0,animate:!0,easing:"swing",duration:300,toggle:".uk-accordion-title",containers:".uk-accordion-content",clsactive:"uk-active"},boot:function(){t.ready(function(i){setTimeout(function(){t.$("[data-uk-accordion]",i).each(function(){var i=t.$(this);i.data("accordion")||t.accordion(i,t.Utils.options(i.attr("data-uk-accordion")))})},0)})},init:function(){var i=this;this.element.on("click.uikit.accordion",this.options.toggle,function(a){a.preventDefault(),i.toggleItem(t.$(this).data("wrapper"),i.options.animate,i.options.collapse)}),this.update(),this.options.showfirst&&this.toggleItem(this.toggle.eq(0).data("wrapper"),!1,!1)},toggleItem:function(a,o,e){var n=this;a.data("toggle").toggleClass(this.options.clsactive);var s=a.data("toggle").hasClass(this.options.clsactive);e&&(this.toggle.not(a.data("toggle")).removeClass(this.options.clsactive),this.content.not(a.data("content")).parent().stop().animate({height:0},{easing:this.options.easing,duration:o?this.options.duration:0}).attr("aria-expanded","false")),o?a.stop().animate({height:s?i(a.data("content")):0},{easing:this.options.easing,duration:this.options.duration,complete:function(){s&&(t.Utils.checkDisplay(a.data("content")),a.height("auto")),n.trigger("display.uk.check")}}):(a.stop().height(s?"auto":0),s&&t.Utils.checkDisplay(a.data("content")),this.trigger("display.uk.check")),a.attr("aria-expanded",s),this.element.trigger("toggle.uk.accordion",[s,a.data("toggle"),a.data("content")])},update:function(){var i,a,o,e=this;this.toggle=this.find(this.options.toggle),this.content=this.find(this.options.containers),this.content.each(function(n){i=t.$(this),i.parent().data("wrapper")?a=i.parent():(a=t.$(this).wrap('<div data-wrapper="true" style="overflow:hidden;height:0;position:relative;"></div>').parent(),a.attr("aria-expanded","false")),o=e.toggle.eq(n),a.data("toggle",o),a.data("content",i),o.data("wrapper",a),i.data("wrapper",a)}),this.element.trigger("update.uk.accordion",[this])}}),t.accordion});
$(document).on("ready", inicio); function inicio(){ mostrarDatos(""); $("#buscar").keyup(function(){ $buscar = $("#buscar").val(); mostrarDatos(buscar); }); } function mostrarDatos(valor){ $.ajax( { url:"http://localhost/mail/Welcome/mostrar", type: "POST", data: {buscar: valor}, success: function(respuesta){ alert(respuesta); } }); }
import React, { Component } from 'react' import PropTypes from 'prop-types' import metadata from 'libphonenumber-js/metadata.min.json' import labels from '../locale/default.json' import internationalIcon from './InternationalIcon' import { metadata as metadataPropType, labels as labelsPropType } from './PropTypes' import PhoneInput from './PhoneInputNative' export default class PhoneInputNativeDefaultMetadata extends Component { static propTypes = { metadata : metadataPropType.isRequired, labels : labelsPropType.isRequired, internationalIcon : PropTypes.func.isRequired } static defaultProps = { metadata, labels, internationalIcon } storeInputRef = (ref) => this.input = ref render = () => <PhoneInput ref={this.storeInputRef} {...this.props}/> focus = () => this.input.focus() }
// *********************************************** // This example commands.js shows you how to // create various custom commands and overwrite // existing commands. // // For more comprehensive examples of custom // commands please read more here: // https://on.cypress.io/custom-commands // *********************************************** // // // -- This is a parent command -- // Cypress.Commands.add('login', (email, password) => { ... }) // // // -- This is a child command -- // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) // // // -- This is a dual command -- // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) // // // -- This will overwrite an existing command -- const faker = require("faker"); // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) Cypress.Commands.add("createAccount", (username, password) => { cy.visit("/create-account") .dget("username") .type(username) .dget("password") .type(password) .dget("submit") .click(); }); Cypress.Commands.add("dget", (selector) => { cy.get(`[data-test="${selector}"]`); }); Cypress.Commands.add("login", (username, password) => { cy.visit("/login") .dget("username") .type(username) .dget("password") .type(password) .dget("submit") .click(); }); Cypress.Commands.add( "createTask", ({ title = faker.lorem.sentence(), description = faker.lorem.sentences(3), priority = "B", }) => { cy.dget("add-task") .click() .dget("title") .type(title) .dget("description") .type(description) .dget("priority") .select(priority) .dget("submit") .click(); } );
/*! * angularjs-color-picker v1.0.1 * https://github.com/ruhley/angular-color-picker/ * * Copyright 2016 ruhley * * 2016-02-11 09:43:17 * */ "undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="color.picker"),function(){"use strict";angular.module("color.picker",[])}(),function(){"use strict";var a=function(a){return{restrict:"E",require:["^ngModel"],scope:{ngModel:"=",colorPickerAlpha:"=",colorPickerCase:"=",colorPickerFormat:"=",colorPickerPos:"=",colorPickerSwatch:"=",colorPickerSwatchOnly:"=",colorPickerSwatchPos:"=",colorPickerSwatchBootstrap:"=",colorPickerOnChange:"&"},templateUrl:"template/color-picker/directive.html",link:function(b,c,d,e){b.onChangeValue=null,b.init=function(){ // if no color provided if(void 0===b.ngModel)b.hue=0,b.saturation=0,b.lightness=100;else{var c=tinycolor(b.ngModel);if(c.isValid()){var d=c.toHsv();b.hue=d.h,b.saturation=100*d.s,b.lightness=100*d.v,b.opacity=100*d.a}} // set default config settings b.initConfig(), // setup mouse events a.on("mousedown",b.onMouseDown),a.on("mouseup",b.onMouseUp),a.on("mousemove",b.onMouseMove),b.find(".color-picker-grid").on("click",b.onColorClick),b.find(".color-picker-hue").on("click",b.onHueClick),b.find(".color-picker-opacity").on("click",b.onOpacityClick)},b.onMouseDown=function(a){ // an element in this picker b.find(a.target).length>0&&( // mouse event on color grid a.target.classList.contains("color-picker-grid-inner")||a.target.classList.contains("color-picker-picker")||a.target.parentNode.classList.contains("color-picker-picker")?(b.colorDown(a),b.$apply()):a.target.classList.contains("color-picker-hue")||a.target.parentNode.classList.contains("color-picker-hue")?(b.hueDown(a),b.$apply()):(a.target.classList.contains("color-picker-opacity")||a.target.parentNode.classList.contains("color-picker-opacity"))&&(b.opacityDown(a),b.$apply()))},b.onMouseUp=function(a){ // no current mouse events and not an element in the picker b.colorMouse||b.hueMouse||b.opacityMouse||0!==b.find(a.target).length?b.colorMouse?(b.colorUp(a),b.$apply(),b.onChange(a)):b.hueMouse?(b.hueUp(a),b.$apply(),b.onChange(a)):b.opacityMouse&&(b.opacityUp(a),b.$apply(),b.onChange(a)):(b.log("Color Picker: Document Click Event"),b.hide())},b.onMouseMove=function(a){ // mouse event on color grid b.colorMouse?(b.colorChange(a),b.$apply()):b.hueMouse?(b.hueChange(a),b.$apply()):b.opacityMouse&&(b.opacityChange(a),b.$apply())},b.onColorClick=function(a){b.colorChange(a),b.$apply(),b.onChange(a)},b.onHueClick=function(a){b.hueChange(a),b.$apply(),b.onChange(a)},b.onOpacityClick=function(a){b.opacityChange(a),b.$apply(),b.onChange(a)},b.onChange=function(a){b.ngModel!==b.onChangeValue&&(b.onChangeValue=b.ngModel,b.colorPickerOnChange({$event:a,color:b.ngModel}))},b.initConfig=function(){b.config={},b.config.alpha=void 0===b.colorPickerAlpha?!0:b.colorPickerAlpha,b.config.case=void 0===b.colorPickerCase?"upper":b.colorPickerCase,b.config.format=void 0===b.colorPickerFormat?"hsl":b.colorPickerFormat,b.config.pos=void 0===b.colorPickerPos?"bottom left":b.colorPickerPos,b.config.swatch=void 0===b.colorPickerSwatch?!0:b.colorPickerSwatch,b.config.swatchOnly=void 0===b.colorPickerSwatchOnly?!1:b.colorPickerSwatchOnly,b.config.swatchPos=void 0===b.colorPickerSwatchPos?"left":b.colorPickerSwatchPos,b.config.swatchBootstrap=void 0===b.colorPickerSwatchBootstrap?!0:b.colorPickerSwatchBootstrap,b.log("Color Picker: Config",b.config)},b.focus=function(){b.log("Color Picker: Focus Event"),b.find(".color-picker-input")[0].focus()},b.show=function(){b.log("Color Picker: Show Event"),b.visible=!0,b.hueMouse=!1,b.opacityMouse=!1,b.colorMouse=!1, // force the grid selection circle to redraw and fix its position b.saturationUpdate(),b.lightnessUpdate()},b.hide=function(){(b.visible||null!==c[0].querySelector(".color-picker-panel").offsetParent)&&(b.log("Color Picker: Hide Event"),b.visible=!1,b.$apply())},b.update=function(){if(void 0!==b.hue&&void 0!==b.saturation&&void 0!==b.lightness){var a,c=tinycolor({h:b.hue,s:b.saturation/100,v:b.lightness/100});switch(b.config.alpha&&c.setAlpha(b.opacity/100),b.log("Color Picker: COLOR CHANGED TO ",c,b.hue,b.saturation,b.lightness,b.opacity),b.swatchColor=c.toHslString(),b.config.format){case"rgb":a=c.toRgbString();break;case"hex":a=c.toHexString(),a="lower"===b.config.case?a.toLowerCase():a.toUpperCase();break;case"hex8":a=c.toHex8String(),a="lower"===b.config.case?a.toLowerCase():a.toUpperCase();break;case"hsv":a=c.toHsvString();break;default:a=c.toHslString()}b.ngModel=a}},b.$watch("ngModel",function(a,c){if(void 0!==a&&null!==a&&a!==c&&a.length>4){b.log("Color Picker: MODEL - CHANGED",a);var f=tinycolor(a);if(f.isValid()){var g=f.toHsv();b.hue=g.h,b.saturation=100*g.s,b.lightness=100*g.v,b.config.alpha&&(b.opacity=100*g.a),b.isValid=!0}else b.isValid=!1;e[0].$setValidity(d.name,b.isValid),void 0!==c&&"function"==typeof e[0].$setDirty&&e[0].$setDirty()}else b.swatchColor=""}),b.$watch("colorPickerFormat",function(a,c){void 0!==a&&a!==c&&("hex"===a&&(b.colorPickerAlpha=!1),b.initConfig(),b.update())}),b.$watchGroup(["colorPickerAlpha","colorPickerCase"],function(a,c){void 0!==a&&(b.initConfig(),b.update())}),b.$watchGroup(["colorPickerSwatchPos","colorPickerSwatchBootstrap","colorPickerSwatchOnly","colorPickerSwatch","colorPickerPos"],function(a,c){void 0!==a&&b.initConfig()}), //--------------------------- // Update Positions And Colors On Elements //--------------------------- b.$watch("swatchColor",function(a){var b=angular.element(c[0].querySelector(".color-picker-swatch"));b.css({"background-color":a})}),b.$watch("huePos",function(a){var b=angular.element(c[0].querySelector(".color-picker-hue .color-picker-slider"));b.css({top:a+"%"})}),b.$watch("opacityPos",function(a){var b=angular.element(c[0].querySelector(".color-picker-opacity .color-picker-slider"));b.css({top:a+"%"})}),b.$watch("lightnessPos",function(a){var b=angular.element(c[0].querySelector(".color-picker-grid .color-picker-picker"));b.css({top:a+"%"})}),b.$watch("saturationPos",function(a){var b=angular.element(c[0].querySelector(".color-picker-grid .color-picker-picker"));b.css({left:a+"%"})}),b.$watch("grid",function(a){var b=angular.element(c[0].querySelector(".color-picker-grid"));b.css({"background-color":a})}), //--------------------------- // HUE //--------------------------- b.hueDown=function(a){a.stopPropagation(),a.preventDefault(),b.log("Color Picker: HUE - MOUSE DOWN"),b.hueMouse=!0},b.hueUp=function(a){a.stopPropagation(),a.preventDefault(),b.log("Color Picker: HUE - MOUSE UP"),b.hueMouse=!1},b.hueChange=function(a){a.stopPropagation(),a.preventDefault(),b.log("Color Picker: HUE - MOUSE CHANGE");var c=b.find(".color-picker-hue");b.hue=360*(1-(a.pageY-b.offset(c).top)/c.prop("offsetHeight")),b.hue>360?b.hue=360:b.hue<0&&(b.hue=0)},b.hueUpdate=function(){void 0!==b.hue&&(b.log("Color Picker: HUE - CHANGED"),b.huePos=100*(1-b.hue/360),b.grid=tinycolor({h:b.hue,s:100,v:1}).toHslString(),b.huePos<0?b.huePos=0:b.huePos>100&&(b.huePos=100),b.update())},b.$watch("hue",function(a,c){b.hueUpdate()}), //--------------------------- // OPACITY //--------------------------- b.opacityDown=function(a){a.stopPropagation(),a.preventDefault(),b.log("Color Picker: OPACITY - MOUSE DOWN"),b.opacityMouse=!0},b.opacityUp=function(a){a.stopPropagation(),a.preventDefault(),b.log("Color Picker: OPACITY - MOUSE UP"),b.opacityMouse=!1},b.opacityChange=function(a){a.stopPropagation(),a.preventDefault(),b.log("Color Picker: OPACITY - MOUSE CHANGE");var c=b.find(".color-picker-opacity");b.opacity=100*(1-(a.pageY-b.offset(c).top)/c.prop("offsetHeight")),b.opacity>100?b.opacity=100:b.opacity<0&&(b.opacity=0)},b.opacityUpdate=function(){void 0!==b.opacity&&(b.log("Color Picker: OPACITY - CHANGED"),b.opacityPos=100*(1-b.opacity/100),b.opacityPos<0?b.opacityPos=0:b.opacityPos>100&&(b.opacityPos=100),b.update())},b.$watch("opacity",function(a,c){b.opacityUpdate()}), //--------------------------- // COLOR //--------------------------- b.colorDown=function(a){a.stopPropagation(),a.preventDefault(),b.log("Color Picker: COLOR - MOUSE DOWN"),b.colorMouse=!0},b.colorUp=function(a){a.stopPropagation(),a.preventDefault(),b.log("Color Picker: COLOR - MOUSE UP"),b.colorMouse=!1},b.colorChange=function(a){a.stopPropagation(),a.preventDefault(),b.log("Color Picker: COLOR - MOUSE CHANGE");var c=b.find(".color-picker-grid-inner"),d=b.offset(c);b.saturation=(a.pageX-d.left)/c.prop("offsetWidth")*100,b.lightness=100*(1-(a.pageY-d.top)/c.prop("offsetHeight")),b.saturation>100?b.saturation=100:b.saturation<0&&(b.saturation=0),b.lightness>100?b.lightness=100:b.lightness<0&&(b.lightness=0)},b.saturationUpdate=function(a){void 0!==b.saturation&&b.saturation!==a&&(b.log("Color Picker: SATURATION - CHANGED"),b.saturationPos=b.saturation/100*100,b.saturationPos<0?b.saturationPos=0:b.saturationPos>100&&(b.saturationPos=100),b.update())},b.$watch("saturation",function(a,c){b.saturationUpdate(c)}),b.lightnessUpdate=function(a){void 0!==b.lightness&&b.lightness!==a&&(b.log("Color Picker: LIGHTNESS - CHANGED"),b.lightnessPos=100*(1-b.lightness/100),b.lightnessPos<0?b.lightnessPos=0:b.lightnessPos>100&&(b.lightnessPos=100),b.update())},b.$watch("lightness",function(a,c){b.lightnessUpdate(c)}), //--------------------------- // HELPER FUNCTIONS //--------------------------- b.log=function(){}, // taken and modified from jQuery's find b.find=function(a){var d,e=b.wrapper?b.wrapper[0]:c[0],f=[]; // Same basic safeguard as Sizzle if(!a)return f;if("string"==typeof a){ // Early return if context is not an element or document if(1!==(d=e.nodeType)&&9!==d)return[];f=e.querySelectorAll(a)}else e.contains(a)&&f.push(a);return angular.element(f)}, // taken and modified from jQuery's offset b.offset=function(a){var b,c,d,e,f=a[0];if(f) // Support: IE<=11+ // Running getBoundingClientRect on a // disconnected node in IE throws an error // Support: IE<=11+ // Running getBoundingClientRect on a // disconnected node in IE throws an error // Make sure element is not hidden (display: none) // hack for small chrome screens not position the clicks properly when the page is scrolled return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=null!==e&&e===e.window?e:9===e.nodeType&&e.defaultView,b=e.documentElement,window.chrome&&screen.width<=768?{top:d.top-b.clientTop,left:d.left-b.clientLeft}:{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},b.init(),b.$on("$destroy",function(){a.off("mousedown",b.onMouseDown),a.off("mouseup",b.onMouseUp),a.off("mousemove",b.onMouseMove)})}}};a.$inject=["$document"],angular.module("color.picker").directive("colorPicker",a)}(),angular.module("color.picker").run(["$templateCache",function(a){a.put("template/color-picker/directive.html",'<div class="color-picker-wrapper" ng-class="{\'color-picker-swatch-only\': config.swatchOnly}">\n <div class="color-picker-input-wrapper" ng-class="{\'input-group\': config.swatchBootstrap && config.swatch}">\n <span ng-if="config.swatchPos === \'left\'" class="color-picker-swatch" ng-click="focus()" ng-show="config.swatch" ng-class="{\'color-picker-swatch-left\': config.swatchPos !== \'right\', \'color-picker-swatch-right\': config.swatchPos === \'right\', \'input-group-addon\': config.swatchBootstrap}"></span>\n <input class="color-picker-input form-control" type="text" ng-model="ngModel" ng-change="onChange($event)" size="7" ng-focus="show()" ng-class="{\'color-picker-input-swatch\': config.swatch && !config.swatchOnly && config.swatchPos === \'left\'}">\n <span ng-if="config.swatchPos === \'right\'" class="color-picker-swatch" ng-click="focus()" ng-show="config.swatch" ng-class="{\'color-picker-swatch-left\': config.swatchPos !== \'right\', \'color-picker-swatch-right\': config.swatchPos === \'right\', \'input-group-addon\': config.swatchBootstrap}"></span>\n </div>\n <div class="color-picker-panel" ng-show="visible" ng-class="{\n \'color-picker-panel-top color-picker-panel-right\': config.pos === \'top right\',\n \'color-picker-panel-top color-picker-panel-left\': config.pos === \'top left\',\n \'color-picker-panel-bottom color-picker-panel-right\': config.pos === \'bottom right\',\n \'color-picker-panel-bottom color-picker-panel-left\': config.pos === \'bottom left\',\n }">\n <div class="color-picker-hue color-picker-sprite">\n <div class="color-picker-slider"></div>\n </div>\n <div class="color-picker-opacity color-picker-sprite" ng-show="config.alpha">\n <div class="color-picker-slider"></div>\n </div>\n <div class="color-picker-grid color-picker-sprite">\n <div class="color-picker-grid-inner"></div>\n <div class="color-picker-picker">\n <div></div>\n </div>\n </div>\n </div>\n</div>')}]);
var Config = require('../config'); var knex = require('knex')(Config.database); module.exports = require('bookshelf')(knex);
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const lodash_1 = require("lodash"); const currencies_1 = require("./lib/currencies"); exports.Currencies = currencies_1.Currencies; let isInt = function (n) { return Number(n) === n && n % 1 === 0; }; let decimalPlaces = function (num) { let match = ('' + num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/); if (!match) return 0; return Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0)); }; let assertSameCurrency = function (left, right) { if (left.currency !== right.currency) throw new Error('Different currencies'); }; let assertType = function (other) { if (!(other instanceof Money)) throw new TypeError('Instance of Money required'); }; let assertOperand = function (operand) { if (lodash_1.isNaN(parseFloat(operand)) && !isFinite(operand)) throw new TypeError('Operand must be a number'); }; let getCurrencyObject = function (currency) { let currencyObj = currencies_1.Currencies[currency]; if (currencyObj) { return currencyObj; } else { for (let key in currencies_1.Currencies) { if (key.toUpperCase() === currency.toUpperCase()) return currencies_1.Currencies[key]; } } }; class Money { /** * Creates a new Money instance. * The created Money instances is a value object thus it is immutable. * * @param {Number} amount * @param {Object/String} currency * @returns {Money} * @constructor */ constructor(amount, currency) { if (lodash_1.isString(currency)) currency = getCurrencyObject(currency); if (!lodash_1.isPlainObject(currency)) throw new TypeError('Invalid currency'); if (!isInt(amount)) throw new TypeError('Amount must be an integer'); this.amount = amount; this.currency = currency.code; Object.freeze(this); } static fromInteger(amount, currency) { if (lodash_1.isObject(amount)) { if (amount.amount === undefined || amount.currency === undefined) throw new TypeError('Missing required parameters amount,currency'); currency = amount.currency; amount = amount.amount; } if (!isInt(amount)) throw new TypeError('Amount must be an integer value'); return new Money(amount, currency); } static fromDecimal(amount, currency, rounder) { if (lodash_1.isObject(amount)) { if (amount.amount === undefined || amount.currency === undefined) throw new TypeError('Missing required parameters amount,currency'); rounder = currency; currency = amount.currency; amount = amount.amount; } if (lodash_1.isString(currency)) currency = getCurrencyObject(currency); if (!lodash_1.isPlainObject(currency)) throw new TypeError('Invalid currency'); if (rounder === undefined) { let decimals = decimalPlaces(amount); if (decimals > currency.decimal_digits) throw new Error(`The currency ${currency.code} supports only` + ` ${currency.decimal_digits} decimal digits`); rounder = Math.round; } else { if (['round', 'floor', 'ceil'].indexOf(rounder) === -1 && typeof rounder !== 'function') throw new TypeError('Invalid parameter rounder'); if (lodash_1.isString(rounder)) rounder = Math[rounder]; } let precisionMultiplier = Math.pow(10, currency.decimal_digits); let resultAmount = amount * precisionMultiplier; resultAmount = rounder(resultAmount); return new Money(resultAmount, currency); } /** * Returns true if the two instances of Money are equal, false otherwise. * * @param {Money} other * @returns {Boolean} */ equals(other) { let self = this; assertType(other); return self.amount === other.amount && self.currency === other.currency; } /** * Adds the two objects together creating a new Money instance that holds the result of the operation. * * @param {Money} other * @returns {Money} */ add(other) { let self = this; assertType(other); assertSameCurrency(self, other); return new Money(self.amount + other.amount, self.currency); } /** * Subtracts the two objects creating a new Money instance that holds the result of the operation. * * @param {Money} other * @returns {Money} */ subtract(other) { let self = this; assertType(other); assertSameCurrency(self, other); return new Money(self.amount - other.amount, self.currency); } /** * Multiplies the object by the multiplier returning a new Money instance that holds the result of the operation. * * @param {Number} multiplier * @param {Function} [fn=Math.round] * @returns {Money} */ multiply(multiplier, fn) { if (!lodash_1.isFunction(fn)) fn = Math.round; assertOperand(multiplier); let amount = fn(this.amount * multiplier); return new Money(amount, this.currency); } /** * Divides the object by the multiplier returning a new Money instance that holds the result of the operation. * * @param {Number} divisor * @param {Function} [fn=Math.round] * @returns {Money} */ divide(divisor, fn) { if (!lodash_1.isFunction(fn)) fn = Math.round; assertOperand(divisor); let amount = fn(this.amount / divisor); return new Money(amount, this.currency); } /** * Allocates fund bases on the ratios provided returing an array of objects as a product of the allocation. * * @param {Array} other * @returns {Array.Money} */ allocate(ratios) { let self = this; let remainder = self.amount; let results = []; let total = 0; ratios.forEach(function (ratio) { total += ratio; }); ratios.forEach(function (ratio) { let share = Math.floor(self.amount * ratio / total); results.push(new Money(share, self.currency)); remainder -= share; }); for (let i = 0; remainder > 0; i++) { results[i] = new Money(results[i].amount + 1, results[i].currency); remainder--; } return results; } /** * Compares two instances of Money. * * @param {Money} other * @returns {Number} */ compare(other) { let self = this; assertType(other); assertSameCurrency(self, other); if (self.amount === other.amount) return 0; return self.amount > other.amount ? 1 : -1; } /** * Checks whether the value represented by this object is greater than the other. * * @param {Money} other * @returns {boolean} */ greaterThan(other) { return 1 === this.compare(other); } /** * Checks whether the value represented by this object is greater or equal to the other. * * @param {Money} other * @returns {boolean} */ greaterThanOrEqual(other) { return 0 <= this.compare(other); } /** * Checks whether the value represented by this object is less than the other. * * @param {Money} other * @returns {boolean} */ lessThan(other) { return -1 === this.compare(other); } /** * Checks whether the value represented by this object is less than or equal to the other. * * @param {Money} other * @returns {boolean} */ lessThanOrEqual(other) { return 0 >= this.compare(other); } /** * Returns true if the amount is zero. * * @returns {boolean} */ isZero() { return this.amount === 0; } /** * Returns true if the amount is positive. * * @returns {boolean} */ isPositive() { return this.amount > 0; } /** * Returns true if the amount is negative. * * @returns {boolean} */ isNegative() { return this.amount < 0; } /** * Returns the decimal value as a float. * * @returns {number} */ toDecimal() { return Number(this.toString()); } /** * Returns the decimal value as a string. * * @returns {string} */ toString() { let currency = getCurrencyObject(this.currency); return (this.amount / Math.pow(10, currency.decimal_digits)).toFixed(currency.decimal_digits); } /** * Returns a serialised version of the instance. * * @returns {{amount: number, currency: string}} */ toJSON() { return { amount: this.amount, currency: this.currency }; } /** * Returns the amount represented by this object. * * @returns {number} */ getAmount() { return this.amount; } /** * Returns the currency represented by this object. * * @returns {string} */ getCurrency() { return this.currency; } /** * Returns the full currency object */ getCurrencyInfo() { return getCurrencyObject(this.currency); } } exports.Money = Money; Object.assign(Money, currencies_1.Currencies);
$(document).ready(function(){ // $('#search-button').click(function(){ // name = $('#search').val(); // brendId = $('#brend').val(); // categoryId = $('#category').val(); // group = $('#group').val(); // $.get( // "/admin/search-product", // { // name: name, // categoryId: categoryId, // brendId: brendId, // group: group // }, // onAjaxSuccess // ); // function onAjaxSuccess(data) // { // products = JSON.parse(data); // var html =''; // var token = $('#token').val(); // products.forEach(function(item, i, arr) { // html += '<tr>' + // '<td><a href="/admin/product-update/' + item.id + '">'+ item.name + '</a></td>'; // html += '<td>'; // if(item.active) { // html += '<img src="/site/images/active.jpg">'; // } else { // html += '<img src="/site/images/no-active.jpg">'; // } // html += '</td>'; // html += '<td>'; // if(item.active_wholesale) { // html += '<img src="/site/images/active.jpg">'; // } else { // html += '<img src="/site/images/no-active.jpg">'; // } // html += '</td>'; // html += '<td>'; // if(item.description) { // html += '<img src="/site/images/active.jpg">'; // } else { // html += '<img src="/site/images/no-active.jpg">'; // } // html += '</td>'; // if(item.category) { // html += '<td>' + item.category +'</td>'; // } else { // html += '<td></td>'; // } // html += '<td>'; // if(item.hasImage) { // html += '<img src="/site/images/active.jpg">'; // } else { // html += '<img src="/site/images/no-active.jpg">'; // } // html += '</td>'; // html += '<td><a href="/admin/product-search/' + item.id + '">Поиск</a></td>'; // html += '<td><a href="/admin/with-product/' + item.id + '">Берут</a></td>' + // '<td>' + // '<form action="/admin/product-delete" method="POST" onsubmit="return confirm("Вы точно хотите удалить товар?")">' + // '<input type="hidden" name="_token" value="' + token + '">' + // '<input type="hidden" name="product_id" value="' + item.id + '">' + // '<button type="submit" class="btn btn-block btn-danger btn-flat">Удалить</button>' + // '</form>' + // '</td>' + // '</tr>'; // }); // $('#productList').html(html); // $('#paginator').hide(); // } // }); $('#changeCategory').change(function(){ id = this.value; $.get("/admin/category-subcats", { id: id}, function(data){ subcats = JSON.parse(data); $('#subcats').html('<ul>'); subcats.forEach(function(item, i, arr) { $('#subcats').append('<li> <input type="checkbox" value="'+ item.id +'" name="subcats[]">' + item.name + '</li>'); }); $('#subcats').append('</ul>'); }); $.get('/admin/category-attributes', { id : id }, function(data){ attributes = JSON.parse(data); $('#attributes').html(''); attributes.forEach(function(item, i, arr) { $('#attributes').append('<input class="form-control" placeholder="'+ item.name +'" name="attributes['+ item.id +']">'); }); }); }); $('#add-image').click(function(){ $('#images-inputs-list').append('<input type="file" name="images[]">'); }); function showInfoBlock() { $.get('/ajax/new-events', function(data){ show = 0; if(data[0] != 0 || data[1] != 0) { $('.info-block').find('.info-block-string a').first().text('Новые заказы: ' + data[1]); $('.info-block').find('.info-block-string a').eq(1).text('Новые обратные звонки: ' + data[0]); $('.info-block').show(); } }); } setInterval(showInfoBlock, 60000); $('.admin-product-images').mouseover(function(){ deleteButton = $(this).children('img').prev(); deleteButton.show(); }); $('.image-delete').click(function(){ id = $(this).parent().attr('id'); token = $("input[name='_token']" ).val(); parent = $(this).parent(); $.post('/admin/delete-image', { _token : token, id : id }, function(data){ if(data == 1) { parent.hide(); } else { alert('Ошибка при удалении картинки'); } }); }); $('.admin-product-images').mouseout(function(){ $(this).children('img').prev().hide(); }); $('#add-product-form').validate({ rules: { name: { required: true, }, article: { required: true }, price: { required: true, digits: true, }, url: { required: true, }, description : { required: true } }, messages: { name: { required: "Вы не указали название товара", }, article: { required: "Вы не указали артикул товара" }, price: { required: "Вы не указали цену товара", digits: "Цена должна быть числом" }, url: { required: "Вы не указали url товара", }, description: { required: "Вы не указали описание товара" } }, }); $("#product_price").keydown(function(event) { // Разрешаем: backspace, delete, tab и escape if ( event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || // Разрешаем: Ctrl+A (event.keyCode == 65 && event.ctrlKey === true) || // Разрешаем: home, end, влево, вправо (event.keyCode >= 35 && event.keyCode <= 39)) { // Ничего не делаем return; } else { // Убеждаемся, что это цифра, и останавливаем событие keypress if ((event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105 )) { event.preventDefault(); } } }); $( "#product_name" ).keyup(function() { val = $(this).val(); val=val.replace(new RegExp(" ",'g'),'-'); $("#product_url").val(transliterate(val)); }); $( "#category_name" ).keyup(function() { val = $(this).val(); val=val.replace(new RegExp(" ",'g'),'-'); $("#category_url").val(transliterate(val)); }); $('#subcategory_name').keyup(function(){ val = $(this).val(); val=val.replace(new RegExp(" ",'g'),'-'); $("#subcategory_url").val(transliterate(val)); }); $( "#name" ).keyup(function() { val = $(this).val(); val=val.replace(new RegExp(" ",'g'),'-'); $("#url").val(transliterate(val)); }); $('.show-attribute-name').click(function(){ name = $(this).html(); $('#attr_name').val(name); $('input[name=attribute_id]').val($(this).data('attrid')); $('.change-attr').show(); }); $('#info-close').click(function(){ $('.info-block').hide(); }); $('.close-attr').click(function(){ $('.change-attr').hide(); }); $('.change-subcat').click(function(){ subcatid = $(this).data('subcatid'); $('input[name=subcategory_id]').val($(this).data('subcatid')); $.get('/admin/ajax-subcategory-by-id-and-catlist', { subcatid: subcatid }, function(data){ $('#subcat-name').val(data.name); option = $('select[name=category_id] option[value="' + data.category_id + '"]'); option.attr('selected','selected'); $('.change-attr').show(); }); }); $('.refresh').click(function(){ location.reload(); }); //Если с английского на русский, то передаём вторым параметром true. transliterate = ( function() { var rus = "щ ш ч ц ю я ё ж ъ ы э а б в г д е з и й к л м н о п р с т у ф х ь /".split(/ +/g), eng = "shh sh ch cz yu ya yo zh b y e a b v g d e z i j k l m n o p r s t u f x b -".split(/ +/g) ; return function(text, engToRus) { var x; for(x = 0; x < rus.length; x++) { text = text.split(engToRus ? eng[x] : rus[x]).join(engToRus ? rus[x] : eng[x]); text = text.split(engToRus ? eng[x].toUpperCase() : rus[x].toUpperCase()).join(engToRus ? rus[x].toUpperCase() : eng[x].toUpperCase()); } return text; } } )(); });
const _ = require('lodash'); const { singular } = require('pluralize'); /* global StrapiConfigs */ module.exports = async ({ ORM, loadedModel, definition, connection, model, }) => { const { hasTimestamps } = loadedModel; let [createAtCol, updatedAtCol] = ['created_at', 'updated_at']; if (Array.isArray(hasTimestamps)) { [createAtCol, updatedAtCol] = hasTimestamps; } // Equilize database tables const createOrUpdateTable = async (table, attributes) => { const tableExists = await ORM.knex.schema.hasTable(table); const generateIndexes = async table => { try { const connection = strapi.config.connections[definition.connection]; let columns = Object.keys(attributes).filter(attribute => ['string', 'text'].includes(attributes[attribute].type) ); if (!columns.length) { // No text columns founds, exit from creating Fulltext Index return; } switch (connection.settings.client) { case 'mysql': columns = columns.map(attribute => `\`${attribute}\``).join(','); // Create fulltext indexes for every column. await ORM.knex.raw( `CREATE FULLTEXT INDEX SEARCH_${_.toUpper( _.snakeCase(table) )} ON \`${table}\` (${columns})` ); break; case 'pg': { // Enable extension to allow GIN indexes. await ORM.knex.raw('CREATE EXTENSION IF NOT EXISTS pg_trgm'); // Create GIN indexes for every column. const indexes = columns.map(column => { const indexName = `${_.snakeCase(table)}_${column}`; const attribute = _.toLower(column) === column ? column : `"${column}"`; return ORM.knex.raw( `CREATE INDEX IF NOT EXISTS search_${_.toLower( indexName )} ON "${table}" USING gin(${attribute} gin_trgm_ops)` ); }); await Promise.all(indexes); break; } } } catch (e) { // Handle duplicate errors. if (e.errno !== 1061 && e.code !== '42P07') { if (_.get(connection, 'options.debug') === true) { console.log(e); } strapi.log.warn( `The SQL database indexes haven't been generated successfully. Please enable the debug mode for more details.` ); } } }; const buildColumns = (tbl, columns, opts = {}) => { const { tableExists, alter = false } = opts; Object.keys(columns).forEach(key => { const attribute = columns[key]; const type = getType({ definition, attribute, name: key, tableExists, }); if (type) { const col = tbl.specificType(key, type); if (attribute.required === true) { if (definition.client !== 'sqlite3' || !tableExists) { col.notNullable(); } } else { col.nullable(); } if (attribute.unique === true) { if (definition.client !== 'sqlite3' || !tableExists) { tbl.unique(key, uniqueColName(table, key)); } } if (alter) { col.alter(); } } }); }; const createColumns = (tbl, columns, opts = {}) => { return buildColumns(tbl, columns, opts); }; const alterColumns = (tbl, columns, opts = {}) => { return createColumns(tbl, columns, { ...opts, alter: true }); }; const createTable = (table, { trx = ORM.knex, ...opts } = {}) => { return trx.schema.createTable(table, tbl => { tbl.specificType('id', getIdType(definition)); createColumns(tbl, attributes, { ...opts, tableExists: false }); }); }; if (!tableExists) { await createTable(table); await generateIndexes(table); await storeTable(table, attributes); return; } const columns = Object.keys(attributes); // Fetch existing column const columnsExist = await Promise.all( columns.map(attribute => ORM.knex.schema.hasColumn(table, attribute)) ); const columnsToAdd = {}; // Get columns to add columnsExist.forEach((columnExist, index) => { const attribute = attributes[columns[index]]; if (!columnExist) { columnsToAdd[columns[index]] = attribute; } }); // Generate and execute query to add missing column if (Object.keys(columnsToAdd).length > 0) { await ORM.knex.schema.table(table, tbl => { createColumns(tbl, columnsToAdd, { tableExists }); }); } // Generate indexes for new attributes. await generateIndexes(table, columnsToAdd); let previousAttributes; try { previousAttributes = JSON.parse( (await StrapiConfigs.forge({ key: `db_model_${table}`, }).fetch()).toJSON().value ); } catch (err) { await storeTable(table, attributes); previousAttributes = JSON.parse( (await StrapiConfigs.forge({ key: `db_model_${table}`, }).fetch()).toJSON().value ); } if (JSON.stringify(previousAttributes) === JSON.stringify(attributes)) { return; } if (definition.client === 'sqlite3') { const tmpTable = `tmp_${table}`; const rebuildTable = async trx => { await trx.schema.renameTable(table, tmpTable); // drop possible conflicting indexes await Promise.all( columns.map(key => trx.raw('DROP INDEX IF EXISTS ??', uniqueColName(table, key)) ) ); // create the table await createTable(table, { trx }); const attrs = Object.keys(attributes).filter(attribute => getType({ definition, attribute: attributes[attribute], name: attribute, }) ); const allAttrs = ['id', ...attrs]; await trx.raw(`INSERT INTO ?? (${allAttrs.join(', ')}) ??`, [ table, trx.select(allAttrs).from(tmpTable), ]); await trx.schema.dropTableIfExists(tmpTable); }; try { await ORM.knex.transaction(trx => rebuildTable(trx)); await generateIndexes(table); } catch (err) { if (err.message.includes('UNIQUE constraint failed')) { strapi.log.error( `Unique constraint fails, make sure to update your data and restart to apply the unique constraint.\n\t- ${err.stack}` ); } else { strapi.log.error(`Migration failed`); strapi.log.error(err); } return false; } } else { const columnsToAlter = columns.filter( key => JSON.stringify(previousAttributes[key]) !== JSON.stringify(attributes[key]) ); const alterTable = async trx => { await Promise.all( columnsToAlter.map(col => { return ORM.knex.schema .alterTable(table, tbl => { tbl.dropUnique(col, uniqueColName(table, col)); }) .catch(() => {}); }) ); await trx.schema.alterTable(table, tbl => { alterColumns(tbl, _.pick(attributes, columnsToAlter), { tableExists, }); }); }; try { await ORM.knex.transaction(trx => alterTable(trx)); } catch (err) { if (err.code === '23505' && definition.client === 'pg') { strapi.log.error( `Unique constraint fails, make sure to update your data and restart to apply the unique constraint.\n\t- ${err.message}\n\t- ${err.detail}` ); } else if (definition.client === 'mysql' && err.errno === 1062) { strapi.log.error( `Unique constraint fails, make sure to update your data and restart to apply the unique constraint.\n\t- ${err.sqlMessage}` ); } else { strapi.log.error(`Migration failed`); strapi.log.error(err); } return false; } } await storeTable(table, attributes); }; // Add created_at and updated_at field if timestamp option is true if (hasTimestamps) { definition.attributes[createAtCol] = { type: 'timestamp', }; definition.attributes[updatedAtCol] = { type: 'timestampUpdate', }; } // Save all attributes (with timestamps) model.allAttributes = _.clone(definition.attributes); // Equilize tables if (connection.options && connection.options.autoMigration !== false) { await createOrUpdateTable(loadedModel.tableName, definition.attributes); } // Equilize polymorphic releations const morphRelations = definition.associations.filter(association => { return association.nature.toLowerCase().includes('morphto'); }); for (const morphRelation of morphRelations) { const attributes = { [`${loadedModel.tableName}_id`]: { type: definition.primaryKeyType, }, [`${morphRelation.alias}_id`]: { type: definition.primaryKeyType, }, [`${morphRelation.alias}_type`]: { type: 'text', }, [definition.attributes[morphRelation.alias].filter]: { type: 'text', }, }; if (connection.options && connection.options.autoMigration !== false) { await createOrUpdateTable(`${loadedModel.tableName}_morph`, attributes); } } // Equilize many to many releations const manyRelations = definition.associations.filter(({ nature }) => ['manyToMany', 'manyWay'].includes(nature) ); for (const manyRelation of manyRelations) { const { plugin, collection, via, dominant, alias } = manyRelation; if (dominant) { const targetCollection = plugin ? strapi.plugins[plugin].models[collection] : strapi.models[collection]; const targetAttr = via ? targetCollection.attributes[via] : { attribute: singular(definition.collectionName), column: definition.primaryKey, }; const defAttr = definition.attributes[alias]; const attributes = { [`${targetAttr.attribute}_${targetAttr.column}`]: { type: targetCollection.primaryKeyType, }, [`${defAttr.attribute}_${defAttr.column}`]: { type: definition.primaryKeyType, }, }; const table = manyRelation.tableCollectionName; if (connection.options && connection.options.autoMigration !== false) { await createOrUpdateTable(table, attributes); } } } // Remove from attributes (auto handled by bookshlef and not displayed on ctb) if (hasTimestamps) { delete definition.attributes[createAtCol]; delete definition.attributes[updatedAtCol]; } }; const getType = ({ definition, attribute, name, tableExists = false }) => { const { client } = definition; if (!attribute.type) { // Add integer value if there is a relation const relation = definition.associations.find(association => { return association.alias === name; }); switch (relation.nature) { case 'oneToOne': case 'manyToOne': case 'oneWay': return definition.primaryKeyType; default: return null; } } switch (attribute.type) { case 'uuid': return client === 'pg' ? 'uuid' : 'varchar(36)'; case 'richtext': case 'text': return client === 'pg' ? 'text' : 'longtext'; case 'json': return client === 'pg' ? 'jsonb' : 'longtext'; case 'string': case 'enumeration': case 'password': case 'email': return 'varchar(255)'; case 'integer': return client === 'pg' ? 'integer' : 'int'; case 'biginteger': if (client === 'sqlite3') return 'bigint(53)'; // no choice until the sqlite3 package supports returning strings for big integers return 'bigint'; case 'float': return client === 'pg' ? 'double precision' : 'double'; case 'decimal': return 'decimal(10,2)'; // TODO: split time types as they should be different case 'date': case 'time': case 'datetime': if (client === 'pg') { return 'timestamp with time zone'; } return 'timestamp'; case 'timestamp': if (client === 'pg') { return 'timestamp with time zone'; } else if (client === 'sqlite3' && tableExists) { return 'timestamp DEFAULT NULL'; } return 'timestamp DEFAULT CURRENT_TIMESTAMP'; case 'timestampUpdate': switch (client) { case 'pg': return 'timestamp with time zone'; case 'sqlite3': if (tableExists) { return 'timestamp DEFAULT NULL'; } return 'timestamp DEFAULT CURRENT_TIMESTAMP'; default: return 'timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'; } case 'boolean': return 'boolean'; default: } }; const storeTable = async (table, attributes) => { const existTable = await StrapiConfigs.forge({ key: `db_model_${table}`, }).fetch(); if (existTable) { return await StrapiConfigs.forge({ id: existTable.id, }).save({ value: JSON.stringify(attributes), }); } await StrapiConfigs.forge({ key: `db_model_${table}`, type: 'object', value: JSON.stringify(attributes), }).save(); }; const defaultIdType = { mysql: 'INT AUTO_INCREMENT NOT NULL PRIMARY KEY', pg: 'SERIAL NOT NULL PRIMARY KEY', sqlite3: 'INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL', }; const getIdType = definition => { if (definition.primaryKeyType === 'uuid' && definition.client === 'pg') { return 'uuid NOT NULL DEFAULT uuid_generate_v4() NOT NULL PRIMARY KEY'; } if (definition.primaryKeyType !== 'integer') { const type = getType({ definition, attribute: { type: definition.primaryKeyType, }, }); return `${type} NOT NULL PRIMARY KEY`; } return defaultIdType[definition.client]; }; const uniqueColName = (table, key) => `${table}_${key}_unique`;
import {createStore,applyMiddleware} from 'redux'; import reducter from './reducter'; import thunk from 'redux-thunk'; const store = createStore(reducter,applyMiddleware(thunk)); export default store;
import Vue from 'vue'; import './Button.scss'; Vue.component('x-button', { props: { on: { type: [Boolean, Number], default: false, }, label: { type: String, default: '', }, }, methods: { click() { this.$emit('update:on', !this.on); } }, computed: { className() { let cl = ['button__button']; if (this.on) { cl.push('button__button--on'); } else { cl.push('button__button--off'); } return cl; } }, template: ` <div class="button"> <span class="button__name">{{ label }}</span> <button v-bind:class="this.className" v-on:click="this.click"> </button> </div> ` });
const ora = require('ora') const inquirer = require('inquirer') const questions =require('./questions') const judgelang = require('./judgeLang') const { promisify } = require("util"); const download = promisify(require("download-git-repo")); const editPackageJson=require('./editPackage') // init 的所有的逻辑 // 可能还需要用户配置一些数据 来结合渲染我的项目 module.exports = async (projectName) => { // // 1) 获取项目的所有模板 // const spinner = ora('fetching template....') // spinner.start() // let repos = await fetchRepoList() // spinner.succeed() // repos = repos.map(item => item.name) // console.log(repos) // 获取之前 显示loading, 关闭loading // 选择模板 inquirer inquirer .prompt(questions) .then( async(answers) => { // 获取答案 const version = answers.version; const projectName = answers.projectName; const repository = answers.repository||'itlixiaolong/qiankun_config_template'; const author=answers.author const lang=judgelang(answers.lang) console.log('lang',lang); let destination = `${process.cwd()}/${projectName}` //TODO 根据lang进行不同仓库的拉去 const spinner = ora('fetching template....') spinner.start(); spinner.color = 'green'; try { // repository模板地址 destination // clone 是否是克隆 await download(repository, destination) editPackageJson({version,destination,projectName,author,spinner}) } catch (error) { spinner.color = "red"; spinner.text = "下载失败"; spinner.fail(); console.log(error); } }); }
const { article: ArticleModel, tag: TagModel } = require('./models') const initData = () => { // const params = [ // { // title: 'test', // content: '#aa', // category: 'react', // tags: [{ name: 'react' }, { name: 'vue' }] // }, // { // title: 'test2', // content: '#aa2', // category: 'javascript', // tags: [{ name: 'http' }, { name: 'vue' }] // } // ] // params.forEach(async d => { // await ArticleModel.create(d, { include: TagModel }) // }) } module.exports = initData
/* YUI 3.8.0pr2 (build 154) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("dom-create",function(a){var c=/<([a-z]+)/i,d=a.DOM,i=a.Features.add,g=a.Features.test,f={},e=function(m,k){var n=a.config.doc.createElement("div"),l=true;n.innerHTML=m;if(!n.firstChild||n.firstChild.tagName!==k.toUpperCase()){l=false;}return l;},j=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/,b="<table>",h="</table>";a.mix(a.DOM,{_fragClones:{},_create:function(l,m,k){k=k||"div";var n=d._fragClones[k];if(n){n=n.cloneNode(false);}else{n=d._fragClones[k]=m.createElement(k);}n.innerHTML=l;return n;},create:function(p,s){if(typeof p==="string"){p=a.Lang.trim(p);}s=s||a.config.doc;var o=c.exec(p),q=d._create,l=f,r=null,n,t,k;if(p!=undefined){if(o&&o[1]){n=l[o[1].toLowerCase()];if(typeof n==="function"){q=n;}else{t=n;}}k=q(p,s,t).childNodes;if(k.length===1){r=k[0].parentNode.removeChild(k[0]);}else{if(k[0]&&k[0].className==="yui3-big-dummy"){if(k.length===2){r=k[0].nextSibling;}else{k[0].parentNode.removeChild(k[0]);r=d._nl2frag(k,s);}}else{r=d._nl2frag(k,s);}}}return r;},_nl2frag:function(l,o){var m=null,n,k;if(l&&(l.push||l.item)&&l[0]){o=o||l[0].ownerDocument;m=o.createDocumentFragment();if(l.item){l=a.Array(l,0,true);}for(n=0,k=l.length;n<k;n++){m.appendChild(l[n]);}}return m;},addHTML:function(r,q,m){var k=r.parentNode,o=0,p,l=q,n;if(q!=undefined){if(q.nodeType){n=q;}else{if(typeof q=="string"||typeof q=="number"){l=n=d.create(q);}else{if(q[0]&&q[0].nodeType){n=a.config.doc.createDocumentFragment();while((p=q[o++])){n.appendChild(p);}}}}}if(m){if(m.nodeType){m.parentNode.insertBefore(n,m);}else{switch(m){case"replace":while(r.firstChild){r.removeChild(r.firstChild);}if(n){r.appendChild(n);}break;case"before":k.insertBefore(n,r);break;case"after":if(r.nextSibling){k.insertBefore(n,r.nextSibling);}else{k.appendChild(n);}break;default:r.appendChild(n);}}}else{if(n){r.appendChild(n);}}return l;}});i("innerhtml","table",{test:function(){var k=a.config.doc.createElement("table");try{k.innerHTML="<tbody></tbody>";}catch(l){return false;}return(k.firstChild&&k.firstChild.nodeName==="TBODY");}});i("innerhtml-div","tr",{test:function(){return e("<tr></tr>","tr");}});i("innerhtml-div","script",{test:function(){return e("<script><\/script>","script");}});if(!g("innerhtml","table")){f.tbody=function(l,m){var n=d.create(b+l+h,m),k=n.children.tags("tbody")[0];if(n.children.length>1&&k&&!j.test(l)){k.parentNode.removeChild(k);}return n;};}if(!g("innerhtml-div","script")){f.script=function(k,l){var m=l.createElement("div");m.innerHTML="-"+k;m.removeChild(m.firstChild);return m;};f.link=f.style=f.script;}if(!g("innerhtml-div","tr")){a.mix(f,{option:function(k,l){return d.create('<select><option class="yui3-big-dummy" selected></option>'+k+"</select>",l);},tr:function(k,l){return d.create("<tbody>"+k+"</tbody>",l);},td:function(k,l){return d.create("<tr>"+k+"</tr>",l);},col:function(k,l){return d.create("<colgroup>"+k+"</colgroup>",l);},tbody:"table"});a.mix(f,{legend:"fieldset",th:f.td,thead:f.tbody,tfoot:f.tbody,caption:f.tbody,colgroup:f.tbody,optgroup:f.option});}d.creators=f;},"3.8.0pr2",{requires:["dom-core"]});
var L10N = {}; var photoBooth = (function () { config = {}; // vars var public = {}, loader = $('#loader'), startPage = $('#start'), countDown = cntdwn_time, // Countdown from config cheeseTime = cheese_time, timeToLive = 90000, qr = false, timeOut, saving = false, gallery = $('#gallery'), galleryScrollbar = gallery_scrollbar, processing = false, pswp = {}, resultPage = $('#result'), imgFilter = 'imgPlain', stream, webcamConstraints = { audio: false, video: { width: 720, height: 480, facingMode: "user", } }; showScrollbarsInGallery = galleryScrollbar; // timeOut function public.resetTimeOut = function () { timeOut = setTimeout(function () { window.location = window.location.origin; }, timeToLive); } // reset whole thing public.reset = function () { loader.hide(); qr = false; $('.qr').html('').hide(); $('.qrbtn').removeClass('active').attr('style', ''); $('.loading').text(''); gallery.removeClass('open'); $('.galInner').hide(); $('.resultInner').css({ 'bottom': '-100px' }); $('.spinner').hide(); $('.send-mail').hide(); public.resetMailForm(); } // init public.init = function (options) { public.l10n(); public.reset(); var w = window.innerWidth; var h = window.innerHeight; $('#wrapper').width(w).height(h); $('.galleryInner').width(w * 3); $('.galleryInner').height(h); $('.galleryInner div').width(w); $('.galleryInner').css({ 'left': -w }); loader.width(w).height(h); $('.stages').hide(); public.initPhotoSwipeFromDOM('#galimages'); startPage.show(); } // check for resizing public.handleResize = function () { var w = window.innerWidth; var h = window.innerHeight; $('#wrapper').width(w).height(h); $('#loader').width(w).height(h); } public.l10n = function (elem) { elem = $(elem || 'body'); elem.find('[data-l10n]').each(function (i, item) { item = $(item); item.html(L10N[item.data('l10n')]); }); } // Set the width of the side navigation to 250px and the left margin of the page content to 250px public.openNav = function () { document.getElementById("mySidenav").style.width = "250px"; } // Set the width of the side navigation to 0 and the left margin of the page content to 0 */ public.closeNav = function () { document.getElementById("mySidenav").style.width = "0"; } // Cheese public.cheese = function (photoStyle) { console.log(photoStyle); if ((photoStyle=='photo')){ $('#counter').text(''); $('.loading').text(L10N.cheese); }else{ $('#counter').text(''); $('.loading').text(L10N.cheeseCollage); } public.takePic(photoStyle); } // take Picture public.takePic = function (photoStyle) { processing = true; //console.log(Take Picture: photoStyle); setTimeout(function () { if(useVideo){ var track = public.stream.getTracks()[0]; track.stop(); $('video').hide(); } if ((photoStyle=='photo')){ $('#counter').text(''); $('.spinner').show(); $('.loading').text(L10N.busy); }else{ $('#counter').text(''); if (!isdev) { setTimeout(function () { $('.spinner').show(); $('.loading').text(L10N.busyCollage); }, 7500); }else{ $('.spinner').show(); $('.loading').text(L10N.busyCollage); } } $('#counter').text(''); }, cheeseTime); jQuery.post("takePic.php",{filter: imgFilter,style: photoStyle}).done(function( result ){ result = JSON.parse(result); if (result.error) { console.log("if yes"); public.errorPic(result); } else { public.renderPic(result); } }).fail(function(xhr, status, result){ console.log("jquerry"); public.errorPic(result); }); } // .takePic when pressing Enter=13 $(document).ready(function() { $(document).on('keypress', function(e) { if(e.keyCode==13){ $('.takePic').trigger('click'); } }); }); // Show error Msg and reset public.errorPic = function (result) { setTimeout(function () { $('.spinner').hide(); $('.loading').html(L10N.error + '<a class="btn" href="/">' + L10N.reload + '</a>'); }, 1100); } // Render Picture after taking public.renderPic = function (result) { // Add QR Code Image $('.qr').html(''); $('<img src="qrcode.php?filename=' + result.img + '"/>').on('load', function () { $(this).appendTo($('.qr')); $('<p>').html(L10N.qrHelp).appendTo($('.qr')); }); // Add Print Link $(document).off('click touchstart', '.printbtn'); $(document).on('click touchstart', '.printbtn', function (e) { swal({ customClass: 'myPrintConfirmation', type: 'success', title: 'Druckauftrag gestartet', showConfirmButton: false, timer: 1600, allowOutsideClick: false }); e.preventDefault(); $.ajax({ url: 'print.php?filename=' + encodeURI(result.img), }).done(function (data) { }); }); // Add Image to gallery and slider public.addImage(result.img); // Add Image $('<img src="/'+imgFolder+'/' + result.img + '" class="original">').on('load', function () { $('#result').css({ 'background-image': 'url(/'+imgFolder+'/' + result.img + ')' }); startPage.fadeOut(400, function () { resultPage.fadeIn(400, function () { setTimeout(function () { processing = false; loader.slideUp('fast'); }, 400); setTimeout(function () { $('.resultInner').stop().animate({ 'bottom': '50px' }, 400).removeClass('hidden'); }, 400); clearTimeout(timeOut); public.resetTimeOut(); }); }); }); } // add image to Gallery public.addImage = function (imageName) { var thumbImg = new Image(); var bigImg = new Image(); var thumbSize = ''; var bigSize = ''; var imgtoLoad = 2; thumbImg.onload = function() { thumbSize = this.width + 'x' + this.height; if (--imgtoLoad == 0) {allLoaded();} } bigImg.onload = function() { bigSize = this.width + 'x' + this.height; if (--imgtoLoad == 0) {allLoaded();} } bigImg.src = '/'+imgFolder+'/' + imageName; thumbImg.src = '/'+thumbFolder+'/' + imageName; function allLoaded() { var $node = $('<a>').html(thumbImg).data('size', bigSize).attr('href', '/'+imgFolder+'/' + imageName + '?new=1').attr('data-med', '/'+thumbFolder+'/' + imageName).attr('data-med-size', thumbSize); if (gallery_newest_first) { $node.prependTo($('#galimages')); } else { $node.appendTo($('#galimages')); } } } // Open Gallery Overview public.openGallery = function (elem) { var pos = elem.offset(); if(showScrollbarsInGallery) { $('.galHeader').css({ 'right': '40px', 'width': 'auto' }); } gallery.css({ 'left': pos.left, 'top': pos.top }) .data('left', pos.left) .data('top', pos.top) .addClass('open') .animate({ 'width': showScrollbarsInGallery ? '100%' : '102%', 'height': '100%', 'top': 0, 'left': 0 }, 300, function () { $('.galInner').show(); gallery.css({ 'overflow-y': 'scroll' }); }); } $(window).on('resize', public.handleResize); //Filter $('.imageFilter').on('click', function (e) { //e.preventDefault(); if($('#mySidenav').width() > 0){ public.closeNav(); } else { public.openNav(); } }); $('.sidenav').children().on('click', function (e) { $('.sidenav').children().removeAttr("class"); $(this).addClass("activeSidenavBtn"); imgFilter = $(this).attr("id"); if (isdev) { console.log(imgFilter); } }); // Open QR Code in Gallery // Take Picture Button $('.takePic, .newpic').on('click', function (e) { e.preventDefault(); var target = $(e.target); var photoStyle = 'photo'; console.log("photo"); if (target.hasClass('gallery')) { public.openGallery(target); } else { if (!processing) { if($('#mySidenav').width() > 0){ public.closeNav(); } public.reset(); if(useVideo && navigator.mediaDevices){ navigator.getMedia = (navigator.mediaDevices.getUserMedia || navigator.mediaDevices.webkitGetUserMedia || navigator.mediaDevices.mozGetUserMedia || false); if(navigator.getMedia) { navigator.mediaDevices.getUserMedia(webcamConstraints) .then(function(stream) { $('video').show(); var video = document.getElementById('video'); video.srcObject = stream; public.stream = stream; }) .catch(function (error) { }); } } loader.slideDown('slow', 'easeOutBounce', function () { public.countdown(countDown, $('#counter'),photoStyle); }); } } }); // Take Collage Button $('.takeCollage, .newcollage').on('click', function (e) { e.preventDefault(); var target = $(e.target); var photoStyle = 'collage'; console.log("collage"); if (target.hasClass('gallery')) { public.openGallery(target); } else { if (!processing) { if($('#mySidenav').width() > 0){ public.closeNav(); } public.reset(); if(useVideo && navigator.mediaDevices){ navigator.getMedia = (navigator.mediaDevices.getUserMedia || navigator.mediaDevices.webkitGetUserMedia || navigator.mediaDevices.mozGetUserMedia || false); if(navigator.getMedia) { navigator.mediaDevices.getUserMedia(webcamConstraints) .then(function(stream) { $('video').show(); var video = document.getElementById('video'); video.srcObject = stream; public.stream = stream; }) .catch(function (error) { }); } } loader.slideDown('slow', 'easeOutBounce', function () { console.log(photoStyle); public.countdown(countDown, $('#counter'),photoStyle); }); } } }); // Open Gallery Button $('#result .gallery, #start .gallery').on('click', function (e) { e.preventDefault(); if($('#mySidenav').width() > 0){ public.closeNav(); } public.openGallery($(this)); }); // Close Gallery Overview $('.close_gal').on('click', function (e) { e.preventDefault(); $('.galInner').hide(); gallery.css({ 'overflow-y': 'visible' }); $('#gallery').animate({ 'width': '200px', 'height': '70px', 'left': $('#gallery').data('left'), 'top': $('#gallery').data('top') }, 300, function () { $('#gallery').removeClass('open'); }); }); $('.tabbox ul li').on('click', function () { var elem = $(this), target = $('.' + elem.data('target')); if (!elem.hasClass('active')) { $('.tabbox ul li').removeClass('active'); $('.tab').removeClass('active'); elem.addClass('active'); target.addClass('active'); } }); // QR in gallery $(document).on('click touchstart', '.gal-qr-code', function (e) { e.preventDefault(); var pswpQR = $('.pswp__qr'); if (pswpQR.hasClass('qr-active')) { pswpQR.removeClass('qr-active').fadeOut('fast'); } else { pswpQR.empty(); var img = pswp.currItem.src; img = img.split('/').pop(); $('<img>').attr('src', 'qrcode.php?filename=' + img).appendTo(pswpQR); pswpQR.addClass('qr-active').fadeIn('fast'); } }); // print in gallery $(document).on('click touchstart', '.gal-print', function (e) { swal({ customClass: 'myPrintConfirmation', type: 'success', title: 'Druckauftrag gestartet', showConfirmButton: false, timer: 1600, allowOutsideClick: false }) e.preventDefault(); var img = pswp.currItem.src; img = img.replace(imgFolder+'/', ''); $.ajax({ url: 'print.php?filename=' + encodeURI(img), }).done(function (data) { }); }); // chroma keying print $(document).on('click touchstart', '.gal-print-chroma_keying', function (e) { e.preventDefault(); var img = pswp.currItem.src; img = img.replace(imgFolder+'/', ''); $.post( "chroma_keying/lib_php/info.php", function( info ) { if (info.chroma_keying == true) { var currentHref = $(location).attr('href').split('#')[0];; var encodedString = btoa(currentHref); //var decodedString = atob(encodedString); $(location).attr('href','chroma_keying/index.php?filename=' + encodeURI(img) + '&location=' + encodeURI(encodedString)); } }, "json"); }); // Send Mail gallery $('.gal-mail').on('click touchstart', function (e) { //e.preventDefault(); var mail = $('.send-mail'); if (mail.hasClass('mail-active')) { public.resetMailForm(); mail.removeClass('mail-active').fadeOut('fast'); } else { mail.addClass('mail-active').fadeIn('fast'); } }); $('.mailbtn').on('click', function (e) { var mail = $('.send-mail'); if (mail.hasClass('mail-active')) { public.resetMailForm(); mail.removeClass('mail-active').fadeOut('fast'); } else { mail.addClass('mail-active').fadeIn('fast'); } }); $('#send-mail-form').on('submit', function (e) { e.preventDefault(); var img = ''; if($('.pswp.pswp--open.pswp--visible').length) { img = pswp.currItem.src; } else { img = resultPage.css("background-image").replace('url(','').replace(')','').replace(/\"/gi, "").split('/'+imgFolder+'/')[1]; } img = img.replace('/'+imgFolder+'/', ''); img = img.replace('/'+thumbFolder+'/', ''); $('#mail-form-image').val(img); var message = $('#mail-form-message'); message.empty(); var form = $(this); var oldValue = form.find('.btn').html(); form.find('.btn').html('<i class="fa fa-spinner fa-spin"></i>'); $.ajax({ url: 'sendPic.php', type: 'POST', data: form.serialize(), dataType: "json", cache: false, success: function (result) { if (result.success === true) { message.fadeIn().html('<span style="color:green">' + L10N.mailSent + '</span>'); } else { message.fadeIn().html('<span style="color:red">' + result.error + '</span>'); } }, error: function (xhr, status, error) { message.fadeIn('fast').html('<span style="color: red;">' + L10N.mailError + '</span>'); }, complete: function () { form.find('.btn').html(oldValue); } }); }); $('#send-mail-close').on('click', function (e) { public.resetMailForm(); $('.send-mail').removeClass('mail-active').fadeOut('fast'); }); public.resetMailForm = function() { $('#send-mail-form').trigger('reset'); $('#mail-form-message').html(''); }; $('#result').on('click', function (e) { var target = $(e.target); // Menü in and out if (!target.hasClass('qrbtn') && target.closest('.qrbtn').length == 0 && !target.hasClass('newpic') && !target.hasClass('printbtn') && target.closest('.printbtn').length == 0 && !target.hasClass('resetBtn') && !target.hasClass('gallery') && qr != true && !target.hasClass('homebtn') && target.closest('.homebtn').length == 0 && !target.hasClass('mailbtn')) { if ($('.resultInner').hasClass('hidden')) { $('.resultInner').stop().animate({ 'bottom': '50px' }, 400).removeClass('hidden'); } else { $('.resultInner').stop().animate({ 'bottom': '-100px' }, 400).addClass('hidden'); } } if (qr && !target.hasClass('qrbtn')) { var qrpos = $('.qrbtn').offset(), qrbtnwidth = $('.qrbtn').outerWidth(), qrbtnheight = $('.qrbtn').outerHeight() $('.qr').removeClass('active'); $('.qr').animate({ 'width': qrbtnwidth, 'height': qrbtnheight, 'left': qrpos.left, 'top': qrpos.top, 'margin-left': 0, }, 250, function(){ $('.qr').hide(); }); qr = false; } // Go to Home if (target.hasClass('homebtn') || target.closest('.homebtn').length > 0) { window.location = window.location.origin; } // Qr in and out if (target.hasClass('qrbtn') || target.closest('.qrbtn').length > 0) { var qrpos = $('.qrbtn').offset(), qrbtnwidth = $('.qrbtn').outerWidth(), qrbtnheight = $('.qrbtn').outerHeight() if (qr) { $('.qr').removeClass('active'); $('.qr').animate({ 'width': qrbtnwidth, 'height': qrbtnheight, 'left': qrpos.left, 'top': qrpos.top, 'margin-left': 0, }, 250, function(){ $('.qr').hide(); }); qr = false; } else { qr = true; $('.qr').css({ 'width': qrbtnwidth, 'height': qrbtnheight, 'left': qrpos.left, 'top': qrpos.top }); $('.qr').show(); $('.qr').animate({ 'width': 500, 'height': 600, 'left': '50%', 'margin-left': -265, 'top': 50 }, 250, function(){ $('.qr').addClass('active'); }); } } }); // Show QR Code $('.qrbtn').on('click', function (e) { e.preventDefault(); }); $('.printbtn').on('click', function (e) { e.preventDefault(); }); $('.homebtn').on('click', function (e) { e.preventDefault(); }); // Countdown Function public.countdown = function (calls, element, photoStyle) { count = 0; current = calls; console.log(photoStyle); var timerFunction = function () { element.text(current); current--; TweenLite.to(element, 0.0, { scale: 8, opacity: 0.2 }); TweenLite.to(element, 0.75, { scale: 1, opacity: 1 }); if (count < calls) { window.setTimeout(timerFunction, 1000); } else { console.log(photoStyle); public.cheese(photoStyle); } count++; }; timerFunction(); } ////////////////////////////////////////////////////////////////////////////////////////// ////// PHOTOSWIPE FUNCTIONS ///////////////////////////////////////////////////////////// public.initPhotoSwipeFromDOM = function (gallerySelector) { // select all gallery elements var galleryElements = document.querySelectorAll(gallerySelector); for (var i = 0, l = galleryElements.length; i < l; i++) { galleryElements[i].setAttribute('data-pswp-uid', i + 1); galleryElements[i].onclick = onThumbnailsClick; } // Parse URL and open gallery if it contains #&pid=3&gid=1 var hashData = public.photoswipeParseHash(); if (hashData.pid > 0 && hashData.gid > 0) { public.openPhotoSwipe(hashData.pid - 1, galleryElements[hashData.gid - 1], true); } } var onThumbnailsClick = function (e) { e = e || window.event; e.preventDefault ? e.preventDefault() : e.returnValue = false; var eTarget = e.target || e.srcElement; var clickedListItem = closest(eTarget, function (el) { return el.tagName === 'A'; }); if (!clickedListItem) { return; } var clickedGallery = clickedListItem.parentNode; var childNodes = clickedListItem.parentNode.childNodes, numChildNodes = childNodes.length, nodeIndex = 0, index; for (var i = 0; i < numChildNodes; i++) { if (childNodes[i].nodeType !== 1) { continue; } if (childNodes[i] === clickedListItem) { index = nodeIndex; break; } nodeIndex++; } if (index >= 0) { public.openPhotoSwipe(index, clickedGallery); } return false; }; public.photoswipeParseHash = function () { var hash = window.location.hash.substring(1), params = {}; if (hash.length < 5) { // pid=1 return params; } var vars = hash.split('&'); for (var i = 0; i < vars.length; i++) { if (!vars[i]) { continue; } var pair = vars[i].split('='); if (pair.length < 2) { continue; } params[pair[0]] = pair[1]; } if (params.gid) { params.gid = parseInt(params.gid, 10); } if (!params.hasOwnProperty('pid')) { return params; } params.pid = parseInt(params.pid, 10); return params; }; // Get Items for Photoswipe Gallery public.parseThumbnailElements = function (el) { var thumbElements = el.childNodes, numNodes = thumbElements.length, items = [], el, childElements, thumbnailEl, size, item; for (var i = 0; i < numNodes; i++) { el = thumbElements[i]; // include only element nodes if (el.nodeType !== 1) { continue; } childElements = el.children; size = $(el).data('size').split('x'); // create slide object item = { src: el.getAttribute('href'), w: parseInt(size[0], 10), h: parseInt(size[1], 10), author: el.getAttribute('data-author') }; item.el = el; // save link to element for getThumbBoundsFn if (childElements.length > 0) { item.msrc = childElements[0].getAttribute('src'); // thumbnail url if (childElements.length > 1) { item.title = childElements[1].innerHTML; // caption (contents of figure) } } var mediumSrc = el.getAttribute('data-med'); if (mediumSrc) { size = el.getAttribute('data-med-size').split('x'); // "medium-sized" image item.m = { src: mediumSrc, w: parseInt(size[0], 10), h: parseInt(size[1], 10) }; } // original image item.o = { src: item.src, w: item.w, h: item.h }; items.push(item); } return items; }; public.openPhotoSwipe = function (index, galleryElement, disableAnimation) { var pswpElement = document.querySelectorAll('.pswp')[0], gallery, options, items; items = public.parseThumbnailElements(galleryElement); // define options (if needed) options = { index: index, galleryUID: galleryElement.getAttribute('data-pswp-uid'), getThumbBoundsFn: function (index) { // See Options->getThumbBoundsFn section of docs for more info var thumbnail = items[index].el.children[0], pageYScroll = window.pageYOffset || document.documentElement.scrollTop, rect = thumbnail.getBoundingClientRect(); return { x: rect.left, y: rect.top + pageYScroll, w: rect.width }; }, shareEl: false, zoomEl: false, fullscreenEl: false, addCaptionHTMLFn: function (item, captionEl, isFake) { if (!item.title) { captionEl.children[0].innerText = ''; return false; } captionEl.children[0].innerHTML = item.title + '<br/><small>Photo: ' + item.author + '</small>'; return true; } }; var radios = document.getElementsByName('gallery-style'); for (var i = 0, length = radios.length; i < length; i++) { if (radios[i].checked) { if (radios[i].id == 'radio-all-controls') { } else if (radios[i].id == 'radio-minimal-black') { options.mainClass = 'pswp--minimal--dark'; options.barsSize = { top: 0, bottom: 0 }; options.captionEl = false; options.fullscreenEl = false; options.shareEl = false; options.bgOpacity = 0.85; options.tapToClose = true; options.tapToToggleControls = false; } break; } } if (disableAnimation) { options.showAnimationDuration = 0; } // Pass data to PhotoSwipe and initialize it pswp = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options); // see: http://photoswipe.com/documentation/responsive-images.html var realViewportWidth, useLargeImages = false, firstResize = true, imageSrcWillChange; pswp.listen('beforeResize', function () { var dpiRatio = window.devicePixelRatio ? window.devicePixelRatio : 1; dpiRatio = Math.min(dpiRatio, 2.5); realViewportWidth = pswp.viewportSize.x * dpiRatio; if (realViewportWidth >= 1200 || (!pswp.likelyTouchDevice && realViewportWidth > 800) || screen.width > 1200) { if (!useLargeImages) { useLargeImages = true; imageSrcWillChange = true; } } else { if (useLargeImages) { useLargeImages = false; imageSrcWillChange = true; } } if (imageSrcWillChange && !firstResize) { pswp.invalidateCurrItems(); } if (firstResize) { firstResize = false; } imageSrcWillChange = false; }); pswp.listen('gettingData', function (index, item) { if (useLargeImages) { item.src = item.o.src; item.w = item.o.w; item.h = item.o.h; } else { item.src = item.m.src; item.w = item.m.w; item.h = item.m.h; } }); pswp.listen('beforeChange', function () { $('.pswp__qr').removeClass('qr-active').fadeOut('fast'); public.resetMailForm(); $('.send-mail').removeClass('mail-active').fadeOut('fast'); }); pswp.listen('close', function () { $('.pswp__qr').removeClass('qr-active').fadeOut('fast'); public.resetMailForm(); $('.send-mail').removeClass('mail-active').fadeOut('fast'); }); pswp.init(); }; // find nearest parent element var closest = function closest(el, fn) { return el && (fn(el) ? el : closest(el.parentNode, fn)); }; ////////////////////////////////////////////////////////////////////////////////////////// // clear Timeout to not reset the gallery, if you clicked anywhere $(document).on('click', function (event) { if (startPage.is(':visible')) { } else { clearTimeout(timeOut); public.resetTimeOut(); } }); // Disable Right-Click //if (!isdev) { // $(this).on("contextmenu", function (e) { // e.preventDefault(); // }); //} return public; })(); // Init on domready $(function () { photoBooth.init(); });
const CustomError = require("../extensions/custom-error"); module.exports = function getSeason(date) { let month = date.getMonth(); if(!date){ return 'Unable to determine the time of year!'; }else if(date.getMonth!=Date.prototype.getMonth){ throw new Error() }else{ if(month==11||month>=0&&month<=1){ return 'winter' }else if(month>=2&&month<=4){ return 'spring' }else if(month>=5&&month<=7){ return 'summer' }else if(month>=8&&month<=10){ return 'autumn' } } };
import { act, render, screen, waitForElementToBeRemoved } from '@testing-library/react'; import userEvent from '@testing-library/user-event' import ConceptNetworkViewer from './conceptNetworkViewer'; import testRenderables from './testRenderables'; test('tabs are rendered', () => { render(<ConceptNetworkViewer />); expect(screen.getByText("Presentation")).toBeTruthy(); expect(screen.getByText("Definition")).toBeTruthy(); expect(screen.getByText("Calculation")).toBeTruthy(); }); test('loader displays while fetching and stops displaying when finished', async () => { const testId = 'testID'; const testHash = 'testHash'; let container; const waitForMe = Promise.resolve({ json: () => {Promise.resolve({testRenderables})} }) const urlMap = {}; const fetchMock = jest .spyOn(global, 'fetch') .mockImplementation((url) => { let acc = urlMap[url]; if (!acc) { acc = 0; } acc++ urlMap[url] = acc; return waitForMe }) await act( async () => { const { container: localContainer } = render(<ConceptNetworkViewer idFromQuery={testId} renderablesHash={testHash}/>); expect(localContainer.getElementsByClassName('loader').length).toBe(1); container = localContainer; await waitForElementToBeRemoved(document.querySelector('.loader')); } ) expect(container.getElementsByClassName('loader').length).toBe(0); expect(urlMap['/folders/' + testId + '/' + testHash]).toEqual(1); expect(fetchMock).toHaveBeenCalledWith('/folders/' + testId + '/' + testHash); global.fetch.mockRestore(); }); test('correct tab is selected', async () => { const testId = 'testID'; const testHash = 'testHash'; const waitForMe = Promise.resolve({ json: () => {Promise.resolve({testRenderables})} }) jest.spyOn(global, 'fetch') .mockImplementation(() => waitForMe) await act( async () => { render(<ConceptNetworkViewer idFromQuery={testId} renderablesHash={testHash}/>); await waitForElementToBeRemoved(document.querySelector('.loader')); } ) expect(screen.getByText("Presentation")).toHaveClass('tab-selected'); expect(screen.getByText("Definition")).not.toHaveClass('tab-selected'); expect(screen.getByText("Calculation")).not.toHaveClass('tab-selected'); userEvent.hover(screen.getByText('Definition')); userEvent.click(screen.getByText('Definition')); expect(screen.getByText("Presentation")).not.toHaveClass('tab-selected'); expect(screen.getByText("Definition")).toHaveClass('tab-selected'); expect(screen.getByText("Calculation")).not.toHaveClass('tab-selected'); userEvent.hover(screen.getByText('Calculation')); userEvent.click(screen.getByText('Calculation')); expect(screen.getByText("Presentation")).not.toHaveClass('tab-selected'); expect(screen.getByText("Definition")).not.toHaveClass('tab-selected'); expect(screen.getByText("Calculation")).toHaveClass('tab-selected'); userEvent.hover(screen.getByText('Presentation')); userEvent.click(screen.getByText('Presentation')); expect(screen.getByText("Presentation")).toHaveClass('tab-selected'); expect(screen.getByText("Definition")).not.toHaveClass('tab-selected'); expect(screen.getByText("Calculation")).not.toHaveClass('tab-selected'); global.fetch.mockRestore(); });
/* eslint-disable jsx-a11y/alt-text */ import React, { useState, Fragment } from 'react'; import ExpansionPanel from '@material-ui/core/ExpansionPanel'; import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary'; import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails'; import Typography from '@material-ui/core/Typography'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import LocalPharmacyIcon from '@material-ui/icons/LocalPharmacy'; import FitnessCenterIcon from '@material-ui/icons/FitnessCenter'; import FavoriteIcon from '@material-ui/icons/Favorite'; import HealingIcon from '@material-ui/icons/Healing'; import DoctorsIcon from './undraw_doctors_hwty.svg' import HealthIcon from './undraw_medicine_b1ol.svg' import MedicineIcon from './undraw_medicine_b1ol.svg' import WorkoutIcon from './undraw_workout_gcgu.svg' export default function StatefulExpansionPanels() { const [expanded, setExpanded] = useState(0); const [panels] = useState([ { title: 'Diabetes Overview', content: <p>Designed to educate diet. In ut velit laoreet, blandit nisi id, tempus mi. Mauris interdum in turpis vel tempor. Vivamus tincidunt turpis vitae porta dignissim. Quisque condimentum augue arcu, quis tincidunt erat luctus sit amet. Sed quis ligula malesuada, sollicitudin nisl nec, molestie tellus. Donec commodo consequat gravida. Mauris in rhoncus tellus, eget posuere risus. Pellentesque eget lectus lorem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer condimentum, sapien varius vulputate lobortis, urna elit vestibulum ligula, sit amet interdum lectus augue ac eros. Vestibulum lorem ante, tincidunt eget faucibus id, placerat non est. Vivamus pretium consectetur nunc at imperdiet. Nullam eu elit dui. In imperdiet magna ac dui aliquam gravida. Aenean ipsum ex, fermentum eu pretium quis, posuere et velit. Designed to educate diet. In ut velit laoreet, blandit nisi id, tempus mi. Mauris interdum in turpis vel tempor. Vivamus tincidunt turpis vitae porta dignissim. Quisque condimentum augue arcu, quis tincidunt erat luctus sit amet. Sed quis ligula malesuada, sollicitudin nisl nec, molestie tellus. Donec commodo consequat gravida. Mauris in rhoncus tellus, eget posuere risus. Pellentesque eget lectus lorem. In ut velit laoreet, blandit nisi id, tempus mi. Mauris interdum in turpis vel tempor. Vivamus tincidunt turpis vitae porta dignissim. Quisque condimentum augue arcu, quis tincidunt erat luctus sit amet. Sed quis ligula malesuada, sollicitudin nisl nec, molestie tellus. Donec commodo consequat gravida. Mauris in rhoncus tellus, eget posuere risus. Pellentesque eget lectus lorem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer condimentum, sapien varius vulputate lobortis, urna elit vestibulum ligula, sit amet interdum lectus augue ac eros. Vestibulum lorem ante, tincidunt eget faucibus id, placerat non est. Vivamus pretium consectetur nunc at imperdiet. Nullam eu elit dui. In imperdiet magna ac dui aliquam gravida. Aenean ipsum ex, fermentum eu pretium quis, posuere et velit.<br/> <img src={HealthIcon} className='panel-image'/> </p>, icon: <FavoriteIcon fontSize="large"/> }, { title: 'Diet & Fitness', content: <p>Designed to educate diet. Vestibulum lorem ante, tincidunt eget faucibus id, placerat non est. Vivamus pretium consectetur nunc at imperdiet. Nullam eu elit dui. In imperdiet magna ac dui aliquam gravida. Aenean ipsum ex, fermentum eu pretium quis, posuere et velit. In ut velit laoreet, blandit nisi id, tempus mi. Mauris interdum in turpis vel tempor. Vivamus tincidunt turpis vitae porta dignissim. Quisque condimentum augue arcu, quis tincidunt erat luctus sit amet. Sed quis ligula malesuada, sollicitudin nisl nec, molestie tellus. Donec commodo consequat gravida. Mauris in rhoncus tellus, eget posuere risus. Pellentesque eget lectus lorem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer condimentum, sapien varius vulputate lobortis, urna elit vestibulum ligula, sit amet interdum lectus augue ac eros. Vestibulum lorem ante, tincidunt eget faucibus id, placerat non est. Vivamus pretium consectetur nunc at imperdiet. Nullam eu elit dui. In imperdiet magna ac dui aliquam gravida. Aenean ipsum ex, fermentum eu pretium quis, posuere et velit. In ut velit laoreet, blandit nisi id, tempus mi. Mauris interdum in turpis vel tempor. Vivamus tincidunt turpis vitae porta dignissim. Quisque condimentum augue arcu, quis tincidunt erat luctus sit amet. Sed quis ligula malesuada, sollicitudin nisl nec, molestie tellus. Donec commodo consequat gravida. Mauris in rhoncus tellus, eget posuere risus. Pellentesque eget lectus lorem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer condimentum, sapien varius vulputate lobortis, urna elit vestibulum ligula, sit amet interdum lectus augue ac eros. Vestibulum lorem ante, tincidunt eget faucibus id, placerat non est. Vivamus pretium consectetur nunc at imperdiet. Nullam eu elit dui. In imperdiet magna ac dui aliquam gravida. Aenean ipsum ex, fermentum eu pretium quis, posuere et velit. Designed to educate diet.<br/> <img src={WorkoutIcon} className='panel-image'/> </p>, icon: <FitnessCenterIcon fontSize="large"/> }, { title: 'Comprehensive Healthcare plan', content: <span>Designed to educate diet. Vestibulum lorem ante, tincidunt eget faucibus id, placerat non est. Vivamus pretium consectetur nunc at imperdiet. Nullam eu elit dui. In imperdiet magna ac dui aliquam gravida. Aenean ipsum ex, fermentum eu pretium quis, posuere et velit. In ut velit laoreet, blandit nisi id, tempus mi. Mauris interdum in turpis vel tempor. Vivamus tincidunt turpis vitae porta dignissim. Quisque condimentum augue arcu, quis tincidunt erat luctus sit amet. Sed quis ligula malesuada, sollicitudin nisl nec, molestie tellus. Donec commodo consequat gravida. Mauris in rhoncus tellus, eget posuere risus. Pellentesque eget lectus lorem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer condimentum, sapien varius vulputate lobortis, urna elit vestibulum ligula, sit amet interdum lectus augue ac eros. Vestibulum lorem ante, tincidunt eget faucibus id, placerat non est. Vivamus pretium consectetur nunc at imperdiet. Nullam eu elit dui. In imperdiet magna ac dui aliquam gravida. Aenean ipsum ex, fermentum eu pretium quis, posuere et velit. In ut velit laoreet, blandit nisi id, tempus mi. Mauris interdum in turpis vel tempor. Vivamus tincidunt turpis vitae porta dignissim. Quisque condimentum augue arcu, quis tincidunt erat luctus sit amet. Sed quis ligula malesuada, sollicitudin nisl nec, molestie tellus. Donec commodo consequat gravida. Mauris in rhoncus tellus, eget posuere risus. Pellentesque eget lectus lorem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer condimentum, sapien varius vulputate lobortis, urna elit vestibulum ligula, sit amet interdum lectus augue ac eros. Vestibulum lorem ante, tincidunt eget faucibus id, placerat non est. Vivamus pretium consectetur nunc at imperdiet. Nullam eu elit dui. In imperdiet magna ac dui aliquam gravida. Aenean ipsum ex, fermentum eu pretium quis, posuere et velit. Designed to educate diet. <br/> <img src={DoctorsIcon} className='panel-image'/> </span>, icon: <HealingIcon fontSize="large"/> }, { title: 'Advocacy & support', content: <span>Designed to educate diet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer condimentum, sapien varius vulputate lobortis, urna elit vestibulum ligula, sit amet interdum lectus augue ac eros. In ut velit laoreet, blandit nisi id, tempus mi. Mauris interdum in turpis vel tempor. Vivamus tincidunt turpis vitae porta dignissim. Quisque condimentum augue arcu, quis tincidunt erat luctus sit amet. Sed quis ligula malesuada, sollicitudin nisl nec, molestie tellus. Donec commodo consequat gravida. Mauris in rhoncus tellus, eget posuere risus. Pellentesque eget lectus lorem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer condimentum, sapien varius vulputate lobortis, urna elit vestibulum ligula, sit amet interdum lectus augue ac eros. Vestibulum lorem ante, tincidunt eget faucibus id, placerat non est. Vivamus pretium consectetur nunc at imperdiet. Nullam eu elit dui. In imperdiet magna ac dui aliquam gravida. Aenean ipsum ex, fermentum eu pretium quis, posuere et velit. In ut velit laoreet, blandit nisi id, tempus mi. Mauris interdum in turpis vel tempor. Vivamus tincidunt turpis vitae porta dignissim. Quisque condimentum augue arcu, quis tincidunt erat luctus sit amet. Sed quis ligula malesuada, sollicitudin nisl nec, molestie tellus. Donec commodo consequat gravida. Mauris in rhoncus tellus, eget posuere risus. Pellentesque eget lectus lorem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer condimentum, sapien varius vulputate lobortis, urna elit vestibulum ligula, sit amet interdum lectus augue ac eros. Vestibulum lorem ante, tincidunt eget faucibus id, placerat non est. Vivamus pretium consectetur nunc at imperdiet. Nullam eu elit dui. In imperdiet magna ac dui aliquam gravida. Aenean ipsum ex, fermentum eu pretium quis, posuere et velit. <br/> <img src={MedicineIcon} className='panel-image'/> </span>, icon: <LocalPharmacyIcon fontSize="large"/> } ]); const onChange = expanded => () => { setExpanded(expanded); }; return ( <Fragment> {panels .filter(panel => !panel.hidden) .map((panel, index) => ( <ExpansionPanel key={index} expanded={index === expanded} disabled={panel.disabled} onChange={onChange(index)} > <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}> {panel.icon} <Typography style={{justifySelf:'center'}}>{panel.title}</Typography> </ExpansionPanelSummary> <ExpansionPanelDetails className={panel}> <Typography>{panel.content}</Typography> </ExpansionPanelDetails> </ExpansionPanel> ))} </Fragment> ); }
import { h, Component } from "preact"; import "@polymer/paper-input/paper-input"; import "@polymer/paper-radio-button/paper-radio-button"; import "@polymer/paper-radio-group/paper-radio-group"; import { onChangeEvent } from "../../../../common/preact/event"; export default class SunCondition extends Component { constructor() { super(); this.onChange = onChangeEvent.bind(this, "condition"); this.afterPicked = this.radioGroupPicked.bind(this, "after"); this.beforePicked = this.radioGroupPicked.bind(this, "before"); } radioGroupPicked(key, ev) { const condition = Object.assign({}, this.props.condition); if (ev.target.selected) { condition[key] = ev.target.selected; } else { delete condition[key]; } this.props.onChange(this.props.index, condition); } render({ condition, localize }) { /* eslint-disable camelcase */ const { after, after_offset, before, before_offset } = condition; return ( <div> <label id="beforelabel"> {localize( "ui.panel.config.automation.editor.conditions.type.sun.before" )} </label> <paper-radio-group allow-empty-selection selected={before} aria-labelledby="beforelabel" onpaper-radio-group-changed={this.beforePicked} > <paper-radio-button name="sunrise"> {localize( "ui.panel.config.automation.editor.conditions.type.sun.sunrise" )} </paper-radio-button> <paper-radio-button name="sunset"> {localize( "ui.panel.config.automation.editor.conditions.type.sun.sunset" )} </paper-radio-button> </paper-radio-group> <paper-input label={localize( "ui.panel.config.automation.editor.conditions.type.sun.before_offset" )} name="before_offset" value={before_offset} onvalue-changed={this.onChange} disabled={before === undefined} /> <label id="afterlabel"> {localize( "ui.panel.config.automation.editor.conditions.type.sun.after" )} </label> <paper-radio-group allow-empty-selection selected={after} aria-labelledby="afterlabel" onpaper-radio-group-changed={this.afterPicked} > <paper-radio-button name="sunrise"> {localize( "ui.panel.config.automation.editor.conditions.type.sun.sunrise" )} </paper-radio-button> <paper-radio-button name="sunset"> {localize( "ui.panel.config.automation.editor.conditions.type.sun.sunset" )} </paper-radio-button> </paper-radio-group> <paper-input label={localize( "ui.panel.config.automation.editor.conditions.type.sun.after_offset" )} name="after_offset" value={after_offset} onvalue-changed={this.onChange} disabled={after === undefined} /> </div> ); } } SunCondition.defaultConfig = {};
// This file is auto-generated. import pack from './package.json'; export function ext(resourceName) { return resourceName ? `${pack.name}.${resourceName}` : pack.name; } export const schema = ext('About');
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'save', 'ja', { toolbar: '保存' } );
module.exports = { publicPath: process.env.NODE_ENV === "production" ? "/waiting-room/" : "/" };
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = addMonths; var _index = _interopRequireDefault(require("../_lib/toInteger/index.js")); var _index2 = _interopRequireDefault(require("../toDate/index.js")); var _index3 = _interopRequireDefault(require("../_lib/requiredArgs/index.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * @name addMonths * @category Month Helpers * @summary Add the specified number of months to the given date. * * @description * Add the specified number of months to the given date. * * ### v2.0.0 breaking changes: * * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes). * * @param {Date|Number} date - the date to be changed * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`. * @returns {Date} the new date with the months added * @throws {TypeError} 2 arguments required * * @example * // Add 5 months to 1 September 2014: * const result = addMonths(new Date(2014, 8, 1), 5) * //=> Sun Feb 01 2015 00:00:00 */ function addMonths(dirtyDate, dirtyAmount) { (0, _index3.default)(2, arguments); var date = (0, _index2.default)(dirtyDate); var amount = (0, _index.default)(dirtyAmount); if (isNaN(amount)) { return new Date(NaN); } if (!amount) { // If 0 months, no-op to avoid changing times in the hour before end of DST return date; } var dayOfMonth = date.getDate(); // The JS Date object supports date math by accepting out-of-bounds values for // month, day, etc. For example, new Date(2020, 1, 0) returns 31 Dec 2019 and // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we // want except that dates will wrap around the end of a month, meaning that // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So // we'll default to the end of the desired month by adding 1 to the desired // month and using a date of 0 to back up one day to the end of the desired // month. var endOfDesiredMonth = new Date(date.getTime()); endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0); var daysInMonth = endOfDesiredMonth.getDate(); if (dayOfMonth >= daysInMonth) { // If we're already at the end of the month, then this is the correct date // and we're done. return endOfDesiredMonth; } else { // Otherwise, we now know that setting the original day-of-month value won't // cause an overflow, so set the desired day-of-month. Note that we can't // just set the date of `endOfDesiredMonth` because that object may have had // its time changed in the unusual case where where a DST transition was on // the last day of the month and its local time was in the hour skipped or // repeated next to a DST transition. So we use `date` instead which is // guaranteed to still have the original time. date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth); return date; } } module.exports = exports.default;
/** * Given matrix, a rectangular matrix of integers, * just add up all the values that don't appear below a "0". * * @param {Array<Array>} matrix * @return {Number} * * @example * matrix = [ * [0, 1, 1, 2], * [0, 5, 0, 0], * [2, 0, 3, 3] * ] * * The result should be 9 */ function getMatrixElementsSum(matrix) { let res; res = 0; for (let i = 0; i < matrix.length; i++) { if (i === 0) { for (let j = 0; j < matrix[i].length; j++) { if (matrix[i][j] !== 0) { res += matrix[i][j]; } } } else { for (let j = 0; j < matrix[i].length; j++) { if (matrix[i - 1][j] !== 0) { res += matrix[i][j]; } } } } return res; } module.exports = getMatrixElementsSum;
import { percySnapshot } from '@percy/puppeteer'; describe('ContentNotification', () => { beforeAll(async () => { await page.goto(`${HOST}/content-notification`); }); it('Default', async () => { await expect(page).toMatch('when type is error'); await percySnapshot(page, 'ContentNotification'); }); });
/* Copyright (c) 2014, Groupon, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GROUPON nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 'use strict'; const Gofer = require('../'); const { version, name } = require('../package.json'); const DEFAULT_BASE_URL = 'https://api.github.com'; // Generate our ServiceClient class class GithubClient extends Gofer { constructor(config) { super(config, 'github', version, name); } createAccessToken(oauthCode) { /** * Exchange auth- for access token * * @see http://developer.github.com/v3/oauth/#web-application-flow */ return this.fetch('/login/oauth/access_token', { endpointName: 'createAccessToken', oauthCode, method: 'POST', json: true, }) .json() .then(res => res.access_token); } userRepos(username, qs) { // fetch(url: string, options, callback) return this.fetch(username ? '/users/{username}/repos' : '/user/repos', { endpointName: 'userRepos', pathParams: { username }, qs: Object.assign({ per_page: 100 }, qs), }).json(); } emojis() { return this.fetch('/emojis', { endpointName: 'emojis' }).json(); } } GithubClient.prototype.addOptionMapper(opts => { // We extract all options we will be handling ourselves and then remove // them, making sure nobody gets confused by them const { accessToken, oauthCode, webUrl, clientId, clientSecret, ...otherOpts } = opts; opts = otherOpts; if (accessToken) { opts.headers = opts.headers || {}; opts.headers.authorization = `token ${accessToken}`; } // There's only call using this but since clientId, clientSecret and webUrl // all are part of the configuration, we'll handle it here. if (oauthCode) { opts.baseUrl = webUrl; opts.form = { code: oauthCode, client_id: clientId, client_secret: clientSecret, }; } return Object.assign({ baseUrl: DEFAULT_BASE_URL }, opts); }); module.exports = GithubClient; if (require.main === module) { /* eslint-disable no-console */ const github = new GithubClient({ globalDefaults: { timeout: 5000, connectTimeout: 1000, }, github: { clientId: process.env.GH_CLIENT || '<VALID CLIENT ID HERE>', clientSecret: process.env.GH_SECRET || '<VALID CLIENT SECRET HERE>', }, }); // Get all supported emojis, dump response to stdout github.emojis().json().then(console.log, console.error); // List repos of the `groupon` github org github.userRepos('groupon').then(repoList => { repoList.forEach(repo => { console.log(repo.name, '\t#', repo.description); }); }, console.error); // Make a raw call to `/` (resource discovery) github .fetch('/') .then(response => { console.log('Status code: %d', response.statusCode); return response.json(); }) .then(data => { console.log('Returned %d resources', Object.keys(data).length); }) .catch(console.error); // This is expected to fail unless you pass in a valid access token. If you // do, this will output the first of your repos. github.userRepos({ accessToken: process.env.GH_TOKEN }).then( myRepos => { if (myRepos.length) { console.log('One of your repos: %s', myRepos[0].name); } else { console.log('No repositories found'); } }, error => { console.log('Failed to get repos, try passing in an access token'); console.log(error.message); } ); /* eslint-enable no-console */ }
//// [invalidContinueInDownlevelAsync.ts] async function func() { if (true) { continue; } else { await 1; } } //// [invalidContinueInDownlevelAsync.js] var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __generator = (this && this.__generator) || function (thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } }; function func() { return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: if (!true) return [3 /*break*/, 1]; continue; return [3 /*break*/, 3]; case 1: return [4 /*yield*/, 1]; case 2: _a.sent(); _a.label = 3; case 3: return [2 /*return*/]; } }); }); }
/** * Human Cell Atlas * https://www.humancellatlas.org/ * * Set of possible values for the "entity type" GA dimension. */ export const GAEntityType = { CATALOG: "Catalog", METADATA: "Metadata", };
import reducer, { runTest } from '../src' const runInSequence = async (testSuite, level = 0) => { const indent = ' '.repeat(level) return await reducer(testSuite, { async runTest(test) { const result = await runTest(test) if (result.error) { console.log('%s[x] %s: %s', indent, test.name, result.error.message) } else { console.log('%s[+] %s: %s', indent, test.name, result.result) } if (result.error) result.error = result.error.message // for display return result }, async runTestSuite(ts) { console.log('%s %s', indent, ts.name) return await runInSequence(ts.tests, level + 1) }, }) } (async () => { const tree = await runInSequence([ { name: 'test', fn() { return 'ok' }, }, { name: 'test with context', context: class Context { async _init() { await new Promise(r => setTimeout(r, 10)) this.hello = 'world' } }, fn({ hello }) { return `ok - ${hello}` }, }, { name: 'test-suite', tests: [ { name: 'test1', fn() { throw new Error('fail') }, }, ], }, ]) console.error(tree) })()
'use strict'; console.clear(); const fs = require('fs').promises; const path = require('path'); async function makeDir(path) { await fs.mkdir(path, { recursive: true }); }; async function readDir(path) { const list = await fs.readdir(path); return list; }; async function copyFiles(from, to, list) { await removeFiles(to); for (const item of list) { fs.copyFile(path.join(from, item), path.join(to, item)); }; }; async function removeFiles(from) { const list = await readDir(from); for (const item of list) { fs.unlink(path.join(from, item)); }; }; (async function () { const pathTo = path.join(__dirname, 'files-copy'); const pathFrom = path.join(__dirname, 'files'); await makeDir(pathTo); const list = await readDir(pathFrom); copyFiles(pathFrom, pathTo, list); })();
(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{217:function(e,r,t){"use strict";t.r(r);var n=t(0),o=Object(n.a)({},function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("div",{staticClass:"content"},[t("p",[e._v("这篇文章重点学习 Docker 和 Kubernetes,它们已经是分布式架构和自动化运维的必需品了,也是你必需要学习的。对于这两个东西,你千万不要害怕,因为技术方面都不算复杂,只是它们的玩法和传统运维不一样,所以你不用担心,只要你花上一点时间,一定会学好的。")]),e._v(" "),e._m(0),e._v(" "),t("ul",[t("li",[t("p",[e._v("你可以先看一下Docker的官方介绍 "),t("a",{attrs:{href:"https://docs.docker.com/engine/docker-overview/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker Overview"),t("OutboundLink")],1),e._v(" 。")])]),e._v(" "),t("li",[t("p",[e._v("然后再去一个Web在线的Playground上体验一下, "),t("a",{attrs:{href:"https://www.katacoda.com/courses/docker/playground",target:"_blank",rel:"noopener noreferrer"}},[e._v("Katacoda Docker Playground"),t("OutboundLink")],1),e._v(" 或者是 "),t("a",{attrs:{href:"https://training.play-with-docker.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Play With Docker"),t("OutboundLink")],1),e._v(" 。")])]),e._v(" "),t("li",[t("p",[e._v("接下来,跟着 "),t("a",{attrs:{href:"https://github.com/dwyl/learn-docker",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn Docker"),t("OutboundLink")],1),e._v(" 这个文档中的教程自己安装一个Docker的环境,实操一把。")])]),e._v(" "),t("li",[t("p",[e._v("然后跟着 "),t("a",{attrs:{href:"https://docker-curriculum.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker Curriculum"),t("OutboundLink")],1),e._v(" 这个超详细的教程玩一下Docker。")])])]),e._v(" "),t("p",[e._v("有了上述的一些感性体会之后,你就可以阅读Docker官方文档 "),t("a",{attrs:{href:"https://docs.docker.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker Documentation"),t("OutboundLink")],1),e._v(" 了,这是学习Docker最好的方式。")]),e._v(" "),t("p",[e._v("如果你想了解一下Docker的底层技术细节,你可以参看我的文章。")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://coolshell.cn/articles/17010.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker 基础技术:Linux Namespace(上)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://coolshell.cn/articles/17029.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker 基础技术:Linux Namespace(下)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://coolshell.cn/articles/17049.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker 基础技术:Cgroup"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://coolshell.cn/articles/17061.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker 基础技术:AUFS"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://coolshell.cn/articles/17200.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker 基础技术:DeviceMapper"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("还有一些不错的与Docker网络有关的文章你需要阅读及实践一下。")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://jvns.ca/blog/2016/12/22/container-networking/",target:"_blank",rel:"noopener noreferrer"}},[e._v("A container networking overview"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://www.dasblinkenlichten.com/docker-networking-101-user-defined-networks/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker networking 101 - User defined networks"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://www.dasblinkenlichten.com/understanding-cni-container-networking-interface/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Understanding CNI (Container Networking Interface)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://www.dasblinkenlichten.com/using-cni-docker/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Using CNI with Docker"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("Docker有下面几种网络解决方案:"),t("a",{attrs:{href:"https://www.projectcalico.org/getting-started/docker/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Calico"),t("OutboundLink")],1),e._v(" 、"),t("a",{attrs:{href:"https://github.com/coreos/flannel/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Flannel"),t("OutboundLink")],1),e._v(" 和 "),t("a",{attrs:{href:"https://github.com/weaveworks/weave",target:"_blank",rel:"noopener noreferrer"}},[e._v("Weave"),t("OutboundLink")],1),e._v(" ,你需要学习一下。另外,还需要学习一下 "),t("a",{attrs:{href:"https://github.com/nicolaka/netshoot",target:"_blank",rel:"noopener noreferrer"}},[e._v("netshoot"),t("OutboundLink")],1),e._v(" 。这是一个很不错的用来诊断Docker网络问题的工具集。")]),e._v(" "),t("p",[e._v("关于这几个容器网络解决方案的性能对比,你可以看一下下面这几篇文章或报告。")]),e._v(" "),t("ul",[t("li",[t("p",[t("a",{attrs:{href:"http://chunqi.li/2015/11/15/Battlefield-Calico-Flannel-Weave-and-Docker-Overlay-Network/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Battlefield: Calico, Flannel, Weave and Docker Overlay Network"),t("OutboundLink")],1)])]),e._v(" "),t("li",[t("p",[t("a",{attrs:{href:"http://machinezone.github.io/research/networking-solutions-for-kubernetes/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Comparison of Networking Solutions for Kubernetes"),t("OutboundLink")],1)])]),e._v(" "),t("li",[t("p",[t("a",{attrs:{href:"http://www.delaat.net/rp/2015-2016/p50/report.pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker Overlay Networks: Performance analysis in high-latency enviroments"),t("OutboundLink")],1)])])]),e._v(" "),t("p",[e._v("如果你对Docker的性能有什么问题的话,你可以看一下下面这些文章。")]),e._v(" "),t("ul",[t("li",[t("p",[t("a",{attrs:{href:"https://domino.research.ibm.com/library/cyberdig.nsf/papers/0929052195DD819C85257D2300681E7B/$File/rc25482.pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("IBM Research Report: An Updated Performance Comparison of Virtual Machines and Linux Containers"),t("OutboundLink")],1)])]),e._v(" "),t("li",[t("p",[t("a",{attrs:{href:"http://paper.ijcsns.org/07_book/201703/20170327.pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("An Introduction to Docker and Analysis of its Performance"),t("OutboundLink")],1)])])]),e._v(" "),t("p",[e._v("下面是一些和存储相关的文章。")]),e._v(" "),t("ul",[t("li",[t("p",[t("a",{attrs:{href:"http://cloud-mechanic.blogspot.de/2014/10/storage-concepts-in-docker-network-and.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Storage Concepts in Docker: Network and Cloud Storage"),t("OutboundLink")],1)])]),e._v(" "),t("li",[t("p",[t("a",{attrs:{href:"http://cloud-mechanic.blogspot.de/2014/10/storage-concepts-in-docker-persistent.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Storage Concepts in Docker: Persistent Storage"),t("OutboundLink")],1)])]),e._v(" "),t("li",[t("p",[t("a",{attrs:{href:"http://cloud-mechanic.blogspot.de/2014/10/storage-concepts-in-docker.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Storage Concepts in Docker: Shared Storage and the VOLUME directive"),t("OutboundLink")],1)])])]),e._v(" "),t("p",[e._v("然后是跟运维相关的文章。")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://logz.io/learn/docker-monitoring-elk-stack/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker Monitoring with the ELK Stack: A Step-by-Step Guide"),t("OutboundLink")],1)])]),e._v(" "),t("p",[e._v("最后,推荐看看 "),t("a",{attrs:{href:"http://www.nkode.io/2014/08/24/valuable-docker-links.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Valuable Docker Links"),t("OutboundLink")],1),e._v(" ,其中收集并罗列了一系列非常不错的 Docker 文章。")]),e._v(" "),e._m(1),e._v(" "),t("p",[e._v("下面分享一些与Docker相关的最佳实践。")]),e._v(" "),t("ul",[t("li",[t("p",[t("a",{attrs:{href:"https://docs.docker.com/develop/develop-images/dockerfile_best-practices/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Best Practices for Dockerfile"),t("OutboundLink")],1),e._v(" ,Docker官方文档里的Dockerfile的最佳实践。")])]),e._v(" "),t("li",[t("p",[t("a",{attrs:{href:"https://github.com/FuriKuri/docker-best-practices",target:"_blank",rel:"noopener noreferrer"}},[e._v("Docker Best Practices"),t("OutboundLink")],1),e._v(" ,这里收集汇总了存在于各个地方的使用Docker的建议和实践。")])]),e._v(" "),t("li",[t("p",[t("a",{attrs:{href:"http://docs.projectatomic.io/container-best-practices/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Container Best Practices"),t("OutboundLink")],1),e._v(" ,来自Atomic项目,是一个介绍容器化应用程序的架构、创建和管理的协作型文档项目。")])]),e._v(" "),t("li",[t("p",[t("a",{attrs:{href:"http://hokstad.com/docker/patterns",target:"_blank",rel:"noopener noreferrer"}},[e._v("Eight Docker Development Patterns"),t("OutboundLink")],1),e._v(" ,八个Docker的开发模式:共享基础容器、共享同一个卷的多个开发容器、开发工具专用容器、测试环境容器、编译构建容器、防手误的安装容器、默认服务容器、胶黏容器。")])])]),e._v(" "),e._m(2),e._v(" "),t("p",[e._v("Kubernetes 是Google开源的容器集群管理系统,是Google多年大规模容器管理技术Borg的开源版本,也是CNCF最重要的项目之一,主要功能包括:")]),e._v(" "),e._m(3),e._v(" "),t("p",[e._v("Kubernetes发展非常迅速,已经成为容器编排领域的领导者。")]),e._v(" "),t("p",[e._v("首先,我推荐你阅读Kubernetes前世今生的一篇论文。")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://static.googleusercontent.com/media/research.google.com/zh-CN//pubs/archive/44843.pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("Borg, Omega, and Kubernetes"),t("OutboundLink")],1),e._v(" ,看看Google这十几年来从这三个容器管理系统中得到的经验教训。")])]),e._v(" "),t("p",[e._v("学习kubernetes,有两个免费的开源电子书。")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("《"),t("a",{attrs:{href:"https://jimmysong.io/kubernetes-handbook/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes Handbook"),t("OutboundLink")],1),e._v("》,这本书记录了作者从零开始学习和使用Kubernetes的心路历程,着重于经验分享和总结,同时也会有相关的概念解析。希望能够帮助你少踩坑,少走弯路,还会指引你关注kubernetes生态周边,如微服务构建、DevOps、大数据应用、Service Mesh、Cloud Native等领域。")])]),e._v(" "),t("li",[t("p",[e._v("《"),t("a",{attrs:{href:"https://kubernetes.feisky.xyz/zh/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes指南"),t("OutboundLink")],1),e._v("》,这本书旨在整理平时在开发和使用Kubernetes时的参考指南和实践总结,形成一个系统化的参考指南以方便查阅。")])])]),e._v(" "),t("p",[e._v("这两本电子书都不错,前者更像是一本学习教程,而且面明显广一些,还包括Cloud Natvie、Service Mesh以及微服务相关的东西。而后者聚焦于Kubernetes本身,更像一本参考书。")]),e._v(" "),t("p",[e._v("但是也别忘了Kubernetes的官方网站:"),t("a",{attrs:{href:"https://kubernetes.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes.io"),t("OutboundLink")],1),e._v(",上面不但有"),t("a",{attrs:{href:"https://kubernetes.io/docs/home/",target:"_blank",rel:"noopener noreferrer"}},[e._v("全面的文档"),t("OutboundLink")],1),e._v(" ,也包括一个很不错的 "),t("a",{attrs:{href:"https://kubernetes.io/docs/tutorials/kubernetes-basics/",target:"_blank",rel:"noopener noreferrer"}},[e._v("官方教程"),t("OutboundLink")],1),e._v(" 。")]),e._v(" "),t("p",[e._v("此外,还有一些交互式教程,帮助你理解掌握,以及一些很不错的文章推荐你阅读。")]),e._v(" "),e._m(4),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://www.katacoda.com/courses/kubernetes",target:"_blank",rel:"noopener noreferrer"}},[e._v("Katacoda"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://kubernetesbootcamp.github.io/kubernetes-bootcamp/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes Bootcamp"),t("OutboundLink")],1)])]),e._v(" "),e._m(5),e._v(" "),t("p",[e._v("这里还有一些不错的文档,你应该去读一下。")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://opsnotice.xyz/kubernetes-tips-tricks/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes tips & tricks"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://theremotelab.com/blog/achieving-ci-cd-with-k8s/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Achieving CI/CD with Kubernetes"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://dzone.com/articles/how-to-setup-scalable-jenkins-on-top-of-a-kubernet",target:"_blank",rel:"noopener noreferrer"}},[e._v("How to Set Up Scalable Jenkins on Top of a Kubernetes Cluster"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("10 Most Common Reasons Kubernetes Deployments Fail "),t("a",{attrs:{href:"https://kukulinski.com/10-most-common-reasons-kubernetes-deployments-fail-part-1/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Part I"),t("OutboundLink")],1),e._v(" 和 "),t("a",{attrs:{href:"https://kukulinski.com/10-most-common-reasons-kubernetes-deployments-fail-part-2/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Part II"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://sysdig.com/blog/monitoring-kubernetes-with-sysdig-cloud/",target:"_blank",rel:"noopener noreferrer"}},[e._v("How to Monitor Kubernetes"),t("OutboundLink")],1),e._v(" ,一共有4个篇章")]),e._v(" "),t("li",[t("a",{attrs:{href:"http://www.dasblinkenlichten.com/logging-in-kubernetes-with-fluentd-and-elasticsearch/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Logging in Kubernetes with Fluentd and Elasticsearch"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://dzone.com/articles/kubernetes-monitoring-best-practices-methods-and-e",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes Monitoring: Best Practices, Methods, and Existing Solutions"),t("OutboundLink")],1)])]),e._v(" "),e._m(6),e._v(" "),t("p",[e._v("要学习Kubernetes,你只需要读一下,下面这个Kubernetes 101系列的文章。")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"http://www.dasblinkenlichten.com/kubernetes-101-networking/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes 101 - Networking"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://www.dasblinkenlichten.com/kubernetes-networking-101-pods/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes networking 101 - Pods"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://www.dasblinkenlichten.com/kubernetes-networking-101-services/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes networking 101 - Services"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://www.dasblinkenlichten.com/kubernetes-networking-101-basic-external-access-into-the-cluster/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes networking 101 - (Basic) External access into the cluster"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://www.dasblinkenlichten.com/kubernetes-networking-101-ingress-resources/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes Networking 101 - Ingress resources"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://www.dasblinkenlichten.com/getting-started-with-calico-on-kubernetes/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Getting started with Calico on Kubernetes"),t("OutboundLink")],1)])]),e._v(" "),e._m(7),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://cloud.google.com/solutions/automated-build-images-with-jenkins-kubernetes#kubernetes_architecture",target:"_blank",rel:"noopener noreferrer"}},[e._v("Automated Image Builds with Jenkins, Packer, and Kubernetes"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"http://iocanel.blogspot.in/2015/09/jenkins-setups-for-kubernetes-and.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Jenkins setups for Kubernetes and Docker Workflow"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes",target:"_blank",rel:"noopener noreferrer"}},[e._v("Lab: Build a Continuous Deployment Pipeline with Jenkins and Kubernetes"),t("OutboundLink")],1)])]),e._v(" "),e._m(8),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://medium.com/@sachin.arote1/kubernetes-best-practices-9b1435a4cb53",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes Best Practices"),t("OutboundLink")],1),e._v(" by "),t("a",{attrs:{href:"https://medium.com/@sachin.arote1?source=post_header_lockup",target:"_blank",rel:"noopener noreferrer"}},[e._v("Sachin Arote"),t("OutboundLink")],1),e._v(" ,AWS工程师总结的最佳实践。")]),e._v(" "),t("li",[t("a",{attrs:{href:"https://speakerdeck.com/thesandlord/kubernetes-best-practices",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes Best Practices"),t("OutboundLink")],1),e._v(" by "),t("a",{attrs:{href:"https://github.com/thesandlord",target:"_blank",rel:"noopener noreferrer"}},[e._v("Sandeep Dinesh"),t("OutboundLink")],1),e._v(" ,Google云平台工程师总结的最佳实践。")])]),e._v(" "),e._m(9),e._v(" "),t("p",[e._v("下面是 Github 上和 Docker & Kubernetes相关的Awesome系列。")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://github.com/veggiemonk/awesome-docker",target:"_blank",rel:"noopener noreferrer"}},[e._v("Awesome Docker"),t("OutboundLink")],1),e._v("。")]),e._v(" "),t("li",[t("a",{attrs:{href:"https://github.com/ramitsurana/awesome-kubernetes",target:"_blank",rel:"noopener noreferrer"}},[e._v("Awesome Kubernetes"),t("OutboundLink")],1),e._v("。")])]),e._v(" "),t("p",[e._v("虽然上面的这些系列非常全的罗列了很多资源,但是我觉得很不系统。对于系统的说明Docker和Kubernetes生态圈,我非常推荐大家看一下 The New Stack 为Kubernetes出的一系列的电子书或报告。")]),e._v(" "),t("ul",[t("li",[t("p",[t("a",{attrs:{href:"http://thenewstack.io/ebookseries/",target:"_blank",rel:"noopener noreferrer"}},[e._v("The New Stack eBook Series"),t("OutboundLink")],1),e._v(" ,非常完整和详实的 Docker 和 Kubernetes 生态圈的所有东西。")]),e._v(" "),t("ul",[t("li",[e._v("Book 01: "),t("a",{attrs:{href:"https://thenewstack.io/ebooks/docker-and-containers/the-docker-container-ecosystem/",target:"_blank",rel:"noopener noreferrer"}},[e._v("The Docker Container Ecosystem"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("Book 02: "),t("a",{attrs:{href:"https://thenewstack.io/ebooks/docker-and-containers/applications-microservices-docker-containers/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Applications & Microservices with Docker & Containers"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("Book 03: "),t("a",{attrs:{href:"https://thenewstack.io/ebooks/docker-and-containers/automation-orchestration-docker-containers/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Automation & Orchestration with Docker & Containers"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("Book 04: "),t("a",{attrs:{href:"https://thenewstack.io/ebooks/docker-and-containers/networking-security-storage-docker-containers/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Network, Security & Storage with Docker & Containers"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("Book 05: "),t("a",{attrs:{href:"https://thenewstack.io/ebooks/docker-and-containers/monitoring-management-docker-containers/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Monitoring & Management with Docker & Containers"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("Book 06: "),t("a",{attrs:{href:"https://thenewstack.io/ebooks/use-cases/use-cases-for-kubernetes/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Use Cases for Kubernetes"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("Book 07: "),t("a",{attrs:{href:"https://thenewstack.io/ebooks/kubernetes/state-of-kubernetes-ecosystem/",target:"_blank",rel:"noopener noreferrer"}},[e._v("State of the Kubernetes Ecosystem"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("Book 08: "),t("a",{attrs:{href:"https://thenewstack.io/ebooks/kubernetes/kubernetes-deployment-and-security-patterns/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes Deployment & Security Patterns"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("Book 09: "),t("a",{attrs:{href:"https://thenewstack.io/ebooks/kubernetes/ci-cd-with-kubernetes/",target:"_blank",rel:"noopener noreferrer"}},[e._v("CI/CD with Kubernetes"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("Book 10: "),t("a",{attrs:{href:"https://thenewstack.io/ebooks/kubernetes/kubernetes-solutions-directory/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Kubernetes solutions Directory"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("Book 11: "),t("a",{attrs:{href:"https://thenewstack.io/ebooks/microservices/cloud-native-microservices-2018/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Guid to Cloud-Native Microservices"),t("OutboundLink")],1)])])])]),e._v(" "),e._m(10),e._v(" "),t("p",[e._v("总结一下今天的内容。Docker 和 Kubernetes已经成为分布式架构和自动化运维方面的不可或缺的两大基本构成,是你必需要学习的。虽然它们的玩法跟传统运维不一样,但技术方面并不算复杂,只要你花上一点时间,一定会学好的。")]),e._v(" "),t("p",[e._v("在这篇文章中,我推荐了Docker和Kubernetes基础技术方面的学习资料,并给出了存储、运维、网络、CI/CD等多方面的资料,同时列出了与之相关的最佳实践。相信认真学习和消化这些知识,你一定可以掌握Docker和Kubernetes两大利器。")]),e._v(" "),t("p",[e._v("下篇文章,我们将学习机器学习和人工智能方面的内容。敬请期待。")]),e._v(" "),t("p",[e._v("下面是《程序员练级攻略(2018)》系列文章的目录。")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/8136",target:"_blank",rel:"noopener noreferrer"}},[e._v("开篇词"),t("OutboundLink")],1)]),e._v(" "),t("li",[e._v("入门篇\n"),t("ul",[t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/8216",target:"_blank",rel:"noopener noreferrer"}},[e._v("零基础启蒙"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/8217",target:"_blank",rel:"noopener noreferrer"}},[e._v("正式入门"),t("OutboundLink")],1)])])]),e._v(" "),t("li",[e._v("修养篇\n"),t("ul",[t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/8700",target:"_blank",rel:"noopener noreferrer"}},[e._v("程序员修养"),t("OutboundLink")],1)])])]),e._v(" "),t("li",[e._v("专业基础篇\n"),t("ul",[t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/8701",target:"_blank",rel:"noopener noreferrer"}},[e._v("编程语言"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/8887",target:"_blank",rel:"noopener noreferrer"}},[e._v("理论学科"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/8888",target:"_blank",rel:"noopener noreferrer"}},[e._v("系统知识"),t("OutboundLink")],1)])])]),e._v(" "),t("li",[e._v("软件设计篇\n"),t("ul",[t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/9369",target:"_blank",rel:"noopener noreferrer"}},[e._v("软件设计"),t("OutboundLink")],1)])])]),e._v(" "),t("li",[e._v("高手成长篇\n"),t("ul",[t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/9759",target:"_blank",rel:"noopener noreferrer"}},[e._v("Linux系统、内存和网络(系统底层知识)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/9851",target:"_blank",rel:"noopener noreferrer"}},[e._v("异步I/O模型和Lock-Free编程(系统底层知识)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/10216",target:"_blank",rel:"noopener noreferrer"}},[e._v("Java底层知识"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/10301",target:"_blank",rel:"noopener noreferrer"}},[e._v("数据库"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/10603",target:"_blank",rel:"noopener noreferrer"}},[e._v("分布式架构入门(分布式架构)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/10604",target:"_blank",rel:"noopener noreferrer"}},[e._v("分布式架构经典图书和论文(分布式架构)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/11232",target:"_blank",rel:"noopener noreferrer"}},[e._v("分布式架构工程设计(分布式架构)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/11116",target:"_blank",rel:"noopener noreferrer"}},[e._v("微服务"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/11665",target:"_blank",rel:"noopener noreferrer"}},[e._v("容器化和自动化运维"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/11669",target:"_blank",rel:"noopener noreferrer"}},[e._v("机器学习和人工智能"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/12271",target:"_blank",rel:"noopener noreferrer"}},[e._v("前端基础和底层原理(前端方向)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/12389",target:"_blank",rel:"noopener noreferrer"}},[e._v("前端性能优化和框架(前端方向)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/12486",target:"_blank",rel:"noopener noreferrer"}},[e._v("UI/UX设计(前端方向)"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://time.geekbang.org/column/article/12561",target:"_blank",rel:"noopener noreferrer"}},[e._v("技术资源集散地"),t("OutboundLink")],1)])])])]),e._v(" "),e._m(11)])},[function(){var e=this.$createElement,r=this._self._c||e;return r("h1",{attrs:{id:"docker"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#docker","aria-hidden":"true"}},[this._v("#")]),this._v(" Docker")])},function(){var e=this.$createElement,r=this._self._c||e;return r("p",[r("strong",[this._v("最佳实践")])])},function(){var e=this.$createElement,r=this._self._c||e;return r("h1",{attrs:{id:"kubernetes"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#kubernetes","aria-hidden":"true"}},[this._v("#")]),this._v(" Kubernetes")])},function(){var e=this,r=e.$createElement,t=e._self._c||r;return t("ul",[t("li",[e._v("基于容器的应用部署、维护和滚动升级;")]),e._v(" "),t("li",[e._v("负载均衡和服务发现;")]),e._v(" "),t("li",[e._v("跨机器和跨地区的集群调度;")]),e._v(" "),t("li",[e._v("自动伸缩;")]),e._v(" "),t("li",[e._v("无状态服务和有状态服务;")]),e._v(" "),t("li",[e._v("广泛的Volume支持;")]),e._v(" "),t("li",[e._v("插件机制保证扩展性。")])])},function(){var e=this.$createElement,r=this._self._c||e;return r("p",[r("strong",[this._v("一些交互式教程")])])},function(){var e=this.$createElement,r=this._self._c||e;return r("p",[r("strong",[this._v("一些文章")])])},function(){var e=this.$createElement,r=this._self._c||e;return r("p",[r("strong",[this._v("网络相关的文章")])])},function(){var e=this.$createElement,r=this._self._c||e;return r("p",[r("strong",[this._v("CI/CD相关的文章")])])},function(){var e=this.$createElement,r=this._self._c||e;return r("p",[r("strong",[this._v("最佳实践")])])},function(){var e=this.$createElement,r=this._self._c||e;return r("p",[r("strong",[this._v("Docker和Kubernetes资源汇总")])])},function(){var e=this.$createElement,r=this._self._c||e;return r("h1",{attrs:{id:"小结"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#小结","aria-hidden":"true"}},[this._v("#")]),this._v(" 小结")])},function(){var e=this.$createElement,r=this._self._c||e;return r("p",[r("img",{attrs:{src:"https://static001.geekbang.org/resource/image/fc/e9/fcc761001867c60f526665e237f831e9.jpg",alt:""}})])}],!1,null,null,null);r.default=o.exports}}]);
class PokedexSearchResultsController { constructor() { this.regExp = /\/(\d+)/i; console.log('Search results component ready.'); } } angular.module('pokedex').component('pokedexSearchResults', { templateUrl: 'components/pokedex/search-results/pokedex-search-results.template.html', controller: PokedexSearchResultsController, bindings: { allPokemon: '<', searchText: '<', getOnePokemon: '&', }, });
(function(a,b){if('function'==typeof define&&define.amd)define(['exports','react'],b);else if('undefined'!=typeof exports)b(exports,require('react'));else{var c={exports:{}};b(c.exports,a.react),a.twitch=c.exports}})(this,function(a,b){'use strict';Object.defineProperty(a,'__esModule',{value:!0});var e=function(h){return h&&h.__esModule?h:{default:h}}(b),f=Object.assign||function(h){for(var k,j=1;j<arguments.length;j++)for(var l in k=arguments[j],k)Object.prototype.hasOwnProperty.call(k,l)&&(h[l]=k[l]);return h};a.default=function(h){var j=/^\<svg [^>]+\>(.*)<\/svg>/ig.exec('<svg xmlns="http://www.w3.org/2000/svg" baseProfile="full" viewBox="0 0 24 24"><path d="M4 2h18v12l-5 5h-4l-3 3H7v-3H2V6l2-4zm16 11V4H6v12h3v3l3-3h5l3-3zm-5-6h2v5h-2V7zm-3 0v5h-2V7h2z"/></svg>')[1];return e.default.createElement('svg',f({},h,{xmlns:'http://www.w3.org/2000/svg',baseProfile:'full',viewBox:'0 0 24 24',className:'react-pretty-icons react-pretty-icons__twitch '+h.className,dangerouslySetInnerHTML:{__html:j}}))},module.exports=a.default});
(window.webpackJsonp=window.webpackJsonp||[]).push([[66],{2955:function(e,t,n){"use strict";n.r(t),n.d(t,"icon",(function(){return c}));n(11),n(2),n(7),n(8),n(5),n(9);var r=n(0),a=n.n(r);function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=function(e){var t=e.title,n=e.titleId,r=o(e,["title","titleId"]);return a.a.createElement("svg",i({width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},r),t?a.a.createElement("title",{id:n},t):null,a.a.createElement("path",{d:"M8 14A6 6 0 108 2a6 6 0 000 12zm0 1A7 7 0 118 1a7 7 0 010 14zm0-3a4 4 0 100-8 4 4 0 000 8zm0-1a3 3 0 110-6 3 3 0 010 6zm0-2a1 1 0 100-2 1 1 0 000 2z"}))},c=l;l.__docgenInfo={description:"",methods:[],displayName:"EuiIconBullseye"}}}]); //# sourceMappingURL=icon.bullseye-js.min.js.map
const CustomError = require("../extensions/custom-error"); module.exports = class DepthCalculator { calculateDepth(arr) { if (arr.length === 0) return 1; return Array.isArray(arr) ? 1 + Math.max(...arr.map((el) => this.calculateDepth(el))) : 0; // remove line with error and write your code here } };
"use strict" exports.__esModule = true; exports.StrikethroughIconConfig = { name: 'StrikethroughIcon', height: 512, width: 512, svgPath: 'M496 224H293.9l-87.17-26.83A43.55 43.55 0 0 1 219.55 112h66.79A49.89 49.89 0 0 1 331 139.58a16 16 0 0 0 21.46 7.15l42.94-21.47a16 16 0 0 0 7.16-21.46l-.53-1A128 128 0 0 0 287.51 32h-68a123.68 123.68 0 0 0-123 135.64c2 20.89 10.1 39.83 21.78 56.36H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h480a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm-180.24 96A43 43 0 0 1 336 356.45 43.59 43.59 0 0 1 292.45 400h-66.79A49.89 49.89 0 0 1 181 372.42a16 16 0 0 0-21.46-7.15l-42.94 21.47a16 16 0 0 0-7.16 21.46l.53 1A128 128 0 0 0 224.49 480h68a123.68 123.68 0 0 0 123-135.64 114.25 114.25 0 0 0-5.34-24.36z', yOffset: 0, xOffset: 0, transform: '' }; exports.StrikethroughIcon = require('../createIcon').createIcon(exports.StrikethroughIconConfig); exports["default"] = exports.StrikethroughIcon;
import React, { Component } from "react"; import SlideDown, { SlideDownContent } from "../CommonElement/SlideDown"; export default class AdvanceConfigLayout extends Component { render() { const gasOptions = [ { key: 'sf', text: this.props.translate("super_fast") || 'Super Fast', value: this.props.gasPriceSuggest.superFastGas }, { key: 'f', text: this.props.translate("fast") || 'Fast', value: this.props.gasPriceSuggest.fastGas }, { key: 's', text: this.props.translate("standard") || 'Standard', value: this.props.gasPriceSuggest.standardGas }, { key: 'l', text: this.props.translate("low") || 'Slow', value: this.props.gasPriceSuggest.safeLowGas } ]; return ( <SlideDown active={this.props.isAdvanceActive}> <SlideDownContent> <div className="advance-config theme__text-4"> <div className={`advance-config__gas ${this.props.type === 'transfer' ? 'advance-config__gas--no-border' : ''} theme__border-2`}> <div className="advance-config__title">{this.props.translate("transaction.gas_fee") || "GAS fee"} (Gwei)</div> <div className="advance-config__option-container"> {gasOptions.map((item, index) => { return ( <label className="advance-config__option advance-config__option--gas" key={index}> <div className="advance-config__gas-amount">{item.value}</div> <div className="advance-config__gas-mode">{item.text}</div> <input className="advance-config__radio" type="radio" name="gasAmount" value={item.key} defaultChecked={this.props.selectedGas == item.key} onChange={() => this.props.selectedGasHandler(item.value, item.key, item.text)} /> <span className="advance-config__checkmark advance-config__checkmark--top theme__radio-button"/> </label> ) })} </div> </div> {this.props.minConversionRate} </div> </SlideDownContent> </SlideDown> ) } }
import styled from 'styled-components'; const PostCategories = ({ categoreis }) => ( <div> {() => { console.log(categoreis); }} </div> ); export default PostCategories;
import React from 'react'; import { compose } from 'redux'; import { connect } from 'react-redux'; import { withTranslation } from 'react-i18next'; import { orderBy } from 'lodash'; import manifest from '../../../utils/manifest'; import * as enums from '../../../utils/destinyEnums'; import Records from '../../Records'; import './styles.css'; class NightmareHunts extends React.Component { render() { const { t, member } = this.props; const characterActivities = member.data.profile.characterActivities.data; // const nightmareStrings = Object.values(manifest.DestinyActivityDefinition).filter(a => a.destinationHash === 290444260 && a.directActivityModeType === 2 && a.displayProperties?.name && a.displayProperties?.name !== '' && a.displayProperties.name.indexOf('Nightmare') > -1); // const lol = nightmareStrings.map(def => { // return (`{ // storyHash: ${def.hash}, // ${def.displayProperties.name.replace('Nightmare Hunt: ', '')} // activities: ${JSON.stringify(Object.values(manifest.DestinyActivityDefinition).filter(a => a.destinationHash === 290444260 && a.hash !== def.hash && a.displayProperties?.name && a.displayProperties?.name !== '' && a.displayProperties.name.indexOf(def.displayProperties.name) > -1).map(d => d.hash))} // }`) // }).join(',\n') //const activeHunts = characterActivities[member.characterId].availableActivities.filter(a => nightmareHunts.find(h => h.activities.includes(a.activityHash))); const activeHunts = enums.nightmareHunts.filter(h => h.activities.find(a => characterActivities[member.characterId].availableActivities.find(c => c.activityHash === a))); // console.log(activeHunts); return ( <div className='user-module nightmare-hunts'> <div className='sub-header'> <div>{manifest.DestinyDestinationDefinition[290444260].displayProperties?.name}</div> </div> <h3>{t('Nightmare Hunts')}</h3> <div className='text'> <p>{t('Your most feared, devastating, tormenting nightmares reincarnate―be immovable in your resolve, Guardian.')}</p> <p> <em>{t(`Hunt down this week's available nightmares for... satisfaction.`)}</em> </p> </div> <h4>{t('Available activities')}</h4> {activeHunts.length ? ( <> <ul className='list activities'> {activeHunts.map((a, i) => { const masterHash = orderBy(a.activities, [hash => manifest.DestinyActivityDefinition[hash].activityLightLevel], ['desc'])?.[0]; const definitionActivity = manifest.DestinyActivityDefinition[masterHash]; return ( <li key={i} className='linked tooltip' data-type='activity' data-hash={definitionActivity.hash} data-mode='175275639'> <div className='name'>{manifest.DestinyActivityDefinition[a.storyHash]?.displayProperties.name.replace('Nightmare Hunt: ', '')}</div> </li> ); })} </ul> <h4>{t('Triumphs')}</h4> <ul className='list record-items'> <Records selfLinkFrom='/this-week' hashes={activeHunts.map((a, i) => a.triumphs).flat()} ordered /> </ul> </> ) : ( <div className='info'>{t("There aren't any activities available to you. Perhaps you don't meet the requirements...")}</div> )} </div> ); } } function mapStateToProps(state, ownProps) { return { member: state.member }; } export default compose(connect(mapStateToProps), withTranslation())(NightmareHunts);
import { connect } from 'react-redux' import { getSubjects } from '../../../actions/' import HomeLook from './look' import { getPageFormatter } from '../../../components/List' import uuid from 'uuid/v4' const mapStateToProps = (state) => ({ user: state.get("user"), count: state.get("global").subjectCount }) const mapDispatchToProps = (dispatch, state) => ({ getBigPictures: getPageFormatter(dispatch, getSubjects) }) const Home = connect(mapStateToProps, mapDispatchToProps)(HomeLook) export default Home
const path = require('path'); const get = require('lodash.get'); const slugify = require('@sindresorhus/slugify'); const visit = require('unist-util-visit'); const rawMDX = require('@mdx-js/mdx'); const matter = require('gray-matter'); const mdastToString = require('mdast-util-to-string'); const generateUrl = require('./generateUrl'); const compiler = rawMDX.createMdxAstCompiler({ remarkPlugins: [] }); // we're using github-slugger for heading ids so that we're consistent with GitHub & because gatsby-remark-autolink-headers which adds the actual links uses github-slugger const slugs = require('github-slugger')(); const PROJECT_ROOT = path.resolve('..'); // Used for sorting the navigation: const GROUPS = [ '', 'quick-start', 'tutorials', 'guides', 'discussions', 'api', 'list-plugins', 'road-map', ]; const SUB_GROUPS = [ '', 'apps', 'field-types', 'adapters', 'field-adapters', 'api', 'authentication-strategies', 'utilities', ]; exports.createPages = ({ actions, graphql }) => { const { createPage } = actions; const template = path.resolve(`src/templates/docs.js`); // The 'fields' values are injected during the `onCreateNode` call below return graphql(` { allMdx { edges { node { id fields { slug navGroup navSubGroup workspaceSlug sortOrder sortSubOrder order isPackageIndex isIndex pageTitle draft } } } } } `).then(result => { if (result.errors) { return Promise.reject(result.errors); } /* If you end up with multiple ways to generate a markdown page, you will need to split out to new templates, with their own graphql queries */ const pages = result.data.allMdx.edges.filter(page => { const { node: { fields: { draft }, }, } = page; return Boolean(!draft); }); pages.forEach(({ node: { id, fields } }) => { createPage({ path: `${fields.slug}`, component: template, context: { mdPageId: id, ...fields, }, // additional data can be passed via context }); }); }); }; const getEditUrl = absPath => `https://github.com/keystonejs/keystone/edit/master/${path.relative(PROJECT_ROOT, absPath)}`; exports.onCreateNode = async ({ node, actions, getNode }) => { const { createNodeField } = actions; // Only for our markdown files if (get(node, 'internal.type') === `Mdx`) { // Get the parent node which includes info about the file paths, etc const parent = getNode(node.parent); const { sourceInstanceName, relativePath } = parent; const isPackage = !GROUPS.includes(sourceInstanceName); let { data, content } = matter(node.rawBody, { delimiters: ['<!--[meta]', '[meta]-->'] }); const navGroup = data.section; const navSubGroup = data.subSection; const order = data.order || 99999999999; let pageTitle = data.title || ''; const ast = compiler.parse(content); let description; let heading; slugs.reset(); let headingIds = []; visit(ast, node => { if (!description && node.type === 'paragraph') { description = mdastToString(node); } if (!heading && node.type === 'heading' && node.depth === 1) { heading = mdastToString(node); } if (node.type === 'heading') { headingIds.push(slugs.slug(mdastToString(node))); } }); // This value is added in `gatsby-config` as the "name" of the plugin. // Since we scan every workspace and add that as a separate plugin, we // have the opportunity there to add the "name", which we pull from the // workspace's `package.json`, and can use here. const fieldsToAdd = { navGroup: navGroup || null, // Empty string is fine navSubGroup: navSubGroup || null, workspaceSlug: slugify(sourceInstanceName), editUrl: getEditUrl(get(node, 'fileAbsolutePath')), // The full path to this "node" slug: data.slug || generateUrl(parent), sortOrder: GROUPS.indexOf(navGroup) === -1 ? 999999 : GROUPS.indexOf(navGroup), sortSubOrder: SUB_GROUPS.indexOf(navSubGroup) === -1 ? 999999 : SUB_GROUPS.indexOf(navSubGroup), order, isPackageIndex: isPackage && relativePath === 'README.md', isIndex: !isPackage && relativePath === 'index.md', pageTitle: pageTitle, draft: Boolean(data.draft), description, heading, headingIds, }; // see: https://github.com/gatsbyjs/gatsby/issues/1634#issuecomment-388899348 Object.keys(fieldsToAdd) .filter(key => fieldsToAdd[key] !== undefined || fieldsToAdd[key] !== null) .forEach(key => { createNodeField({ node, name: key, value: fieldsToAdd[key], }); }); } };
import React, { forwardRef } from 'react'; import { renderPathForWeight } from '../lib/index.esm.js'; import IconBase from '../lib/IconBase.esm.js'; /* GENERATED FILE */ var pathsByWeight = /*#__PURE__*/new Map(); pathsByWeight.set("bold", function (color) { return React.createElement(React.Fragment, null, React.createElement("path", { d: "M128,52a20,20,0,0,1,40,0v60", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "24" }), React.createElement("path", { d: "M88,68V36a20,20,0,0,1,40,0v68", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "24" }), React.createElement("path", { d: "M128,172a40,40,0,0,1,40-40V112a20,20,0,0,1,40,0v40a80,80,0,0,1-160,0V68a20,20,0,0,1,40,0v44", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "24" })); }); pathsByWeight.set("duotone", function (color) { return React.createElement(React.Fragment, null, React.createElement("path", { d: "M168,112a20,20,0,0,1,40,0v40a80,80,0,0,1-160,0V68a20,20,0,0,1,40,0V36a20,20,0,0,1,40,0V52a20,20,0,0,1,40,0Z", opacity: "0.2" }), React.createElement("path", { d: "M128,52a20,20,0,0,1,40,0v60", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "16" }), React.createElement("path", { d: "M88,68V36a20,20,0,0,1,40,0v68", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "16" }), React.createElement("path", { d: "M128,172a40,40,0,0,1,40-40V112a20,20,0,0,1,40,0v40a80,80,0,0,1-160,0V68a20,20,0,0,1,40,0v44", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "16" })); }); pathsByWeight.set("fill", function () { return React.createElement(React.Fragment, null, React.createElement("path", { d: "M188,84a28.2,28.2,0,0,0-12,2.7V52a28.1,28.1,0,0,0-28-28,27.8,27.8,0,0,0-13.4,3.4A28,28,0,0,0,80,36v6.7A28,28,0,0,0,40,68v84a88,88,0,0,0,176,0V112A28.1,28.1,0,0,0,188,84Zm12,68a72,72,0,0,1-144,0V68a12,12,0,0,1,24,0v44a8,8,0,0,0,16,0V36a12,12,0,0,1,24,0v68a8,8,0,0,0,16,0V52a12,12,0,0,1,24,0v72.7A48,48,0,0,0,120,172a8,8,0,0,0,16,0,32.1,32.1,0,0,1,32-32,8,8,0,0,0,8-8V112a12,12,0,0,1,24,0Z" })); }); pathsByWeight.set("light", function (color) { return React.createElement(React.Fragment, null, React.createElement("path", { d: "M128,52a20,20,0,0,1,40,0v60", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "12" }), React.createElement("path", { d: "M88,68V36a20,20,0,0,1,40,0v68", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "12" }), React.createElement("path", { d: "M128,172a40,40,0,0,1,40-40V112a20,20,0,0,1,40,0v40a80,80,0,0,1-160,0V68a20,20,0,0,1,40,0v44", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "12" })); }); pathsByWeight.set("thin", function (color) { return React.createElement(React.Fragment, null, React.createElement("path", { d: "M128,52a20,20,0,0,1,40,0v60", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "8" }), React.createElement("path", { d: "M88,68V36a20,20,0,0,1,40,0v68", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "8" }), React.createElement("path", { d: "M128,172a40,40,0,0,1,40-40V112a20,20,0,0,1,40,0v40a80,80,0,0,1-160,0V68a20,20,0,0,1,40,0v44", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "8" })); }); pathsByWeight.set("regular", function (color) { return React.createElement(React.Fragment, null, React.createElement("path", { d: "M128,52a20,20,0,0,1,40,0v60", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "16" }), React.createElement("path", { d: "M88,68V36a20,20,0,0,1,40,0v68", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "16" }), React.createElement("path", { d: "M128,172a40,40,0,0,1,40-40V112a20,20,0,0,1,40,0v40a80,80,0,0,1-160,0V68a20,20,0,0,1,40,0v44", fill: "none", stroke: color, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "16" })); }); var renderPath = function renderPath(weight, color) { return renderPathForWeight(weight, color, pathsByWeight); }; var HandPalm = /*#__PURE__*/forwardRef(function (props, ref) { return React.createElement(IconBase, Object.assign({ ref: ref }, props, { renderPath: renderPath })); }); HandPalm.displayName = "HandPalm"; export default HandPalm; //# sourceMappingURL=HandPalm.esm.js.map
const config = require("../config.json"); const path = require('path'); const cote = require('cote'); const sbf4d = require('sbf4d'); const Raven = require('raven'); //Raven.config(config.logging.sentryDSN).install(); let app = new sbf4d.Client({ commandPrefix: '!', owner: '138424630850486272', commandGroups: [ {id: 'trello', name:'Trello'} ], commandsPath: path.join(__dirname, './commands') }); let coteDbRequester = new cote.Requester({ name: 'db-requester', key: "db" }, {log: true}); app.coteDbRequester = coteDbRequester; let insertAndUpdateGuild = (guild) => { let queryParams = { guild_id: guild.id, guild_name: guild.name, guild_memberCount: guild.memberCount, guild_ownerID: guild.ownerID, guild_region: guild.region }; app.coteDbRequester.send({type: "db-guilds-insert-and-update", queryParams}, (res) => { }) }; let insertAndUpdateGuildManagers = (guild) => { insertAndUpdateGuild(guild); let adminMembers = guild.members.filter(member => {return member.hasPermission('ADMINISTRATOR') && !member.user.bot}).array(); if(adminMembers.length < 1) return; for(let i=0; i<adminMembers.length; i++) { insertAndUpdateGuildManager(guild, adminMembers[i]); } }; let insertAndUpdateGuildManager = (guild, member) => { let queryParams = { manager_id: member.id, guild_id: guild.id }; app.coteDbRequester.send({type: "db-guild-managers-insert-and-update", queryParams}, res => { }) }; let leftGuild = (guild_id) => { app.coteDbRequester.send({type: "db-guilds-left", queryParams: {guild_id}}, res => { }) }; app.on('ready', () => { console.log('Bot Has Started Running!'); app.coteDbRequester.send({type: "db-guilds-get-all", queryParams: {}}, res => { let dbGuildIds = res.rows.filter(row => {return row.joined === 1}).map(row => {return row.guild_id}); let clientGuildIds = app.guilds.map(guild => {return guild.id}); for(let i=0; i<dbGuildIds.length; i++) { //check what needs removing if(clientGuildIds.indexOf(dbGuildIds[i]) === -1) { leftGuild(dbGuildIds[i]); } } for(let i=0; i<clientGuildIds.length; i++) { //check what needs adding if(dbGuildIds.indexOf(clientGuildIds[i]) === -1) { insertAndUpdateGuild(app.guilds.get(clientGuildIds[i])); insertAndUpdateGuildManagers(app.guilds.get(clientGuildIds[i])); } } }) }).on('guildCreate', guild => { insertAndUpdateGuildManagers(guild); }).on('guildUpdate', (oldGuild, newGuild) => { insertAndUpdateGuild(newGuild); }).on('guildMemberAdd', guildMember => { insertAndUpdateGuild(guildMember.guild); }).on('guildMemberRemove', guildMember => { insertAndUpdateGuild(guildMember.guild); }).on('guildDelete', guild => { leftGuild(guild.id); }); app.login(config.token);
/* Dependencies */ const request = require('request'); const Promise = require('bluebird'); const _ = require('lodash'); const moment = require('moment'); module.exports = { friendlyName: 'Get current forecast', description: 'Retrieves the forecast of a specific latitude and longitude at a specific time', extendedDescription: '', moreInfoUrl: 'https://developer.forecast.io/docs/v2', cacheable: true, sync: false, idempotent: false, inputs: { lat: { example: '42.3507282', description: 'The latitude of the location you are trying to forecast.', required: true }, lng: { example: '-71.13212709999999', description: 'The longitude of the location you are trying to forecast.', required: true }, time: { example: '2013-05-06T12:00:00-0400', description: 'Any valid Moment.js time (http://momentjs.com)', required: true }, timeFormat: { example: 'YYYY-MM-DD', description: 'Any valid Moment.js time format (http://momentjs.com)', required: true }, options: { example: { 'units': 'si', 'exclude': [ 'currently', 'minutely', 'hourly', 'daily', 'alerts', 'flags' ], 'extend': 'hourly', 'lang': 'es' }, description: 'An object with keys representing the query parameters accepted by the forecast.io API. (https://developer.forecast.io/docs/v2#options)', required: false }, apiKey: { example: 'ab1d526c3c074c2a48c25476c19a9d0a', description: 'This is your Forecast.io API Key.', required: true } }, defaultExit: 'success', exits: { error: { description: 'Unexpected error occurred.' }, invalidLatOrLong: { description: 'You have passed in an invalid latitude or longitude.' }, invalidAPIKey: { description: 'Your Forecast.io API key is not valid.' }, invalidOptions: { description: 'You passed an invalid options object' }, success: { description: 'Returns a weather forecast.', example: '{}' } }, fn: function(inputs, exits) { /** * Make a GET request to the forecast.io API and return the result * @param lat * @param lng * @param time * @param {string} queryString * @returns {Object} */ function getForecast(lat, lng, time, queryString) { try { return new Promise((resolve) => { const apiEndpoint = `https://api.forecast.io/forecast/${inputs.apiKey}/${lat},${lng},${time}${queryString}`; request(apiEndpoint, (error, response, body) => { if (!error && response.statusCode === 200) { try { // If response wrapped in callback, do not JSON.parse response, it isn't valid JSON if (inputs.options && inputs.options.callback) { resolve(body); } else { resolve(JSON.parse(body)); } } catch (e) { return exits.error(`There was an error parsing forecast.io's response: ${e}`); } } else { if (response.statusCode === 403) { return exits.invalidAPIKey(); } else if (response.statusCode === 400) { return exits.error('There was an error formatting a valid API request, please open an issue at github.com/samhagman/machinepack-forecast.io with the options you tried to pass.'); } else { return exits.error(`An error was returned from the forecast.io API with HTTP status code: ${response.statusCode}`); } } }) ; }); } catch (e) { return exits.error(`An error occurred while attempting to make a request to forecast.io: ${e.message}`); } } /** * Validates the inputs * @returns {boolean} */ function validateInputs() { /** * Regular expression to match valid latitude and longitude points. * @type {RegExp} */ const latLongRegEx = /^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/; const validUnits = [ 'us', 'si', 'ca', 'uk', 'auto' ]; const validExcludes = [ 'currently', 'minutely', 'hourly', 'daily', 'alerts', 'flags' ]; const validLanguages = [ 'ar', 'bs', 'de', 'en', 'es', 'fr', 'it', 'nl', 'pl', 'pt', 'ru', 'sv', 'tet', 'tr', 'x-pig-latin', 'zh' ]; // If no API key if (!inputs.apiKey) { return exits.invalidAPIKey(`: ${inputs.apiKey}`); } // If latitude or longitude is invalid else if (!`${inputs.lat}, ${inputs.lng}`.match(latLongRegEx)) { return exits.invalidLatOrLong(); } else if (inputs.options) { if (inputs.options.units !== '' && !_.includes(validUnits, inputs.options.units)) { return exits.invalidOptions(`Your units option (${inputs.options.units}) is not a valid value: ${validUnits}`); } else if (inputs.options.exclude.length !== 0 && _.difference(inputs.options.exclude, validExcludes).length !== 0) { return exits.invalidOptions(`Your exclude option (${inputs.options.exclude}) is not a valid value: ${validExcludes}`); } else if (!_.includes(validLanguages, inputs.options.lang)) { return exits.invalidOptions(`Your language option (${inputs.options.lang}) is not a valid value: ${validLanguages}`); } else if (!moment(inputs.time).isValid()) { return exits.invalidOptions(`Your time input (${inputs.time}) is an invalid date format as accepted by the Moment.js library.`); } } else { return true; } } /** * Turns the inputs.options object into query string parameters for the API request * @returns {string} */ function stringifyOptions() { try { let queryStrings = []; if (inputs.options) { if (inputs.options.callback) { queryStrings.push(`callback=${inputs.options.callback}`); } if (inputs.options.units) { queryStrings.push(`units=${inputs.options.units}`); } if (inputs.options.exclude.length !== 0) { queryStrings.push(`exclude=${inputs.options.exclude.join(',')}`); } if (inputs.options.lang) { queryStrings.push(`lang=${inputs.options.lang}`); } return '?' + queryStrings.join(','); } else { return ''; } } catch (e) { return exits.error(`Error turning options object into query string parameters: ${e}`); } } // Validate the inputs and then get the weather try { if (validateInputs()) { // Turn options object into query string parameters const stringifiedOptions = inputs.options ? stringifyOptions() : ''; // Get the forecast from forecast.io getForecast(inputs.lat, inputs.lng, moment(inputs.time, inputs.timeFormat).format('X'), stringifiedOptions) .then(weather => { return exits.success(weather); }) .catch(err => { return exits.error(`An error occurred while getting the weather from forecast.io: ${err.message}`); }) ; } } catch (e) { return exits.error(`An unexpected error occurred: ${e}`); } } };
import { post } from '../../implementation/app'; function verify(token, email, password, passwordConfirmation) { return post('registration/verify', { token, email, password, passwordConfirmation, }); } function acceptInvitation(email, token, password, passwordConfirmation) { return post('invitation/accept', { email, password, passwordConfirmation, token, }); } function resendInvitation(email) { return post('invitation/resend', { email, }); } export { verify, acceptInvitation, resendInvitation, };
console.error("HALP!") console.warn("DUCK!") console.log("Hey, this is no branch! Its a")
define([],function(){ 'use strict'; var requestAnimFrame = (function() { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function (callback) { window.setTimeout(callback, 1000 / 60); }; }()); function decouple(node, event, fn) { var eve, tracking = false; function captureEvent(e) { eve = e; track(); } function track() { if (!tracking) { requestAnimFrame(update); tracking = true; } } function update() { fn.call(node, eve); tracking = false; } node.addEventListener(event, captureEvent, false); return captureEvent; } return decouple; });
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule XMLHttpRequest * @flow */ 'use strict'; const RCTNetworking = require('RCTNetworking'); const EventTarget = require('event-target-shim'); const base64 = require('base64-js'); const invariant = require('fbjs/lib/invariant'); const warning = require('fbjs/lib/warning'); type ResponseType = '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text'; type Response = ?Object | string; const UNSENT = 0; const OPENED = 1; const HEADERS_RECEIVED = 2; const LOADING = 3; const DONE = 4; const SUPPORTED_RESPONSE_TYPES = { arraybuffer: typeof global.ArrayBuffer === 'function', blob: typeof global.Blob === 'function', document: false, json: true, text: true, '': true, }; const REQUEST_EVENTS = [ 'abort', 'error', 'load', 'loadstart', 'progress', 'timeout', 'loadend', ]; const XHR_EVENTS = REQUEST_EVENTS.concat('readystatechange'); class XMLHttpRequestEventTarget extends EventTarget(...REQUEST_EVENTS) { onload: ?Function; onloadstart: ?Function; onprogress: ?Function; ontimeout: ?Function; onerror: ?Function; onloadend: ?Function; } /** * Shared base for platform-specific XMLHttpRequest implementations. */ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) { static UNSENT: number = UNSENT; static OPENED: number = OPENED; static HEADERS_RECEIVED: number = HEADERS_RECEIVED; static LOADING: number = LOADING; static DONE: number = DONE; UNSENT: number = UNSENT; OPENED: number = OPENED; HEADERS_RECEIVED: number = HEADERS_RECEIVED; LOADING: number = LOADING; DONE: number = DONE; // EventTarget automatically initializes these to `null`. onload: ?Function; onloadstart: ?Function; onprogress: ?Function; ontimeout: ?Function; onerror: ?Function; onloadend: ?Function; onreadystatechange: ?Function; readyState: number = UNSENT; responseHeaders: ?Object; status: number = 0; timeout: number = 0; responseURL: ?string; upload: XMLHttpRequestEventTarget = new XMLHttpRequestEventTarget(); _requestId: ?number; _subscriptions: [any]; _aborted: boolean = false; _cachedResponse: Response; _hasError: boolean = false; _headers: Object; _lowerCaseResponseHeaders: Object; _method: ?string = null; _response: string | ?Object; _responseType: ResponseType; _response: string = ''; _sent: boolean; _url: ?string = null; _timedOut: boolean = false; _trackingName: string = 'unknown'; _incrementalEvents: boolean = false; constructor() { super(); this._reset(); } _reset(): void { this.readyState = this.UNSENT; this.responseHeaders = undefined; this.status = 0; delete this.responseURL; this._requestId = null; this._cachedResponse = undefined; this._hasError = false; this._headers = {}; this._response = ''; this._responseType = ''; this._sent = false; this._lowerCaseResponseHeaders = {}; this._clearSubscriptions(); this._timedOut = false; } get responseType(): ResponseType { return this._responseType; } set responseType(responseType: ResponseType): void { if (this._sent) { throw new Error( 'Failed to set the \'responseType\' property on \'XMLHttpRequest\': The ' + 'response type cannot be set after the request has been sent.' ); } if (!SUPPORTED_RESPONSE_TYPES.hasOwnProperty(responseType)) { warning( false, `The provided value '${responseType}' is not a valid 'responseType'.` ); return; } // redboxes early, e.g. for 'arraybuffer' on ios 7 invariant( SUPPORTED_RESPONSE_TYPES[responseType] || responseType === 'document', `The provided value '${responseType}' is unsupported in this environment.` ); this._responseType = responseType; } get responseText(): string { if (this._responseType !== '' && this._responseType !== 'text') { throw new Error( "The 'responseText' property is only available if 'responseType' " + `is set to '' or 'text', but it is '${this._responseType}'.` ); } if (this.readyState < LOADING) { return ''; } return this._response; } get response(): Response { const {responseType} = this; if (responseType === '' || responseType === 'text') { return this.readyState < LOADING || this._hasError ? '' : this._response; } if (this.readyState !== DONE) { return null; } if (this._cachedResponse !== undefined) { return this._cachedResponse; } switch (responseType) { case 'document': this._cachedResponse = null; break; case 'arraybuffer': this._cachedResponse = base64.toByteArray(this._response).buffer; break; case 'blob': this._cachedResponse = new global.Blob( [base64.toByteArray(this._response).buffer], {type: this.getResponseHeader('content-type') || ''} ); break; case 'json': try { this._cachedResponse = JSON.parse(this._response); } catch (_) { this._cachedResponse = null; } break; default: this._cachedResponse = null; } return this._cachedResponse; } // exposed for testing __didCreateRequest(requestId: number): void { this._requestId = requestId; } // exposed for testing __didUploadProgress( requestId: number, progress: number, total: number ): void { if (requestId === this._requestId) { this.upload.dispatchEvent({ type: 'progress', lengthComputable: true, loaded: progress, total, }); } } __didReceiveResponse( requestId: number, status: number, responseHeaders: ?Object, responseURL: ?string ): void { if (requestId === this._requestId) { this.status = status; this.setResponseHeaders(responseHeaders); this.setReadyState(this.HEADERS_RECEIVED); if (responseURL || responseURL === '') { this.responseURL = responseURL; } else { delete this.responseURL; } } } __didReceiveData(requestId: number, response: string): void { if (requestId !== this._requestId) { return; } this._response = response; this._cachedResponse = undefined; // force lazy recomputation this.setReadyState(this.LOADING); } __didReceiveIncrementalData( requestId: number, responseText: string, progress: number, total: number ) { if (requestId !== this._requestId) { return; } if (!this._response) { this._response = responseText; } else { this._response += responseText; } this.setReadyState(this.LOADING); this.__didReceiveDataProgress(requestId, progress, total); } __didReceiveDataProgress( requestId: number, loaded: number, total: number ): void { if (requestId !== this._requestId) { return; } this.dispatchEvent({ type: 'progress', lengthComputable: total >= 0, loaded, total, }); } // exposed for testing __didCompleteResponse( requestId: number, error: string, timeOutError: boolean ): void { if (requestId === this._requestId) { if (error) { if (this._responseType === '' || this._responseType === 'text') { this._response = error; } this._hasError = true; if (timeOutError) { this._timedOut = true; } } this._clearSubscriptions(); this._requestId = null; this.setReadyState(this.DONE); } } _clearSubscriptions(): void { (this._subscriptions || []).forEach(sub => { sub.remove(); }); this._subscriptions = []; } getAllResponseHeaders(): ?string { if (!this.responseHeaders) { // according to the spec, return null if no response has been received return null; } var headers = this.responseHeaders || {}; return Object.keys(headers).map((headerName) => { return headerName + ': ' + headers[headerName]; }).join('\n'); } getResponseHeader(header: string): ?string { var value = this._lowerCaseResponseHeaders[header.toLowerCase()]; return value !== undefined ? value : null; } setRequestHeader(header: string, value: any): void { if (this.readyState !== this.OPENED) { throw new Error('Request has not been opened'); } this._headers[header.toLowerCase()] = value; } /** * Custom extension for tracking origins of request. */ setTrackingName(trackingName: string): XMLHttpRequest { this._trackingName = trackingName; return this; } open(method: string, url: string, async: ?boolean): void { /* Other optional arguments are not supported yet */ if (this.readyState !== this.UNSENT) { throw new Error('Cannot open, already sending'); } if (async !== undefined && !async) { // async is default throw new Error('Synchronous http requests are not supported'); } if (!url) { throw new Error('Cannot load an empty url'); } this._method = method.toUpperCase(); this._url = url; this._aborted = false; this.setReadyState(this.OPENED); } send(data: any): void { if (this.readyState !== this.OPENED) { throw new Error('Request has not been opened'); } if (this._sent) { throw new Error('Request has already been sent'); } this._sent = true; const incrementalEvents = this._incrementalEvents || !!this.onreadystatechange || !!this.onprogress; this._subscriptions.push(RCTNetworking.addListener( 'didSendNetworkData', (args) => this.__didUploadProgress(...args) )); this._subscriptions.push(RCTNetworking.addListener( 'didReceiveNetworkResponse', (args) => this.__didReceiveResponse(...args) )); this._subscriptions.push(RCTNetworking.addListener( 'didReceiveNetworkData', (args) => this.__didReceiveData(...args) )); this._subscriptions.push(RCTNetworking.addListener( 'didReceiveNetworkIncrementalData', (args) => this.__didReceiveIncrementalData(...args) )); this._subscriptions.push(RCTNetworking.addListener( 'didReceiveNetworkDataProgress', (args) => this.__didReceiveDataProgress(...args) )); this._subscriptions.push(RCTNetworking.addListener( 'didCompleteNetworkResponse', (args) => this.__didCompleteResponse(...args) )); let nativeResponseType = 'text'; if (this._responseType === 'arraybuffer' || this._responseType === 'blob') { nativeResponseType = 'base64'; } invariant(this._method, 'Request method needs to be defined.'); invariant(this._url, 'Request URL needs to be defined.'); RCTNetworking.sendRequest( this._method, this._trackingName, this._url, this._headers, data, nativeResponseType, incrementalEvents, this.timeout, this.__didCreateRequest.bind(this), ); } abort(): void { this._aborted = true; if (this._requestId) { RCTNetworking.abortRequest(this._requestId); } // only call onreadystatechange if there is something to abort, // below logic is per spec if (!(this.readyState === this.UNSENT || (this.readyState === this.OPENED && !this._sent) || this.readyState === this.DONE)) { this._reset(); this.setReadyState(this.DONE); } // Reset again after, in case modified in handler this._reset(); } setResponseHeaders(responseHeaders: ?Object): void { this.responseHeaders = responseHeaders || null; var headers = responseHeaders || {}; this._lowerCaseResponseHeaders = Object.keys(headers).reduce((lcaseHeaders, headerName) => { lcaseHeaders[headerName.toLowerCase()] = headers[headerName]; return lcaseHeaders; }, {}); } setReadyState(newState: number): void { this.readyState = newState; this.dispatchEvent({type: 'readystatechange'}); if (newState === this.DONE && !this._aborted) { if (this._hasError) { if (this._timedOut) { this.dispatchEvent({type: 'timeout'}); } else { this.dispatchEvent({type: 'error'}); } } else { this.dispatchEvent({type: 'load'}); } } } /* global EventListener */ addEventListener(type: string, listener: EventListener): void { // If we dont' have a 'readystatechange' event handler, we don't // have to send repeated LOADING events with incremental updates // to responseText, which will avoid a bunch of native -> JS // bridge traffic. if (type === 'readystatechange' || type === 'progress') { this._incrementalEvents = true; } super.addEventListener(type, listener); } } module.exports = XMLHttpRequest;
(window.webpackJsonpreact_ads=window.webpackJsonpreact_ads||[]).push([[69],{294:function(e,r,t){"use strict";t.d(r,"a",(function(){return o}));var n=t(277),a=t(300),i=t(286),s=t.n(i),d=t(282);var o=function(){var e=[],r={};return r.addWinningBid=function(r){var t=s()(e,(function(e){return e.getAuctionId()===r.auctionId}));t?(r.status=d.BID_STATUS.RENDERED,t.addWinningBid(r)):Object(n.logWarn)("Auction not found when adding winning bid")},r.getAllWinningBids=function(){return e.map((function(e){return e.getWinningBids()})).reduce(n.flatten,[])},r.getBidsRequested=function(){return e.map((function(e){return e.getBidRequests()})).reduce(n.flatten,[])},r.getNoBids=function(){return e.map((function(e){return e.getNoBids()})).reduce(n.flatten,[])},r.getBidsReceived=function(){return e.map((function(e){if(e.getAuctionStatus()===a.a)return e.getBidsReceived()})).reduce(n.flatten,[]).filter((function(e){return e}))},r.getAdUnits=function(){return e.map((function(e){return e.getAdUnits()})).reduce(n.flatten,[])},r.getAdUnitCodes=function(){return e.map((function(e){return e.getAdUnitCodes()})).reduce(n.flatten,[]).filter(n.uniques)},r.createAuction=function(r){var t=r.adUnits,n=r.adUnitCodes,i=r.callback,s=r.cbTimeout,d=r.labels,o=r.auctionId,u=Object(a.k)({adUnits:t,adUnitCodes:n,callback:i,cbTimeout:s,labels:d,auctionId:o});return function(r){e.push(r)}(u),u},r.findBidByAdId=function(r){return s()(e.map((function(e){return e.getBidsReceived()})).reduce(n.flatten,[]),(function(e){return e.adId===r}))},r.getStandardBidderAdServerTargeting=function(){return Object(a.j)()[d.JSON_MAPPING.ADSERVER_TARGETING]},r.setStatusForBids=function(t,n){var a=r.findBidByAdId(t);if(a&&(a.status=n),a&&n===d.BID_STATUS.BID_TARGETING_SET){var i=s()(e,(function(e){return e.getAuctionId()===a.auctionId}));i&&i.setBidTargeting(a)}},r.getLastAuctionId=function(){return e.length&&e[e.length-1].getAuctionId()},r}()},51:function(e,r,t){"use strict";t.r(r),t.d(r,"spec",(function(){return T}));var n=t(287),a=t(277),i=t(280),s=t(278),d=t(279),o=t(294),u=t(286),c=t.n(u),p=t(283),l=t.n(p),m=t(316);function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(){return(g=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function v(e){return function(e){if(Array.isArray(e)){for(var r=0,t=new Array(e.length);r<e.length;r++)t[r]=e[r];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var b="https://ib.adnxs.com/ut/v3/prebid",y=["id","mimes","minduration","maxduration","startdelay","skippable","playback_method","frameworks"],h=["age","externalUid","segments","gender","dnt","language"],_=["geo","device_id"],I=["enabled","dongle","member_id","debug_timeout"],A={body:"description",body2:"desc2",cta:"ctatext",image:{serverName:"main_image",requiredParams:{required:!0}},icon:{serverName:"icon",requiredParams:{required:!0}},sponsoredBy:"sponsored_by",privacyLink:"privacy_link",salePrice:"saleprice",displayUrl:"displayurl"},k=/\/\/cdn\.adnxs\.com\/v/,T={code:"appnexus",aliases:["appnexusAst","brealtime","emxdigital","pagescience","defymedia","gourmetads","matomy","featureforward","oftmedia","districtm","adasta"],supportedMediaTypes:[d.b,d.d,d.c],isBidRequestValid:function(e){return!!(e.params.placementId||e.params.member&&e.params.invCode)},buildRequests:function(e,r){var t=e.map(R),n=c()(e,E),s={};!0===i.b.getConfig("coppa")&&(s={coppa:!0}),n&&Object.keys(n.params.user).filter((function(e){return l()(h,e)})).forEach((function(e){return s[e]=n.params.user[e]}));var d,o=c()(e,O);o&&o.params&&o.params.app&&(d={},Object.keys(o.params.app).filter((function(e){return l()(_,e)})).forEach((function(e){return d[e]=o.params.app[e]})));var u,p=c()(e,U);p&&p.params&&o.params.app&&o.params.app.id&&(u={appid:p.params.app.id});var m={},f={},g=a.getCookie("apn_prebid_debug")||null;if(g)try{m=JSON.parse(g)}catch(e){a.logError("AppNexus Debug Auction Cookie Error:\n\n"+e)}else{var y=c()(e,N);y&&y.debug&&(m=y.debug)}m&&m.enabled&&Object.keys(m).filter((function(e){return l()(I,e)})).forEach((function(e){f[e]=m[e]}));var A=c()(e,B),k=A?parseInt(A.params.member,10):0,T=e[0].schain,S={tags:v(t),user:s,sdk:{source:"pbjs",version:"3.11.0"},schain:T};if(k>0&&(S.member_id=k),o&&(S.device=d),p&&(S.app=u),i.b.getConfig("adpod.brandCategoryExclusion")&&(S.brand_category_uniqueness=!0),f.enabled&&(S.debug=f,a.logInfo("AppNexus Debug Auction Settings:\n\n"+JSON.stringify(f,null,4))),r&&r.gdprConsent&&(S.gdpr_consent={consent_string:r.gdprConsent.consentString,consent_required:r.gdprConsent.gdprApplies}),r&&r.uspConsent&&(S.us_privacy=r.uspConsent),r&&r.refererInfo){var w={rd_ref:encodeURIComponent(r.refererInfo.referer),rd_top:r.refererInfo.reachedTop,rd_ifs:r.refererInfo.numIframes,rd_stk:r.refererInfo.stack.map((function(e){return encodeURIComponent(e)})).join(",")};S.referrer_detection=w}c()(e,j)&&e.filter(j).forEach((function(e){var r=function(e,r){var t=r.mediaTypes.video,n=t.durationRangeSec,i=t.requireExactDuration,s=function(e){var r=e.adPodDurationSec,t=e.durationRangeSec,n=e.requireExactDuration,i=a.getMinValueFromArray(t),s=Math.floor(r/i);return n?Math.max(s,t.length):s}(r.mediaTypes.video),d=a.getMaxValueFromArray(n),o=e.filter((function(e){return e.uuid===r.bidId})),u=a.fill.apply(a,v(o).concat([s]));if(i){var c=Math.ceil(s/n.length),p=a.chunk(u,c);n.forEach((function(e,r){p[r].map((function(r){P(r,"minduration",e),P(r,"maxduration",e)}))}))}else u.map((function(e){return P(e,"maxduration",d)}));return u}(t,e),n=S.tags.filter((function(r){return r.uuid!==e.bidId}));S.tags=[].concat(v(n),v(r))}));var x=a.deepAccess(e[0],"userId.criteoId");if(x){var C=[];C.push({provider:"criteo",user_id:x}),S.tpuids=C}return function(e,r){var t=[];if(e.tags.length>15){var n=a.deepClone(e);a.chunk(e.tags,15).forEach((function(e){n.tags=e;var a=JSON.stringify(n);t.push({method:"POST",url:b,data:a,bidderRequest:r})}))}else{var i=JSON.stringify(e);t={method:"POST",url:b,data:i,bidderRequest:r}}return t}(S,r)},interpretResponse:function(e,r){var t=this,i=r.bidderRequest;e=e.body;var o=[];if(!e||e.error){var u="in response for ".concat(i.bidderCode," adapter");return e&&e.error&&(u+=": ".concat(e.error)),a.logError(u),o}if(e.tags&&e.tags.forEach((function(e){var r,u=(r=e)&&r.ads&&r.ads.length&&c()(r.ads,(function(e){return e.rtb}));if(u&&0!==u.cpm&&l()(t.supportedMediaTypes,u.ad_type)){var p=function(e,r,t){var i=a.getBidRequest(e.uuid,[t]),o={requestId:e.uuid,cpm:r.cpm,creativeId:r.creative_id,dealId:r.deal_id,currency:"USD",netRevenue:!0,ttl:300,adUnitCode:i.adUnitCode,appnexus:{buyerMemberId:r.buyer_member_id,dealPriority:r.deal_priority,dealCode:r.deal_code}};r.advertiser_id&&(o.meta=g({},o.meta,{advertiserId:r.advertiser_id}));if(r.rtb.video){switch(g(o,{width:r.rtb.video.player_width,height:r.rtb.video.player_height,vastImpUrl:r.notify_url,ttl:3600}),a.deepAccess(i,"mediaTypes.video.context")){case d.a:var u=Object(s.getIabSubCategory)(i.bidder,r.brand_category_id);o.meta=g({},o.meta,{iabSubCatId:u});var p=r.rtb.dealPriority;o.video={context:d.a,durationSeconds:Math.floor(r.rtb.video.duration_ms/1e3),dealTier:p},o.vastUrl=r.rtb.video.asset_url;break;case m.b:if(o.adResponse=e,o.adResponse.ad=o.adResponse.ads[0],o.adResponse.ad.video=o.adResponse.ad.rtb.video,o.vastXml=r.rtb.video.content,r.renderer_url){var l=c()(t.bids,(function(r){return r.bidId===e.uuid})),f=a.deepAccess(l,"renderer.options");o.renderer=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.a.install({id:r.renderer_id,url:r.renderer_url,config:t,loaded:!1,adUnitCode:e});try{i.setRender(q)}catch(e){a.logWarn("Prebid Error calling setRender on renderer",e)}return i.setEventHandlers({impression:function(){return a.logMessage("AppNexus outstream video impression event")},loaded:function(){return a.logMessage("AppNexus outstream video loaded event")},ended:function(){a.logMessage("AppNexus outstream renderer video event"),document.querySelector("#".concat(e)).style.display="none"}}),i}(o.adUnitCode,r,f)}break;case m.a:o.vastUrl=r.notify_url+"&redir="+encodeURIComponent(r.rtb.video.asset_url)}}else if(r.rtb[d.c]){var v=r.rtb[d.c],b=r.viewability.config.replace("src=","data-src="),y=v.javascript_trackers;null==y?y=b:a.isStr(y)?y=[y,b]:y.push(b),o[d.c]={title:v.title,body:v.desc,body2:v.desc2,cta:v.ctatext,rating:v.rating,sponsoredBy:v.sponsored,privacyLink:v.privacy_link,address:v.address,downloads:v.downloads,likes:v.likes,phone:v.phone,price:v.price,salePrice:v.saleprice,clickUrl:v.link.url,displayUrl:v.displayurl,clickTrackers:v.link.click_trackers,impressionTrackers:v.impression_trackers,javascriptTrackers:y},v.main_img&&(o.native.image={url:v.main_img.url,height:v.main_img.height,width:v.main_img.width}),v.icon&&(o.native.icon={url:v.icon.url,height:v.icon.height,width:v.icon.width})}else{g(o,{width:r.rtb.banner.width,height:r.rtb.banner.height,ad:r.rtb.banner.content});try{var h=r.rtb.trackers[0].impression_urls[0],_=a.createTrackPixelHtml(h);o.ad+=_}catch(e){a.logError("Error appending tracking pixel",e)}}return o}(e,u,i);p.mediaType=function(e){var r=e.ad_type;return r===d.d?d.d:r===d.c?d.c:d.b}(u),o.push(p)}})),e.debug&&e.debug.debug_info){var p="AppNexus Debug Auction for Prebid\n\n"+e.debug.debug_info;p=p.replace(/(<td>|<th>)/gm,"\t").replace(/(<\/td>|<\/th>)/gm,"\n").replace(/^<br>/gm,"").replace(/(<br>\n|<br>)/gm,"\n").replace(/<h1>(.*)<\/h1>/gm,"\n\n===== $1 =====\n\n").replace(/<h[2-6]>(.*)<\/h[2-6]>/gm,"\n\n*** $1 ***\n\n").replace(/(<([^>]+)>)/gim,""),a.logMessage("https://console.appnexus.com/docs/understanding-the-debug-auction"),a.logMessage(p)}return o},getMappingFileInfo:function(){return{url:"https://acdn.adnxs.com/prebid/appnexus-mapping/mappings.json",refreshInDays:7}},getUserSyncs:function(e){if(e.iframeEnabled)return[{type:"iframe",url:"https://acdn.adnxs.com/ib/static/usersync/v3/async_usersync.html"}]},transformBidParams:function(e,r){return e=a.convertTypes({member:"string",invCode:"string",placementId:"number",keywords:a.transformBidderParamKeywords},e),r&&(e.use_pmt_rule="boolean"==typeof e.usePaymentRule&&e.usePaymentRule,e.usePaymentRule&&delete e.usePaymentRule,S(e.keywords)&&e.keywords.forEach(w),Object.keys(e).forEach((function(r){var t=a.convertCamelToUnderscore(r);t!==r&&(e[t]=e[r],delete e[r])}))),e},onBidWon:function(e){e.native&&function(e){var r=function(e){var r;if(a.isStr(e)&&x(e))r=e;else if(a.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];x(n)&&(r=n)}return r}(e.native.javascriptTrackers);if(r)for(var t="pbjs_adid="+e.adId+";pbjs_auc="+e.adUnitCode,n=function(e){var r=e.indexOf('src="')+5,t=e.indexOf('"',r);return e.substring(r,t)}(r),i=n.replace("dom_id=%native_dom_id%",t),s=document.getElementsByTagName("iframe"),d=!1,o=0;o<s.length&&!d;o++){var u=s[o];try{var c=u.contentDocument||u.contentWindow.document;if(c)for(var p=c.getElementsByTagName("script"),l=0;l<p.length&&!d;l++){var m=p[l];m.getAttribute("data-src")==n&&(m.setAttribute("src",i),m.setAttribute("data-src",""),m.removeAttribute&&m.removeAttribute("data-src"),d=!0)}}catch(e){if(!(e instanceof DOMException&&"SecurityError"===e.name))throw e}}}(e)}};function S(e){return!!(a.isArray(e)&&e.length>0)}function w(e){S(e.value)&&""===e.value[0]&&delete e.value}function x(e){var r=e.match(k),t=null!=r&&r.length>=1,n=e.match("trk.js"),a=null!=n&&n.length>=1;return e.startsWith("<script")&&a&&t}function R(e){var r,t,n={};if(n.sizes=C(e.sizes),n.primary_size=n.sizes[0],n.ad_types=[],n.uuid=e.bidId,e.params.placementId?n.id=parseInt(e.params.placementId,10):n.code=e.params.invCode,n.allow_smaller_sizes=e.params.allowSmallerSizes||!1,n.use_pmt_rule=e.params.usePaymentRule||!1,n.prebid=!0,n.disable_psa=!0,e.params.reserve&&(n.reserve=e.params.reserve),e.params.position&&(n.position={above:1,below:2}[e.params.position]||0),e.params.trafficSourceCode&&(n.traffic_source_code=e.params.trafficSourceCode),e.params.privateSizes&&(n.private_sizes=C(e.params.privateSizes)),e.params.supplyType&&(n.supply_type=e.params.supplyType),e.params.pubClick&&(n.pubclick=e.params.pubClick),e.params.extInvCode&&(n.ext_inv_code=e.params.extInvCode),e.params.externalImpId&&(n.external_imp_id=e.params.externalImpId),!a.isEmpty(e.params.keywords)){var i=a.transformBidderParamKeywords(e.params.keywords);i.length>0&&i.forEach(w),n.keywords=i}if((e.mediaType===d.c||a.deepAccess(e,"mediaTypes.".concat(d.c)))&&(n.ad_types.push(d.c),0===n.sizes.length&&(n.sizes=C([1,1])),e.nativeParams)){var s=(r=e.nativeParams,t={},Object.keys(r).forEach((function(e){var n=A[e]&&A[e].serverName||A[e]||e,i=A[e]&&A[e].requiredParams;if(t[n]=g({},i,r[e]),(n===A.image.serverName||n===A.icon.serverName)&&t[n].sizes){var s=t[n].sizes;(a.isArrayOfNums(s)||a.isArray(s)&&s.length>0&&s.every((function(e){return a.isArrayOfNums(e)})))&&(t[n].sizes=C(t[n].sizes))}n===A.privacyLink&&(t.privacy_supported=!0)})),t);n[d.c]={layouts:[s]}}var u=a.deepAccess(e,"mediaTypes.".concat(d.d)),p=a.deepAccess(e,"mediaTypes.video.context");(e.mediaType===d.d||u)&&n.ad_types.push(d.d),(e.mediaType===d.d||u&&"outstream"!==p)&&(n.require_asset_url=!0),e.params.video&&(n.video={},Object.keys(e.params.video).filter((function(e){return l()(y,e)})).forEach((function(r){return n.video[r]=e.params.video[r]}))),e.renderer&&(n.video=g({},n.video,{custom_renderer_present:!0}));var m=c()(o.a.getAdUnits(),(function(r){return e.transactionId===r.transactionId}));return m&&m.mediaTypes&&m.mediaTypes.banner&&n.ad_types.push(d.b),0===n.ad_types.length&&delete n.ad_types,n}function C(e){var r=[],t={};if(a.isArray(e)&&2===e.length&&!a.isArray(e[0]))t.width=parseInt(e[0],10),t.height=parseInt(e[1],10),r.push(t);else if("object"===f(e))for(var n=0;n<e.length;n++){var i=e[n];(t={}).width=parseInt(i[0],10),t.height=parseInt(i[1],10),r.push(t)}return r}function E(e){return!!e.params.user}function B(e){return!!parseInt(e.params.member,10)}function O(e){if(e.params)return!!e.params.app}function U(e){return e.params&&e.params.app?!!e.params.app.id:!!e.params.app}function N(e){return!!e.debug}function j(e){return e.mediaTypes&&e.mediaTypes.video&&e.mediaTypes.video.context===d.a}function P(e,r,t){a.isEmpty(e.video)&&(e.video={}),e.video[r]=t}function q(e){e.renderer.push((function(){window.ANOutstreamVideo.renderAd({tagId:e.adResponse.tag_id,sizes:[e.getSize().split("x")],targetId:e.adUnitCode,uuid:e.adResponse.uuid,adResponse:e.adResponse,rendererOptions:e.renderer.getConfig()},z.bind(null,e))}))}function z(e,r,t){e.renderer.handleVideoEvent({id:r,eventName:t})}Object(s.registerBidder)(T)}}]);
import React from "react"; import { Button } from "antd"; function TokenInfo({state, addToken}) { const { tx, minted } = state const url = "https://explorer.pops.one/tx/" + tx; const displayTx = tx.slice(0,6) + "..." + tx.slice(-6); return ( <div> <a href={url} target="_blank">Transaction: {displayTx}</a> <br></br> <p>Minted Token: {minted}</p> <Button onClick={addToken} type='primary'>Add to Wallet</Button> </div> ); } export default TokenInfo;
"use strict"; const chai = require("chai"); const helpers = require("./helpers"); const pass = require("../../../../lib/compiler/passes/report-duplicate-labels"); chai.use(helpers); const expect = chai.expect; describe("compiler pass |reportDuplicateLabels|", () => { describe("in a sequence", () => { it("reports labels duplicate with labels of preceding elements", () => { expect(pass).to.reportError("start = a:'a' a:'a'", { message: "Label \"a\" is already defined", location: { source: undefined, start: { offset: 14, line: 1, column: 15 }, end: { offset: 15, line: 1, column: 16 }, }, diagnostics: [{ message: "Original label location", location: { source: undefined, start: { offset: 8, line: 1, column: 9 }, end: { offset: 9, line: 1, column: 10 }, }, }], }); }); it("doesn't report labels duplicate with labels in subexpressions", () => { expect(pass).to.not.reportError("start = ('a' / a:'a' / 'a') a:'a'"); expect(pass).to.not.reportError("start = (a:'a' { }) a:'a'"); expect(pass).to.not.reportError("start = ('a' a:'a' 'a') a:'a'"); expect(pass).to.not.reportError("start = b:(a:'a') a:'a'"); expect(pass).to.not.reportError("start = $(a:'a') a:'a'"); expect(pass).to.not.reportError("start = &(a:'a') a:'a'"); expect(pass).to.not.reportError("start = !(a:'a') a:'a'"); expect(pass).to.not.reportError("start = (a:'a')? a:'a'"); expect(pass).to.not.reportError("start = (a:'a')* a:'a'"); expect(pass).to.not.reportError("start = (a:'a')+ a:'a'"); expect(pass).to.not.reportError("start = (a:'a') a:'a'"); }); }); describe("in a choice", () => { it("doesn't report labels duplicate with labels of preceding alternatives", () => { expect(pass).to.not.reportError("start = a:'a' / a:'a'"); }); }); describe("in outer sequence", () => { it("reports labels duplicate with labels of preceding elements", () => { expect(pass).to.reportError("start = a:'a' (a:'a')", { message: "Label \"a\" is already defined", location: { source: undefined, start: { offset: 15, line: 1, column: 16 }, end: { offset: 16, line: 1, column: 17 }, }, diagnostics: [{ message: "Original label location", location: { source: undefined, start: { offset: 8, line: 1, column: 9 }, end: { offset: 9, line: 1, column: 10 }, }, }], }); }); it("doesn't report labels duplicate with the label of the current element", () => { expect(pass).to.not.reportError("start = a:(a:'a')"); }); it("doesn't report labels duplicate with labels of following elements", () => { expect(pass).to.not.reportError("start = (a:'a') a:'a'"); }); }); });
import React, { useContext, useMemo } from 'react' const PageContext = React.createContext({ page: null }) export function PageContextProvider({ context, children }) { // eslint-disable-next-line const value = useMemo(() => context, [context.match]) return <PageContext.Provider value={value}>{children}</PageContext.Provider> } export default PageContext export function usePage() { const { page } = useContext(PageContext) return page }
import 'regenerator-runtime' import {Component} from 'doz' /*import logoUrl from '../logo.svg' import DozRouter from 'doz-router'*/ import '../app.css' /*import Nav from './nav' import PageHome from './pages/home' import PageAbout from './pages/about'*/ export default class Main extends Component { template(h) { //language=HTML return h` <style> .line { height: 1px; width: 300px; margin-left: auto; margin-right: auto; background: #aaa; margin-bottom: 20px; } .title { font-size: 48px; font-family: 'Great Vibes', cursive; font-weight: lighter; margin-top: 48px; } .subtitle { font-size: 14px; } .app-container { position: fixed; width: 100%; height: 100%; display: flex; /*justify-content: center;*/ align-items: center; flex-direction: column; background: rgba(0,0,0,0.5); color: white } .socials { margin-top: 16px; } .socials a { color: white; } .fa-instagram, .fa-facebook { font-size: 32px; margin: 0 8px; } </style> <div class="app-container"> <h1 class="title">Lampobot</h1> <div class="line"></div> <h3 class="subtitle">Fabio Ricali,<br>steampunk artist for passion.</h3> <div class="line"></div> <div class="socials"> <a href="https://it-it.facebook.com/lampobot"> <i class="fab fa-facebook"></i> </a> <a href="https://www.instagram.com/lampobot/"> <i class="fab fa-instagram"></i> </a> </div> </div> ` } onCreate() { // Every time a component is mounted on the DOM, // I update the list of links mapped with the "data-router-link" attribute /*this.app.on('componentMountAsync', () => { if (this.router) { this.router.bindLink(); } });*/ } onMountAsync() { if (window.SSR) window.SSR.ready(); } }
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[44],{ /***/ 202: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createNoticesFromResponse; }); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__); /** * External dependencies */ function createNoticesFromResponse(response) { var _dispatch = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["dispatch"])('core/notices'), createNotice = _dispatch.createNotice; if (response.error_data && response.errors && Object.keys(response.errors).length) { // Loop over multi-error responses. Object.keys(response.errors).forEach(function (errorKey) { createNotice('error', response.errors[errorKey].join(' ')); }); } else if (response.message) { // Handle generic messages. createNotice(response.code ? 'error' : 'success', response.message); } } /***/ }), /***/ 264: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getInAppPurchaseUrl; }); /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17); /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27); /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * External dependencies */ /** * WooCommerce dependencies */ /** * Returns an in-app-purchase URL. * * @param {string} url * @param {Object} queryArgs * @return {string} url with in-app-purchase query parameters */ var getInAppPurchaseUrl = function getInAppPurchaseUrl(url) { var queryArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _window$location = window.location, pathname = _window$location.pathname, search = _window$location.search; var connectNonce = Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_2__[/* getSetting */ "g"])('connectNonce', ''); queryArgs = _objectSpread({ 'wccom-site': Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_2__[/* getSetting */ "g"])('siteUrl'), // If the site is installed in a directory the directory must be included in the back param path. 'wccom-back': pathname + search, 'wccom-woo-version': Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_2__[/* getSetting */ "g"])('wcVersion'), 'wccom-connect-nonce': connectNonce }, queryArgs); return Object(_wordpress_url__WEBPACK_IMPORTED_MODULE_1__["addQueryArgs"])(url, queryArgs); }; /***/ }), /***/ 726: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32); /** * External dependencies */ /** * WordPress dependencies */ function FormToggle(_ref) { var className = _ref.className, checked = _ref.checked, id = _ref.id, _ref$onChange = _ref.onChange, onChange = _ref$onChange === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_4__["noop"] : _ref$onChange, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["className", "checked", "id", "onChange"]); var wrapperClasses = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-form-toggle', className, { 'is-checked': checked }); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", { className: wrapperClasses }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("input", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ className: "components-form-toggle__input", id: id, type: "checkbox", checked: checked, onChange: onChange }, props)), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", { className: "components-form-toggle__track" }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", { className: "components-form-toggle__thumb" }), checked ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_5__[/* SVG */ "b"], { className: "components-form-toggle__on", width: "2", height: "6", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2 6" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_5__[/* Path */ "a"], { d: "M0 0h2v6H0z" })) : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_5__[/* SVG */ "b"], { className: "components-form-toggle__off", width: "6", height: "6", "aria-hidden": "true", role: "img", focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 6 6" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_5__[/* Path */ "a"], { d: "M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z" }))); } /* harmony default export */ __webpack_exports__["a"] = (FormToggle); //# sourceMappingURL=index.js.map /***/ }), /***/ 758: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export ALLOWED_TAGS */ /* unused harmony export ALLOWED_ATTR */ /* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(766); /* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dompurify__WEBPACK_IMPORTED_MODULE_0__); /** * External dependencies */ var ALLOWED_TAGS = ['a', 'b', 'em', 'i', 'strong', 'p']; var ALLOWED_ATTR = ['target', 'href', 'rel', 'name', 'download']; /* harmony default export */ __webpack_exports__["a"] = (function (html) { return { __html: Object(dompurify__WEBPACK_IMPORTED_MODULE_0__["sanitize"])(html, { ALLOWED_TAGS: ALLOWED_TAGS, ALLOWED_ATTR: ALLOWED_ATTR }) }; }); /***/ }), /***/ 765: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51); /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38); /* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37); /* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(62); /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(39); /* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(42); /* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26); /* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(67); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(169); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_11__); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(18); /* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__); /* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(43); /* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_data__WEBPACK_IMPORTED_MODULE_13__); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ var Connect = /*#__PURE__*/function (_Component) { _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Connect, _Component); var _super = _createSuper(Connect); function Connect(props) { var _this; _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Connect); _this = _super.call(this, props); _this.state = { isConnecting: false }; _this.connectJetpack = _this.connectJetpack.bind(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this)); props.setIsPending(true); return _this; } _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Connect, [{ key: "componentDidMount", value: function componentDidMount() { var _this$props = this.props, autoConnect = _this$props.autoConnect, jetpackConnectUrl = _this$props.jetpackConnectUrl; if (autoConnect && jetpackConnectUrl) { this.connectJetpack(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props2 = this.props, autoConnect = _this$props2.autoConnect, createNotice = _this$props2.createNotice, error = _this$props2.error, isRequesting = _this$props2.isRequesting, jetpackConnectUrl = _this$props2.jetpackConnectUrl, onError = _this$props2.onError, setIsPending = _this$props2.setIsPending; if (prevProps.isRequesting && !isRequesting) { setIsPending(false); } if (error && error !== prevProps.error) { if (onError) { onError(); } createNotice('error', error); } if (autoConnect && jetpackConnectUrl) { this.connectJetpack(); } } }, { key: "connectJetpack", value: function () { var _connectJetpack = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { var _this$props3, jetpackConnectUrl, onConnect; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this$props3 = this.props, jetpackConnectUrl = _this$props3.jetpackConnectUrl, onConnect = _this$props3.onConnect; this.setState({ isConnecting: true }, function () { if (onConnect) { onConnect(); } window.location = jetpackConnectUrl; }); case 2: case "end": return _context.stop(); } } }, _callee, this); })); function connectJetpack() { return _connectJetpack.apply(this, arguments); } return connectJetpack; }() }, { key: "render", value: function render() { var _this$props4 = this.props, autoConnect = _this$props4.autoConnect, hasErrors = _this$props4.hasErrors, isRequesting = _this$props4.isRequesting, onSkip = _this$props4.onSkip, skipText = _this$props4.skipText; if (autoConnect) { return null; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Fragment"], null, hasErrors ? Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"], { isPrimary: true, onClick: function onClick() { return window.location.reload(); } }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Retry', 'woocommerce')) : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"], { disabled: isRequesting, isBusy: this.state.isConnecting, isPrimary: true, onClick: this.connectJetpack }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('Connect', 'woocommerce')), onSkip && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_9__[/* default */ "a"], { onClick: onSkip }, skipText || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__["__"])('No thanks', 'woocommerce'))); } }]); return Connect; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); Connect.propTypes = { /** * If connection should happen automatically, or requires user confirmation. */ autoConnect: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.bool, /** * Method to create a displayed notice. */ createNotice: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.func.isRequired, /** * Human readable error message. */ error: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.string, /** * Bool to determine if the "Retry" button should be displayed. */ hasErrors: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.bool, /** * Bool to check if the connection URL is still being requested. */ isRequesting: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.bool, /** * Generated Jetpack connection URL. */ jetpackConnectUrl: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.string, /** * Called before the redirect to Jetpack. */ onConnect: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.func, /** * Called when the plugin has an error retrieving the jetpackConnectUrl. */ onError: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.func, /** * Called when the plugin connection is skipped. */ onSkip: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.func, /** * Redirect URL to encode as a URL param for the connection path. */ redirectUrl: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.string, /** * Text used for the skip connection button. */ skipText: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.string, /** * Control the `isPending` logic of the parent containing the Stepper. */ setIsPending: prop_types__WEBPACK_IMPORTED_MODULE_11___default.a.func }; Connect.defaultProps = { autoConnect: false, setIsPending: function setIsPending() {} }; /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withSelect"])(function (select, props) { var _select = select(_woocommerce_data__WEBPACK_IMPORTED_MODULE_13__["PLUGINS_STORE_NAME"]), getJetpackConnectUrl = _select.getJetpackConnectUrl, isPluginsRequesting = _select.isPluginsRequesting, getPluginsError = _select.getPluginsError; var queryArgs = { redirect_url: props.redirectUrl || window.location.href }; var isRequesting = isPluginsRequesting('getJetpackConnectUrl'); var error = getPluginsError('getJetpackConnectUrl') || ''; var jetpackConnectUrl = getJetpackConnectUrl(queryArgs); return { error: error, isRequesting: isRequesting, jetpackConnectUrl: jetpackConnectUrl }; }), Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_12__["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; return { createNotice: createNotice }; }))(Connect)); /***/ }), /***/ 768: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32); /** * WordPress dependencies */ var check = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__[/* SVG */ "b"], { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__[/* Path */ "a"], { d: "M9 18.6L3.5 13l1-1L9 16.4l9.5-9.9 1 1z" })); /* harmony default export */ __webpack_exports__["a"] = (check); //# sourceMappingURL=check.js.map /***/ }), /***/ 774: /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin /***/ }), /***/ 783: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return validateStoreAddress; }); /* unused harmony export getCountryStateOptions */ /* unused harmony export useGetCountryStateAutofill */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return StoreAddress; }); /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80); /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(146); /* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41); /* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(72); /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22); /* harmony import */ var _woocommerce_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(53); /* harmony import */ var _woocommerce_components__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_components__WEBPACK_IMPORTED_MODULE_9__); /** * External dependencies */ /** * Internal dependencies */ var _getSetting = Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_8__[/* getSetting */ "g"])('dataEndpoints', { countries: {} }), countries = _getSetting.countries; /** * Form validation. * * @param {Object} values Keyed values of all fields in the form. * @return {Object} Key value of fields and error messages, { myField: 'This field is required' } */ function validateStoreAddress(values) { var errors = {}; if (!values.addressLine1.length) { errors.addressLine1 = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Please add an address', 'woocommerce'); } if (!values.countryState.length) { errors.countryState = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Please select a country / region', 'woocommerce'); } if (!values.city.length) { errors.city = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Please add a city', 'woocommerce'); } if (!values.postCode.length) { errors.postCode = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Please add a post code', 'woocommerce'); } return errors; } /** * Get all country and state combinations used for select dropdowns. * * @return {Object} Select options, { value: 'US:GA', label: 'United States - Georgia' } */ function getCountryStateOptions() { var countryStateOptions = countries.reduce(function (acc, country) { if (!country.states.length) { acc.push({ key: country.code, label: Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__["decodeEntities"])(country.name) }); return acc; } var countryStates = country.states.map(function (state) { return { key: country.code + ':' + state.code, label: Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__["decodeEntities"])(country.name) + ' — ' + Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__["decodeEntities"])(state.name) }; }); acc.push.apply(acc, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_2___default()(countryStates)); return acc; }, []); return countryStateOptions; } /** * Get the autofill countryState fields and set value from filtered options. * * @param {Array} options Array of filterable options. * @param {string} countryState The value of the countryState field. * @param {Function} setValue Set value of the countryState input. * @return {Object} React component. */ function useGetCountryStateAutofill(options, countryState, setValue) { var _useState = Object(react__WEBPACK_IMPORTED_MODULE_7__["useState"])(''), _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_useState, 2), autofillCountry = _useState2[0], setAutofillCountry = _useState2[1]; var _useState3 = Object(react__WEBPACK_IMPORTED_MODULE_7__["useState"])(''), _useState4 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_useState3, 2), autofillState = _useState4[0], setAutofillState = _useState4[1]; Object(react__WEBPACK_IMPORTED_MODULE_7__["useEffect"])(function () { var filteredOptions = []; var countrySearch = new RegExp(Object(lodash__WEBPACK_IMPORTED_MODULE_6__["escapeRegExp"])(autofillCountry), 'i'); if (autofillState.length || autofillCountry.length) { filteredOptions = options.filter(function (option) { return countrySearch.test(option.label); }); } if (autofillCountry.length && autofillState.length) { var stateSearch = new RegExp(Object(lodash__WEBPACK_IMPORTED_MODULE_6__["escapeRegExp"])(autofillState.replace(/\s/g, '')), 'i'); filteredOptions = filteredOptions.filter(function (option) { return stateSearch.test(option.label.replace('-', '').replace(/\s/g, '')); }); if (filteredOptions.length > 1) { var countryKeyOptions = []; countryKeyOptions = filteredOptions.filter(function (option) { return countrySearch.test(option.key); }); if (countryKeyOptions.length > 0) { filteredOptions = countryKeyOptions; } } if (filteredOptions.length > 1) { var stateKeyOptions = []; stateKeyOptions = filteredOptions.filter(function (option) { return stateSearch.test(option.key); }); if (stateKeyOptions.length === 1) { filteredOptions = stateKeyOptions; } } } if (filteredOptions.length === 1 && countryState !== filteredOptions[0].key) { setValue('countryState', filteredOptions[0].key); } }, [autofillCountry, autofillState]); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["Fragment"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("input", { onChange: function onChange(event) { return setAutofillCountry(event.target.value); }, value: autofillCountry, name: "country", type: "text", className: "woocommerce-select-control__autofill-input", tabIndex: "-1", autoComplete: "country" }), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("input", { onChange: function onChange(event) { return setAutofillState(event.target.value); }, value: autofillState, name: "state", type: "text", className: "woocommerce-select-control__autofill-input", tabIndex: "-1", autoComplete: "address-level1" })); } /** * Store address fields. * * @param {Object} props Props for input components. * @return {Object} - */ function StoreAddress(props) { var getInputProps = props.getInputProps, setValue = props.setValue; var countryStateOptions = Object(react__WEBPACK_IMPORTED_MODULE_7__["useMemo"])(function () { return getCountryStateOptions(); }, []); var countryStateAutofill = useGetCountryStateAutofill(countryStateOptions, getInputProps('countryState').value, setValue); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", { className: "woocommerce-store-address-fields" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_woocommerce_components__WEBPACK_IMPORTED_MODULE_9__["TextControl"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Address line 1', 'woocommerce'), required: true, autoComplete: "address-line1" }, getInputProps('addressLine1'))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_woocommerce_components__WEBPACK_IMPORTED_MODULE_9__["TextControl"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Address line 2 (optional)', 'woocommerce'), required: true, autoComplete: "address-line2" }, getInputProps('addressLine2'))), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_woocommerce_components__WEBPACK_IMPORTED_MODULE_9__["SelectControl"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Country / Region', 'woocommerce'), required: true, options: countryStateOptions, excludeSelectedOptions: false, showAllOnFocus: true, isSearchable: true }, getInputProps('countryState'), { controlClassName: getInputProps('countryState').className }), countryStateAutofill), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_woocommerce_components__WEBPACK_IMPORTED_MODULE_9__["TextControl"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('City', 'woocommerce'), required: true }, getInputProps('city'), { autoComplete: "address-level2" })), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_woocommerce_components__WEBPACK_IMPORTED_MODULE_9__["TextControl"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({ label: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Post code', 'woocommerce'), required: true, autoComplete: "postal-code" }, getInputProps('postCode')))); } /***/ }), /***/ 929: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js var defineProperty = __webpack_require__(17); var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/classCallCheck.js var classCallCheck = __webpack_require__(38); var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createClass.js var createClass = __webpack_require__(37); var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inherits.js var inherits = __webpack_require__(39); var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js var possibleConstructorReturn = __webpack_require__(42); var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/getPrototypeOf.js var getPrototypeOf = __webpack_require__(26); var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf); // EXTERNAL MODULE: external {"this":["wp","element"]} var external_this_wp_element_ = __webpack_require__(0); // EXTERNAL MODULE: external {"this":["wp","i18n"]} var external_this_wp_i18n_ = __webpack_require__(3); // EXTERNAL MODULE: external "lodash" var external_lodash_ = __webpack_require__(2); // EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/compose.js var compose = __webpack_require__(169); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__(8); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js var build_module_button = __webpack_require__(67); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/modal/index.js + 3 modules var modal = __webpack_require__(722); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/text/index.js + 4 modules var build_module_text = __webpack_require__(734); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/card/index.js var card = __webpack_require__(921); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/card/header.js var header = __webpack_require__(922); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/card/body.js var body = __webpack_require__(923); // EXTERNAL MODULE: external {"this":["wp","data"]} var external_this_wp_data_ = __webpack_require__(18); // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js var icon = __webpack_require__(422); // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js var check = __webpack_require__(768); // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js var chevron_right = __webpack_require__(727); // EXTERNAL MODULE: external {"this":["wc","components"]} var external_this_wc_components_ = __webpack_require__(53); // EXTERNAL MODULE: external {"this":["wc","navigation"]} var external_this_wc_navigation_ = __webpack_require__(23); // EXTERNAL MODULE: external {"this":["wc","data"]} var external_this_wc_data_ = __webpack_require__(43); // EXTERNAL MODULE: ./client/task-list/style.scss var style = __webpack_require__(774); // EXTERNAL MODULE: external {"this":["wp","htmlEntities"]} var external_this_wp_htmlEntities_ = __webpack_require__(72); // EXTERNAL MODULE: ./client/settings/index.js var client_settings = __webpack_require__(22); // EXTERNAL MODULE: ./client/dashboard/utils.js var utils = __webpack_require__(753); // EXTERNAL MODULE: ./client/lib/sanitize-html/index.js var sanitize_html = __webpack_require__(758); // EXTERNAL MODULE: ./client/lib/tracks.js var tracks = __webpack_require__(63); // EXTERNAL MODULE: ./client/lib/in-app-purchase.js var in_app_purchase = __webpack_require__(264); // CONCATENATED MODULE: ./client/dashboard/components/cart-modal.js function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ var cart_modal_CartModal = /*#__PURE__*/function (_Component) { inherits_default()(CartModal, _Component); var _super = _createSuper(CartModal); function CartModal(props) { var _this; classCallCheck_default()(this, CartModal); _this = _super.call(this, props); _this.state = { purchaseNowButtonBusy: false, purchaseLaterButtonBusy: false }; return _this; } createClass_default()(CartModal, [{ key: "onClickPurchaseNow", value: function onClickPurchaseNow() { var _this$props = this.props, productIds = _this$props.productIds, onClickPurchaseNow = _this$props.onClickPurchaseNow; this.setState({ purchaseNowButtonBusy: true }); if (!productIds.length) { return; } Object(tracks["b" /* recordEvent */])('tasklist_modal_proceed_checkout', { product_ids: productIds, purchase_install: true }); var url = Object(in_app_purchase["a" /* getInAppPurchaseUrl */])('https://woocommerce.com/cart', { 'wccom-replace-with': productIds.join(',') }); if (onClickPurchaseNow) { onClickPurchaseNow(url); return; } window.location = url; } }, { key: "onClickPurchaseLater", value: function onClickPurchaseLater() { var productIds = this.props.productIds; Object(tracks["b" /* recordEvent */])('tasklist_modal_proceed_checkout', { product_ids: productIds, purchase_install: false }); this.setState({ purchaseLaterButtonBusy: true }); this.props.onClickPurchaseLater(); } }, { key: "onClose", value: function onClose() { var _this$props2 = this.props, onClose = _this$props2.onClose, productIds = _this$props2.productIds; Object(tracks["b" /* recordEvent */])('tasklist_modal_proceed_checkout', { product_ids: productIds, purchase_install: false }); onClose(); } }, { key: "renderProducts", value: function renderProducts() { var productIds = this.props.productIds; var _getSetting = Object(client_settings["g" /* getSetting */])('onboarding', {}), _getSetting$productTy = _getSetting.productTypes, productTypes = _getSetting$productTy === void 0 ? {} : _getSetting$productTy, _getSetting$themes = _getSetting.themes, themes = _getSetting$themes === void 0 ? [] : _getSetting$themes; var listItems = []; productIds.forEach(function (productId) { var productInfo = Object(external_lodash_["find"])(productTypes, function (productType) { return productType.product === productId; }); if (productInfo) { listItems.push({ title: productInfo.label, content: productInfo.description }); } var themeInfo = Object(external_lodash_["find"])(themes, function (theme) { return theme.id === productId; }); if (themeInfo) { listItems.push({ title: Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('%s — %s per year', 'woocommerce'), themeInfo.title, Object(external_this_wp_htmlEntities_["decodeEntities"])(themeInfo.price)), content: Object(external_this_wp_element_["createElement"])("span", { dangerouslySetInnerHTML: Object(sanitize_html["a" /* default */])(themeInfo.excerpt) }) }); } }); return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["List"], { items: listItems }); } }, { key: "render", value: function render() { var _this2 = this; var _this$state = this.state, purchaseNowButtonBusy = _this$state.purchaseNowButtonBusy, purchaseLaterButtonBusy = _this$state.purchaseLaterButtonBusy; return Object(external_this_wp_element_["createElement"])(modal["a" /* default */], { title: Object(external_this_wp_i18n_["__"])('Would you like to purchase and install the following features now?', 'woocommerce'), onRequestClose: function onRequestClose() { return _this2.onClose(); }, className: "woocommerce-cart-modal" }, this.renderProducts(), Object(external_this_wp_element_["createElement"])("p", { className: "woocommerce-cart-modal__help-text" }, Object(external_this_wp_i18n_["__"])("You won't have access to this functionality until the extensions have been purchased and installed.", 'woocommerce')), Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-cart-modal__actions" }, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isLink: true, isBusy: purchaseLaterButtonBusy, onClick: function onClick() { return _this2.onClickPurchaseLater(); } }, Object(external_this_wp_i18n_["__"])("I'll do it later", 'woocommerce')), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, isBusy: purchaseNowButtonBusy, onClick: function onClick() { return _this2.onClickPurchaseNow(); } }, Object(external_this_wp_i18n_["__"])('Purchase & install now', 'woocommerce')))); } }]); return CartModal; }(external_this_wp_element_["Component"]); /* harmony default export */ var cart_modal = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) { var _select = select(external_this_wc_data_["PLUGINS_STORE_NAME"]), getInstalledPlugins = _select.getInstalledPlugins; var _select2 = select(external_this_wc_data_["ONBOARDING_STORE_NAME"]), getProfileItems = _select2.getProfileItems; var profileItems = getProfileItems(); var installedPlugins = getInstalledPlugins(); var productIds = Object(utils["d" /* getProductIdsForCart */])(profileItems, false, installedPlugins); return { profileItems: profileItems, productIds: productIds }; }))(cart_modal_CartModal)); // EXTERNAL MODULE: external {"this":["wp","hooks"]} var external_this_wp_hooks_ = __webpack_require__(48); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/asyncToGenerator.js var asyncToGenerator = __webpack_require__(51); var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/assertThisInitialized.js var assertThisInitialized = __webpack_require__(62); var assertThisInitialized_default = /*#__PURE__*/__webpack_require__.n(assertThisInitialized); // EXTERNAL MODULE: external {"this":["wp","apiFetch"]} var external_this_wp_apiFetch_ = __webpack_require__(21); var external_this_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_apiFetch_); // EXTERNAL MODULE: ./client/wc-api/constants.js var constants = __webpack_require__(33); // CONCATENATED MODULE: ./client/task-list/tasks/appearance.js function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function appearance_createSuper(Derived) { var hasNativeReflectConstruct = appearance_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function appearance_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ var appearance_Appearance = /*#__PURE__*/function (_Component) { inherits_default()(Appearance, _Component); var _super = appearance_createSuper(Appearance); function Appearance(props) { var _this; classCallCheck_default()(this, Appearance); _this = _super.call(this, props); var _getSetting = Object(client_settings["g" /* getSetting */])('onboarding', {}), hasHomepage = _getSetting.hasHomepage, hasProducts = _getSetting.hasProducts; _this.stepVisibility = { homepage: !hasHomepage, import: !hasProducts }; _this.state = { isDirty: false, isPending: false, logo: null, stepIndex: 0, isUpdatingLogo: false, isUpdatingNotice: false, storeNoticeText: props.demoStoreNotice || '' }; _this.completeStep = _this.completeStep.bind(assertThisInitialized_default()(_this)); _this.createHomepage = _this.createHomepage.bind(assertThisInitialized_default()(_this)); _this.importProducts = _this.importProducts.bind(assertThisInitialized_default()(_this)); _this.updateLogo = _this.updateLogo.bind(assertThisInitialized_default()(_this)); _this.updateNotice = _this.updateNotice.bind(assertThisInitialized_default()(_this)); return _this; } createClass_default()(Appearance, [{ key: "componentDidMount", value: function componentDidMount() { var _getSetting2 = Object(client_settings["g" /* getSetting */])('onboarding', {}), themeMods = _getSetting2.themeMods; if (themeMods.custom_logo) { /* eslint-disable react/no-did-mount-set-state */ this.setState({ logo: { id: themeMods.custom_logo } }); /* eslint-enable react/no-did-mount-set-state */ } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this2 = this; var _this$state = this.state, isPending = _this$state.isPending, logo = _this$state.logo; var demoStoreNotice = this.props.demoStoreNotice; if (logo && !logo.url && !isPending) { /* eslint-disable react/no-did-update-set-state */ this.setState({ isPending: true }); wp.media.attachment(logo.id).fetch().then(function () { var logoUrl = wp.media.attachment(logo.id).get('url'); _this2.setState({ isPending: false, logo: { id: logo.id, url: logoUrl } }); }); /* eslint-enable react/no-did-update-set-state */ } if (demoStoreNotice && prevProps.demoStoreNotice !== demoStoreNotice) { /* eslint-disable react/no-did-update-set-state */ this.setState({ storeNoticeText: demoStoreNotice }); /* eslint-enable react/no-did-update-set-state */ } } }, { key: "completeStep", value: function completeStep() { var stepIndex = this.state.stepIndex; var nextStep = this.getSteps()[stepIndex + 1]; if (nextStep) { this.setState({ stepIndex: stepIndex + 1 }); } else { Object(external_this_wc_navigation_["getHistory"])().push(Object(external_this_wc_navigation_["getNewPath"])({}, '/', {})); } } }, { key: "importProducts", value: function importProducts() { var _this3 = this; var createNotice = this.props.createNotice; this.setState({ isPending: true }); Object(tracks["b" /* recordEvent */])('tasklist_appearance_import_demo', {}); external_this_wp_apiFetch_default()({ path: "".concat(constants["f" /* WC_ADMIN_NAMESPACE */], "/onboarding/tasks/import_sample_products"), method: 'POST' }).then(function (result) { if (result.failed && result.failed.length) { createNotice('error', Object(external_this_wp_i18n_["__"])('There was an error importing some of the sample products.', 'woocommerce')); } else { createNotice('success', Object(external_this_wp_i18n_["__"])('All sample products have been imported.', 'woocommerce')); Object(client_settings["h" /* setSetting */])('onboarding', _objectSpread(_objectSpread({}, Object(client_settings["g" /* getSetting */])('onboarding', {})), {}, { hasProducts: true })); } _this3.setState({ isPending: false }); _this3.completeStep(); }).catch(function (error) { createNotice('error', error.message); _this3.setState({ isPending: false }); }); } }, { key: "createHomepage", value: function createHomepage() { var _this4 = this; var createNotice = this.props.createNotice; this.setState({ isPending: true }); Object(tracks["b" /* recordEvent */])('tasklist_appearance_create_homepage', { create_homepage: true }); external_this_wp_apiFetch_default()({ path: '/wc-admin/onboarding/tasks/create_homepage', method: 'POST' }).then(function (response) { createNotice(response.status, response.message, { actions: response.edit_post_link ? [{ label: Object(external_this_wp_i18n_["__"])('Customize', 'woocommerce'), onClick: function onClick() { Object(tracks["a" /* queueRecordEvent */])('tasklist_appearance_customize_homepage', {}); window.location = "".concat(response.edit_post_link, "&wc_onboarding_active_task=homepage"); } }] : null }); _this4.setState({ isPending: false }); _this4.completeStep(); }).catch(function (error) { createNotice('error', error.message); _this4.setState({ isPending: false }); }); } }, { key: "updateLogo", value: function () { var _updateLogo = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { var _this$props, updateOptions, createNotice, logo, _getSetting3, stylesheet, themeMods, updatedThemeMods, update; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this$props = this.props, updateOptions = _this$props.updateOptions, createNotice = _this$props.createNotice; logo = this.state.logo; _getSetting3 = Object(client_settings["g" /* getSetting */])('onboarding', {}), stylesheet = _getSetting3.stylesheet, themeMods = _getSetting3.themeMods; updatedThemeMods = _objectSpread(_objectSpread({}, themeMods), {}, { custom_logo: logo ? logo.id : null }); Object(tracks["b" /* recordEvent */])('tasklist_appearance_upload_logo'); Object(client_settings["h" /* setSetting */])('onboarding', _objectSpread(_objectSpread({}, Object(client_settings["g" /* getSetting */])('onboarding', {})), {}, { themeMods: updatedThemeMods })); this.setState({ isUpdatingLogo: true }); _context.next = 9; return updateOptions(defineProperty_default()({}, "theme_mods_".concat(stylesheet), updatedThemeMods)); case 9: update = _context.sent; if (update.success) { this.setState({ isUpdatingLogo: false }); createNotice('success', Object(external_this_wp_i18n_["__"])('Store logo updated sucessfully.', 'woocommerce')); this.completeStep(); } else { createNotice('error', update.message); } case 11: case "end": return _context.stop(); } } }, _callee, this); })); function updateLogo() { return _updateLogo.apply(this, arguments); } return updateLogo; }() }, { key: "updateNotice", value: function () { var _updateNotice = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { var _this$props2, updateOptions, createNotice, storeNoticeText, update; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _this$props2 = this.props, updateOptions = _this$props2.updateOptions, createNotice = _this$props2.createNotice; storeNoticeText = this.state.storeNoticeText; Object(tracks["b" /* recordEvent */])('tasklist_appearance_set_store_notice', { added_text: Boolean(storeNoticeText.length) }); Object(client_settings["h" /* setSetting */])('onboarding', _objectSpread(_objectSpread({}, Object(client_settings["g" /* getSetting */])('onboarding', {})), {}, { isAppearanceComplete: true })); this.setState({ isUpdatingNotice: true }); _context2.next = 7; return updateOptions({ woocommerce_task_list_appearance_complete: true, woocommerce_demo_store: storeNoticeText.length ? 'yes' : 'no', woocommerce_demo_store_notice: storeNoticeText }); case 7: update = _context2.sent; if (update.success) { this.setState({ isUpdatingNotice: false }); createNotice('success', Object(external_this_wp_i18n_["__"])("🎨 Your store is looking great! Don't forget to continue personalizing it.", 'woocommerce')); this.completeStep(); } else { createNotice('error', update.message); } case 9: case "end": return _context2.stop(); } } }, _callee2, this); })); function updateNotice() { return _updateNotice.apply(this, arguments); } return updateNotice; }() }, { key: "getSteps", value: function getSteps() { var _this5 = this; var _this$state2 = this.state, isDirty = _this$state2.isDirty, isPending = _this$state2.isPending, logo = _this$state2.logo, storeNoticeText = _this$state2.storeNoticeText, isUpdatingLogo = _this$state2.isUpdatingLogo; var steps = [{ key: 'import', label: Object(external_this_wp_i18n_["__"])('Import sample products', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('We’ll add some products that will make it easier to see what your store looks like', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { onClick: this.importProducts, isBusy: isPending, isPrimary: true }, Object(external_this_wp_i18n_["__"])('Import products', 'woocommerce')), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { onClick: function onClick() { return _this5.completeStep(); } }, Object(external_this_wp_i18n_["__"])('Skip', 'woocommerce'))), visible: this.stepVisibility.import }, { key: 'homepage', label: Object(external_this_wp_i18n_["__"])('Create a custom homepage', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('Create a new homepage and customize it to suit your needs', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, isBusy: isPending, onClick: this.createHomepage }, Object(external_this_wp_i18n_["__"])('Create homepage', 'woocommerce')), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { onClick: function onClick() { Object(tracks["b" /* recordEvent */])('tasklist_appearance_create_homepage', { create_homepage: false }); _this5.completeStep(); } }, Object(external_this_wp_i18n_["__"])('Skip', 'woocommerce'))), visible: this.stepVisibility.homepage }, { key: 'logo', label: Object(external_this_wp_i18n_["__"])('Upload a logo', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('Ensure your store is on-brand by adding your logo', 'woocommerce'), content: isPending ? null : Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["ImageUpload"], { image: logo, onChange: function onChange(image) { return _this5.setState({ isDirty: true, logo: image }); } }), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { disabled: !logo && !isDirty, onClick: this.updateLogo, isBusy: isUpdatingLogo, isPrimary: true }, Object(external_this_wp_i18n_["__"])('Proceed', 'woocommerce')), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isTertiary: true, onClick: function onClick() { return _this5.completeStep(); } }, Object(external_this_wp_i18n_["__"])('Skip', 'woocommerce'))), visible: true }, { key: 'notice', label: Object(external_this_wp_i18n_["__"])('Set a store notice', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('Optionally display a prominent notice across all pages of your store', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], { label: Object(external_this_wp_i18n_["__"])('Store notice text', 'woocommerce'), placeholder: Object(external_this_wp_i18n_["__"])('Store notice text', 'woocommerce'), value: storeNoticeText, onChange: function onChange(value) { return _this5.setState({ storeNoticeText: value }); } }), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { onClick: this.updateNotice, isPrimary: true }, Object(external_this_wp_i18n_["__"])('Complete task', 'woocommerce'))), visible: true }]; return Object(external_lodash_["filter"])(steps, function (step) { return step.visible; }); } }, { key: "render", value: function render() { var _this$state3 = this.state, isPending = _this$state3.isPending, stepIndex = _this$state3.stepIndex, isUpdatingLogo = _this$state3.isUpdatingLogo, isUpdatingNotice = _this$state3.isUpdatingNotice; var currentStep = this.getSteps()[stepIndex].key; return Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-appearance" }, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Card"], { className: "is-narrow" }, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Stepper"], { isPending: isUpdatingNotice || isUpdatingLogo || isPending, isVertical: true, currentStep: currentStep, steps: this.getSteps() }))); } }]); return Appearance; }(external_this_wp_element_["Component"]); /* harmony default export */ var appearance = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) { var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]), getOption = _select.getOption; return { demoStoreNotice: getOption('woocommerce_demo_store_notice') }; }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; var _dispatch2 = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]), updateOptions = _dispatch2.updateOptions; return { createNotice: createNotice, updateOptions: updateOptions }; }))(appearance_Appearance)); // EXTERNAL MODULE: ./client/wc-api/with-select.js var with_select = __webpack_require__(101); // CONCATENATED MODULE: ./client/task-list/tasks/connect.js function connect_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function connect_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { connect_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { connect_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function connect_createSuper(Derived) { var hasNativeReflectConstruct = connect_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function connect_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ var connect_Connect = /*#__PURE__*/function (_Component) { inherits_default()(Connect, _Component); var _super = connect_createSuper(Connect); function Connect() { classCallCheck_default()(this, Connect); return _super.apply(this, arguments); } createClass_default()(Connect, [{ key: "componentDidMount", value: function componentDidMount() { document.body.classList.add('woocommerce-admin-is-loading'); var query = this.props.query; if (query.deny === '1') { this.errorMessage(Object(external_this_wp_i18n_["__"])('You must click approve to install your extensions and connect to WooCommerce.com.', 'woocommerce')); return; } if (!query['wccom-connected'] || !query.request_token) { this.request(); return; } this.finish(); } }, { key: "baseQuery", value: function baseQuery() { var query = this.props.query; var baseQuery = Object(external_lodash_["omit"])(connect_objectSpread(connect_objectSpread({}, query), {}, { page: 'wc-admin' }), ['task', 'wccom-connected', 'request_token', 'deny']); return Object(external_this_wc_navigation_["getNewPath"])({}, '/', baseQuery); } }, { key: "errorMessage", value: function errorMessage() { var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Object(external_this_wp_i18n_["__"])('There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce'); document.body.classList.remove('woocommerce-admin-is-loading'); Object(external_this_wc_navigation_["getHistory"])().push(this.baseQuery()); this.props.createNotice('error', message); } }, { key: "request", value: function () { var _request = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { var connectResponse; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.prev = 0; _context.next = 3; return external_this_wp_apiFetch_default()({ path: "".concat(constants["f" /* WC_ADMIN_NAMESPACE */], "/plugins/request-wccom-connect"), method: 'POST' }); case 3: connectResponse = _context.sent; if (!(connectResponse && connectResponse.connectAction)) { _context.next = 7; break; } window.location = connectResponse.connectAction; return _context.abrupt("return"); case 7: throw new Error(); case 10: _context.prev = 10; _context.t0 = _context["catch"](0); this.errorMessage(); case 13: case "end": return _context.stop(); } } }, _callee, this, [[0, 10]]); })); function request() { return _request.apply(this, arguments); } return request; }() }, { key: "finish", value: function () { var _finish = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { var query, connectResponse; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: query = this.props.query; _context2.prev = 1; _context2.next = 4; return external_this_wp_apiFetch_default()({ path: "".concat(constants["f" /* WC_ADMIN_NAMESPACE */], "/plugins/finish-wccom-connect"), method: 'POST', data: { request_token: query.request_token } }); case 4: connectResponse = _context2.sent; if (!(connectResponse && connectResponse.success)) { _context2.next = 10; break; } _context2.next = 8; return this.props.updateProfileItems({ wccom_connected: true }); case 8: if (!this.props.isProfileItemsError) { this.props.createNotice('success', Object(external_this_wp_i18n_["__"])('Store connected to WooCommerce.com and extensions are being installed.', 'woocommerce')); // @todo Show a notice for when extensions are correctly installed. document.body.classList.remove('woocommerce-admin-is-loading'); Object(external_this_wc_navigation_["getHistory"])().push(this.baseQuery()); } else { this.errorMessage(); } return _context2.abrupt("return"); case 10: throw new Error(); case 13: _context2.prev = 13; _context2.t0 = _context2["catch"](1); this.errorMessage(); case 16: case "end": return _context2.stop(); } } }, _callee2, this, [[1, 13]]); })); function finish() { return _finish.apply(this, arguments); } return finish; }() }, { key: "render", value: function render() { return null; } }]); return Connect; }(external_this_wp_element_["Component"]); /* harmony default export */ var tasks_connect = (Object(compose["a" /* default */])(Object(with_select["a" /* default */])(function (select) { var _select = select(external_this_wc_data_["ONBOARDING_STORE_NAME"]), getOnboardingError = _select.getOnboardingError; var isProfileItemsError = Boolean(getOnboardingError('updateProfileItems')); return { isProfileItemsError: isProfileItemsError }; }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; var _dispatch2 = dispatch(external_this_wc_data_["ONBOARDING_STORE_NAME"]), updateProfileItems = _dispatch2.updateProfileItems; return { createNotice: createNotice, updateProfileItems: updateProfileItems }; }))(connect_Connect)); // CONCATENATED MODULE: ./client/task-list/tasks/products.js function products_createSuper(Derived) { var hasNativeReflectConstruct = products_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function products_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ var subTasks = [{ title: Object(external_this_wp_i18n_["__"])('Add manually (recommended)', 'woocommerce'), content: Object(external_this_wp_i18n_["__"])('For small stores we recommend adding products manually', 'woocommerce'), before: Object(external_this_wp_element_["createElement"])("i", { className: "material-icons-outlined" }, "add_box"), after: Object(external_this_wp_element_["createElement"])("i", { className: "material-icons-outlined" }, "chevron_right"), onClick: function onClick() { return Object(tracks["b" /* recordEvent */])('tasklist_add_product', { method: 'manually' }); }, href: Object(client_settings["f" /* getAdminLink */])('post-new.php?post_type=product&wc_onboarding_active_task=products&tutorial=true') }, { title: Object(external_this_wp_i18n_["__"])('Import', 'woocommerce'), content: Object(external_this_wp_i18n_["__"])('For larger stores we recommend importing all products at once via CSV file', 'woocommerce'), before: Object(external_this_wp_element_["createElement"])("i", { className: "material-icons-outlined" }, "import_export"), after: Object(external_this_wp_element_["createElement"])("i", { className: "material-icons-outlined" }, "chevron_right"), onClick: function onClick() { return Object(tracks["b" /* recordEvent */])('tasklist_add_product', { method: 'import' }); }, href: Object(client_settings["f" /* getAdminLink */])('edit.php?post_type=product&page=product_importer&wc_onboarding_active_task=product-import') }, { title: Object(external_this_wp_i18n_["__"])('Migrate', 'woocommerce'), content: Object(external_this_wp_i18n_["__"])('For stores currently selling elsewhere we suggest using a product migration service', 'woocommerce'), before: Object(external_this_wp_element_["createElement"])("i", { className: "material-icons-outlined" }, "cloud_download"), after: Object(external_this_wp_element_["createElement"])("i", { className: "material-icons-outlined" }, "chevron_right"), onClick: function onClick() { return Object(tracks["b" /* recordEvent */])('tasklist_add_product', { method: 'migrate' }); }, // @todo This should be replaced with the in-app purchase iframe when ready. href: 'https://woocommerce.com/products/cart2cart/', target: '_blank' }]; var products_Products = /*#__PURE__*/function (_Component) { inherits_default()(Products, _Component); var _super = products_createSuper(Products); function Products() { classCallCheck_default()(this, Products); return _super.apply(this, arguments); } createClass_default()(Products, [{ key: "render", value: function render() { return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Card"], { className: "woocommerce-task-card" }, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["List"], { items: subTasks }))); } }]); return Products; }(external_this_wp_element_["Component"]); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/extends.js var helpers_extends = __webpack_require__(80); var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends); // EXTERNAL MODULE: ./node_modules/interpolate-components/lib/index.js var lib = __webpack_require__(36); var lib_default = /*#__PURE__*/__webpack_require__.n(lib); // EXTERNAL MODULE: ./client/dashboard/components/connect/index.js var components_connect = __webpack_require__(765); // EXTERNAL MODULE: ./client/dashboard/components/settings/general/store-address.js var store_address = __webpack_require__(783); // CONCATENATED MODULE: ./client/task-list/tasks/steps/location.js function location_createSuper(Derived) { var hasNativeReflectConstruct = location_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function location_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ var location_StoreLocation = /*#__PURE__*/function (_Component) { inherits_default()(StoreLocation, _Component); var _super = location_createSuper(StoreLocation); function StoreLocation() { var _this; classCallCheck_default()(this, StoreLocation); _this = _super.apply(this, arguments); _this.onSubmit = _this.onSubmit.bind(assertThisInitialized_default()(_this)); return _this; } createClass_default()(StoreLocation, [{ key: "onSubmit", value: function () { var _onSubmit = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values) { var _this$props, onComplete, createNotice, isSettingsError, updateAndPersistSettingsForGroup; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this$props = this.props, onComplete = _this$props.onComplete, createNotice = _this$props.createNotice, isSettingsError = _this$props.isSettingsError, updateAndPersistSettingsForGroup = _this$props.updateAndPersistSettingsForGroup; _context.next = 3; return updateAndPersistSettingsForGroup('general', { general: { woocommerce_store_address: values.addressLine1, woocommerce_store_address_2: values.addressLine2, woocommerce_default_country: values.countryState, woocommerce_store_city: values.city, woocommerce_store_postcode: values.postCode } }); case 3: if (!isSettingsError) { onComplete(values); } else { createNotice('error', Object(external_this_wp_i18n_["__"])('There was a problem saving your store location.', 'woocommerce')); } case 4: case "end": return _context.stop(); } } }, _callee, this); })); function onSubmit(_x) { return _onSubmit.apply(this, arguments); } return onSubmit; }() }, { key: "getInitialValues", value: function getInitialValues() { var settings = this.props.settings; var storeAddress = settings.woocommerce_store_address, storeAddress2 = settings.woocommerce_store_address_2, storeCity = settings.woocommerce_store_city, defaultCountry = settings.woocommerce_default_country, storePostcode = settings.woocommerce_store_postcode; return { addressLine1: storeAddress || '', addressLine2: storeAddress2 || '', city: storeCity || '', countryState: defaultCountry || '', postCode: storePostcode || '' }; } }, { key: "render", value: function render() { var isSettingsRequesting = this.props.isSettingsRequesting; if (isSettingsRequesting) { return null; } return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Form"], { initialValues: this.getInitialValues(), onSubmitCallback: this.onSubmit, validate: store_address["b" /* validateStoreAddress */] }, function (_ref) { var getInputProps = _ref.getInputProps, handleSubmit = _ref.handleSubmit, setValue = _ref.setValue; return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(store_address["a" /* StoreAddress */], { getInputProps: getInputProps, setValue: setValue }), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, onClick: handleSubmit }, Object(external_this_wp_i18n_["__"])('Continue', 'woocommerce'))); }); } }]); return StoreLocation; }(external_this_wp_element_["Component"]); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/form-toggle/index.js var form_toggle = __webpack_require__(726); // EXTERNAL MODULE: ./node_modules/prop-types/index.js var prop_types = __webpack_require__(1); var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types); // EXTERNAL MODULE: ./client/lib/currency-context.js var currency_context = __webpack_require__(200); // CONCATENATED MODULE: ./client/task-list/tasks/shipping/rates.js function rates_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function rates_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { rates_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { rates_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function rates_createSuper(Derived) { var hasNativeReflectConstruct = rates_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function rates_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ var rates_ShippingRates = /*#__PURE__*/function (_Component) { inherits_default()(ShippingRates, _Component); var _super = rates_createSuper(ShippingRates); function ShippingRates() { var _this; classCallCheck_default()(this, ShippingRates); _this = _super.apply(this, arguments); _this.updateShippingZones = _this.updateShippingZones.bind(assertThisInitialized_default()(_this)); return _this; } createClass_default()(ShippingRates, [{ key: "getShippingMethods", value: function getShippingMethods(zone) { var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; // Sometimes the wc/v3/shipping/zones response does not include a methods attribute, return early if so. if (!zone || !zone.methods || !Array.isArray(zone.methods)) { return []; } if (!type) { return zone.methods; } return zone.methods ? zone.methods.filter(function (method) { return method.method_id === type; }) : []; } }, { key: "disableShippingMethods", value: function disableShippingMethods(zone, methods) { if (!methods.length) { return; } methods.forEach(function (method) { external_this_wp_apiFetch_default()({ method: 'POST', path: "/wc/v3/shipping/zones/".concat(zone.id, "/methods/").concat(method.instance_id), data: { enabled: false } }); }); } }, { key: "updateShippingZones", value: function () { var _updateShippingZones = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values) { var _this2 = this; var _this$props, createNotice, shippingZones, restOfTheWorld, shippingCost; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this$props = this.props, createNotice = _this$props.createNotice, shippingZones = _this$props.shippingZones; restOfTheWorld = false; shippingCost = false; shippingZones.forEach(function (zone) { if (zone.id === 0) { restOfTheWorld = zone.toggleable && values["".concat(zone.id, "_enabled")]; } else { shippingCost = values["".concat(zone.id, "_rate")] !== '' && parseFloat(values["".concat(zone.id, "_rate")]) !== parseFloat(0); } var shippingMethods = _this2.getShippingMethods(zone); var methodType = parseFloat(values["".concat(zone.id, "_rate")]) === parseFloat(0) ? 'free_shipping' : 'flat_rate'; var shippingMethod = _this2.getShippingMethods(zone, methodType).length ? _this2.getShippingMethods(zone, methodType)[0] : null; if (zone.toggleable && !values["".concat(zone.id, "_enabled")]) { // Disable any shipping methods that exist if toggled off. _this2.disableShippingMethods(zone, shippingMethods); return; } else if (shippingMethod) { // Disable all methods except the one being updated. var methodsToDisable = shippingMethods.filter(function (method) { return method.instance_id !== shippingMethod.instance_id; }); _this2.disableShippingMethods(zone, methodsToDisable); } external_this_wp_apiFetch_default()({ method: 'POST', path: shippingMethod ? // Update the first existing method if one exists, otherwise create a new one. "/wc/v3/shipping/zones/".concat(zone.id, "/methods/").concat(shippingMethod.instance_id) : "/wc/v3/shipping/zones/".concat(zone.id, "/methods"), data: { method_id: methodType, enabled: true, settings: { cost: values["".concat(zone.id, "_rate")] } } }); }); Object(tracks["b" /* recordEvent */])('tasklist_shipping_set_costs', { shipping_cost: shippingCost, rest_world: restOfTheWorld }); // @todo This is a workaround to force the task to mark as complete. // This should probably be updated to use wc-api so we can fetch shipping methods. Object(client_settings["h" /* setSetting */])('onboarding', rates_objectSpread(rates_objectSpread({}, Object(client_settings["g" /* getSetting */])('onboarding', {})), {}, { shippingZonesCount: 1 })); createNotice('success', Object(external_this_wp_i18n_["__"])('Your shipping rates have been updated.', 'woocommerce')); this.props.onComplete(); case 8: case "end": return _context.stop(); } } }, _callee, this); })); function updateShippingZones(_x) { return _updateShippingZones.apply(this, arguments); } return updateShippingZones; }() }, { key: "renderInputPrefix", value: function renderInputPrefix() { var _this$context$getCurr = this.context.getCurrency(), symbolPosition = _this$context$getCurr.symbolPosition, symbol = _this$context$getCurr.symbol; if (symbolPosition.indexOf('right') === 0) { return null; } return Object(external_this_wp_element_["createElement"])("span", { className: "woocommerce-shipping-rate__control-prefix" }, symbol); } }, { key: "renderInputSuffix", value: function renderInputSuffix(rate) { var _this$context$getCurr2 = this.context.getCurrency(), symbolPosition = _this$context$getCurr2.symbolPosition, symbol = _this$context$getCurr2.symbol; if (symbolPosition.indexOf('right') === 0) { return Object(external_this_wp_element_["createElement"])("span", { className: "woocommerce-shipping-rate__control-suffix" }, symbol); } return parseFloat(rate) === parseFloat(0) ? Object(external_this_wp_element_["createElement"])("span", { className: "woocommerce-shipping-rate__control-suffix" }, Object(external_this_wp_i18n_["__"])('Free shipping', 'woocommerce')) : null; } }, { key: "getFormattedRate", value: function getFormattedRate(value) { var formatDecimalString = this.context.formatDecimalString; var currencyString = formatDecimalString(value); if (!value.length || !currencyString.length) { return formatDecimalString(0); } return formatDecimalString(value); } }, { key: "getInitialValues", value: function getInitialValues() { var _this3 = this; var formatDecimalString = this.context.formatDecimalString; var values = {}; this.props.shippingZones.forEach(function (zone) { var shippingMethods = _this3.getShippingMethods(zone); var rate = shippingMethods.length && shippingMethods[0].settings.cost ? _this3.getFormattedRate(shippingMethods[0].settings.cost.value) : formatDecimalString(0); values["".concat(zone.id, "_rate")] = rate; if (shippingMethods.length && shippingMethods[0].enabled) { values["".concat(zone.id, "_enabled")] = true; } else { values["".concat(zone.id, "_enabled")] = false; } }); return values; } }, { key: "validate", value: function validate(values) { var errors = {}; var rates = Object.keys(values).filter(function (field) { return field.endsWith('_rate'); }); rates.forEach(function (rate) { if (values[rate] < 0) { errors[rate] = Object(external_this_wp_i18n_["__"])('Shipping rates can not be negative numbers.', 'woocommerce'); } }); return errors; } }, { key: "render", value: function render() { var _this4 = this; var _this$props2 = this.props, buttonText = _this$props2.buttonText, shippingZones = _this$props2.shippingZones; if (!shippingZones.length) { return null; } return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Form"], { initialValues: this.getInitialValues(), onSubmitCallback: this.updateShippingZones, validate: this.validate }, function (_ref) { var getInputProps = _ref.getInputProps, handleSubmit = _ref.handleSubmit, setTouched = _ref.setTouched, setValue = _ref.setValue, values = _ref.values; return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-shipping-rates" }, shippingZones.map(function (zone) { return Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-shipping-rate", key: zone.id }, Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-shipping-rate__icon" }, zone.locations ? zone.locations.map(function (location) { return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Flag"], { size: 24, code: location.code, key: location.code }); }) : // Icon used for zones without locations or "Rest of the world". Object(external_this_wp_element_["createElement"])("i", { className: "material-icons-outlined" }, "public")), Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-shipping-rate__main" }, zone.toggleable ? Object(external_this_wp_element_["createElement"])("label", { htmlFor: "woocommerce-shipping-rate__toggle-".concat(zone.id), className: "woocommerce-shipping-rate__name" }, zone.name, Object(external_this_wp_element_["createElement"])(form_toggle["a" /* default */], extends_default()({ id: "woocommerce-shipping-rate__toggle-".concat(zone.id) }, getInputProps("".concat(zone.id, "_enabled"))))) : Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-shipping-rate__name" }, zone.name), (!zone.toggleable || values["".concat(zone.id, "_enabled")]) && Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControlWithAffixes"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('Shipping cost', 'woocommerce'), required: true }, getInputProps("".concat(zone.id, "_rate")), { onBlur: function onBlur() { setTouched("".concat(zone.id, "_rate")); setValue("".concat(zone.id, "_rate"), _this4.getFormattedRate(values["".concat(zone.id, "_rate")])); }, prefix: _this4.renderInputPrefix(), suffix: _this4.renderInputSuffix(values["".concat(zone.id, "_rate")]), className: "muriel-input-text woocommerce-shipping-rate__control-wrapper" })))); })), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, onClick: handleSubmit }, buttonText || Object(external_this_wp_i18n_["__"])('Update', 'woocommerce'))); }); } }]); return ShippingRates; }(external_this_wp_element_["Component"]); rates_ShippingRates.propTypes = { /** * Text displayed on the primary button. */ buttonText: prop_types_default.a.string, /** * Function used to mark the step complete. */ onComplete: prop_types_default.a.func.isRequired, /** * Function to create a transient notice in the store. */ createNotice: prop_types_default.a.func.isRequired, /** * Array of shipping zones returned from the WC REST API with added * `methods` and `locations` properties appended from separate API calls. */ shippingZones: prop_types_default.a.array }; rates_ShippingRates.defaultProps = { shippingZones: [] }; rates_ShippingRates.contextType = currency_context["a" /* CurrencyContext */]; /* harmony default export */ var shipping_rates = (rates_ShippingRates); // CONCATENATED MODULE: ./client/task-list/tasks/shipping/index.js function shipping_createSuper(Derived) { var hasNativeReflectConstruct = shipping_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function shipping_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ var shipping_Shipping = /*#__PURE__*/function (_Component) { inherits_default()(Shipping, _Component); var _super = shipping_createSuper(Shipping); function Shipping(props) { var _this; classCallCheck_default()(this, Shipping); _this = _super.call(this, props); _this.initialState = { isPending: false, step: 'store_location', shippingZones: [] }; // Cache active plugins to prevent removal mid-step. _this.activePlugins = props.activePlugins; _this.state = _this.initialState; _this.completeStep = _this.completeStep.bind(assertThisInitialized_default()(_this)); return _this; } createClass_default()(Shipping, [{ key: "componentDidMount", value: function componentDidMount() { this.reset(); } }, { key: "reset", value: function reset() { this.setState(this.initialState); } }, { key: "fetchShippingZones", value: function () { var _fetchShippingZones = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { var _this$props, countryCode, countryName, shippingZones, zones, hasCountryZone, zone; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: this.setState({ isPending: true }); _this$props = this.props, countryCode = _this$props.countryCode, countryName = _this$props.countryName; // @todo The following fetches for shipping information should be moved into // the wc-api to make these methods and states more readily available. shippingZones = []; _context2.next = 5; return external_this_wp_apiFetch_default()({ path: '/wc/v3/shipping/zones' }); case 5: zones = _context2.sent; hasCountryZone = false; _context2.next = 9; return Promise.all(zones.map( /*#__PURE__*/function () { var _ref = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee(zone) { var countryLocation; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: if (!(zone.id === 0)) { _context.next = 8; break; } _context.next = 3; return external_this_wp_apiFetch_default()({ path: "/wc/v3/shipping/zones/".concat(zone.id, "/methods") }); case 3: zone.methods = _context.sent; zone.name = Object(external_this_wp_i18n_["__"])('Rest of the world', 'woocommerce'); zone.toggleable = true; shippingZones.push(zone); return _context.abrupt("return"); case 8: _context.next = 10; return external_this_wp_apiFetch_default()({ path: "/wc/v3/shipping/zones/".concat(zone.id, "/locations") }); case 10: zone.locations = _context.sent; countryLocation = zone.locations.find(function (location) { return countryCode === location.code; }); if (!countryLocation) { _context.next = 18; break; } _context.next = 15; return external_this_wp_apiFetch_default()({ path: "/wc/v3/shipping/zones/".concat(zone.id, "/methods") }); case 15: zone.methods = _context.sent; shippingZones.push(zone); hasCountryZone = true; case 18: case "end": return _context.stop(); } } }, _callee); })); return function (_x) { return _ref.apply(this, arguments); }; }())); case 9: if (hasCountryZone) { _context2.next = 17; break; } _context2.next = 12; return external_this_wp_apiFetch_default()({ method: 'POST', path: '/wc/v3/shipping/zones', data: { name: countryName } }); case 12: zone = _context2.sent; _context2.next = 15; return external_this_wp_apiFetch_default()({ method: 'POST', path: "/wc/v3/shipping/zones/".concat(zone.id, "/locations"), data: [{ code: countryCode, type: 'country' }] }); case 15: zone.locations = _context2.sent; shippingZones.push(zone); case 17: shippingZones.reverse(); this.setState({ isPending: false, shippingZones: shippingZones }); case 19: case "end": return _context2.stop(); } } }, _callee2, this); })); function fetchShippingZones() { return _fetchShippingZones.apply(this, arguments); } return fetchShippingZones; }() }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps, prevState) { var _this$props2 = this.props, countryCode = _this$props2.countryCode, settings = _this$props2.settings; var storeAddress = settings.woocommerce_store_address, defaultCountry = settings.woocommerce_default_country, storePostCode = settings.woocommerce_store_postcode; var step = this.state.step; if (step === 'rates' && (prevProps.countryCode !== countryCode || prevState.step !== 'rates')) { this.fetchShippingZones(); } var isCompleteAddress = Boolean(storeAddress && defaultCountry && storePostCode); if (step === 'store_location' && isCompleteAddress) { this.completeStep(); } } }, { key: "completeStep", value: function completeStep() { var createNotice = this.props.createNotice; var step = this.state.step; var steps = this.getSteps(); var currentStepIndex = steps.findIndex(function (s) { return s.key === step; }); var nextStep = steps[currentStepIndex + 1]; if (nextStep) { this.setState({ step: nextStep.key }); } else { createNotice('success', Object(external_this_wp_i18n_["__"])("📦 Shipping is done! Don't worry, you can always change it later.", 'woocommerce')); Object(external_this_wc_navigation_["getHistory"])().push(Object(external_this_wc_navigation_["getNewPath"])({}, '/', {})); } } }, { key: "getPluginsToActivate", value: function getPluginsToActivate() { var countryCode = this.props.countryCode; var plugins = []; if (['GB', 'CA', 'AU'].includes(countryCode)) { plugins.push('woocommerce-shipstation-integration'); } else if (countryCode === 'US') { plugins.push('woocommerce-services'); plugins.push('jetpack'); } return Object(external_lodash_["difference"])(plugins, this.activePlugins); } }, { key: "getSteps", value: function getSteps() { var _this2 = this; var _this$props3 = this.props, countryCode = _this$props3.countryCode, isJetpackConnected = _this$props3.isJetpackConnected; var pluginsToActivate = this.getPluginsToActivate(); var requiresJetpackConnection = !isJetpackConnected && countryCode === 'US'; var steps = [{ key: 'store_location', label: Object(external_this_wp_i18n_["__"])('Set store location', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('The address from which your business operates', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(location_StoreLocation, extends_default()({}, this.props, { onComplete: function onComplete(values) { var country = Object(utils["a" /* getCountryCode */])(values.countryState); Object(tracks["b" /* recordEvent */])('tasklist_shipping_set_location', { country: country }); _this2.completeStep(); } })), visible: true }, { key: 'rates', label: Object(external_this_wp_i18n_["__"])('Set shipping costs', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('Define how much customers pay to ship to different destinations', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(shipping_rates, extends_default()({ buttonText: pluginsToActivate.length || requiresJetpackConnection ? Object(external_this_wp_i18n_["__"])('Proceed', 'woocommerce') : Object(external_this_wp_i18n_["__"])('Complete task', 'woocommerce'), shippingZones: this.state.shippingZones, onComplete: this.completeStep }, this.props)), visible: true }, { key: 'label_printing', label: Object(external_this_wp_i18n_["__"])('Enable shipping label printing', 'woocommerce'), description: pluginsToActivate.includes('woocommerce-shipstation-integration') ? lib_default()({ mixedString: Object(external_this_wp_i18n_["__"])('We recommend using ShipStation to save time at the post office by printing your shipping ' + 'labels at home. Try ShipStation free for 30 days. {{link}}Learn more{{/link}}.', 'woocommerce'), components: { link: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], { href: "https://woocommerce.com/products/shipstation-integration", target: "_blank", type: "external" }) } }) : Object(external_this_wp_i18n_["__"])('With WooCommerce Services and Jetpack you can save time at the ' + 'Post Office by printing your shipping labels at home', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Plugins"], extends_default()({ onComplete: function onComplete() { Object(tracks["b" /* recordEvent */])('tasklist_shipping_label_printing', { install: true, pluginsToActivate: pluginsToActivate }); _this2.completeStep(); }, onSkip: function onSkip() { Object(tracks["b" /* recordEvent */])('tasklist_shipping_label_printing', { install: false, pluginsToActivate: pluginsToActivate }); Object(external_this_wc_navigation_["getHistory"])().push(Object(external_this_wc_navigation_["getNewPath"])({}, '/', {})); }, pluginSlugs: pluginsToActivate }, this.props)), visible: pluginsToActivate.length }, { key: 'connect', label: Object(external_this_wp_i18n_["__"])('Connect your store', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('Connect your store to WordPress.com to enable label printing', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(components_connect["a" /* default */], extends_default()({ redirectUrl: Object(client_settings["f" /* getAdminLink */])('admin.php?page=wc-admin'), completeStep: this.completeStep }, this.props, { onConnect: function onConnect() { Object(tracks["b" /* recordEvent */])('tasklist_shipping_connect_store'); } })), visible: requiresJetpackConnection }]; return Object(external_lodash_["filter"])(steps, function (step) { return step.visible; }); } }, { key: "render", value: function render() { var _this$state = this.state, isPending = _this$state.isPending, step = _this$state.step; var isSettingsRequesting = this.props.isSettingsRequesting; return Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-shipping" }, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Card"], { className: "is-narrow" }, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Stepper"], { isPending: isPending || isSettingsRequesting, isVertical: true, currentStep: step, steps: this.getSteps() }))); } }]); return Shipping; }(external_this_wp_element_["Component"]); /* harmony default export */ var shipping = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) { var _select = select(external_this_wc_data_["SETTINGS_STORE_NAME"]), getSettings = _select.getSettings, getSettingsError = _select.getSettingsError, isGetSettingsRequesting = _select.isGetSettingsRequesting; var _select2 = select(external_this_wc_data_["PLUGINS_STORE_NAME"]), getActivePlugins = _select2.getActivePlugins, isJetpackConnected = _select2.isJetpackConnected; var _getSettings = getSettings('general'), _getSettings$general = _getSettings.general, settings = _getSettings$general === void 0 ? {} : _getSettings$general; var isSettingsError = Boolean(getSettingsError('general')); var isSettingsRequesting = isGetSettingsRequesting('general'); var countryCode = Object(utils["a" /* getCountryCode */])(settings.woocommerce_default_country); var _getSetting = Object(client_settings["g" /* getSetting */])('dataEndpoints', {}), _getSetting$countries = _getSetting.countries, countries = _getSetting$countries === void 0 ? [] : _getSetting$countries; var country = countryCode ? countries.find(function (c) { return c.code === countryCode; }) : null; var countryName = country ? country.name : null; var activePlugins = getActivePlugins(); return { countryCode: countryCode, countryName: countryName, isSettingsError: isSettingsError, isSettingsRequesting: isSettingsRequesting, settings: settings, activePlugins: activePlugins, isJetpackConnected: isJetpackConnected() }; }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; var _dispatch2 = dispatch(external_this_wc_data_["SETTINGS_STORE_NAME"]), updateAndPersistSettingsForGroup = _dispatch2.updateAndPersistSettingsForGroup; return { createNotice: createNotice, updateAndPersistSettingsForGroup: updateAndPersistSettingsForGroup }; }))(shipping_Shipping)); // CONCATENATED MODULE: ./client/task-list/tasks/tax.js function tax_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function tax_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { tax_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { tax_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function tax_createSuper(Derived) { var hasNativeReflectConstruct = tax_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function tax_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ var tax_Tax = /*#__PURE__*/function (_Component) { inherits_default()(Tax, _Component); var _super = tax_createSuper(Tax); function Tax(props) { var _this; classCallCheck_default()(this, Tax); _this = _super.call(this, props); _this.initialState = { isPending: false, stepIndex: 0, automatedTaxEnabled: true, // Cache the value of pluginsToActivate so that we can show/hide tasks based on it, but not have them update mid task. pluginsToActivate: props.pluginsToActivate }; _this.state = _this.initialState; _this.completeStep = _this.completeStep.bind(assertThisInitialized_default()(_this)); _this.configureTaxRates = _this.configureTaxRates.bind(assertThisInitialized_default()(_this)); _this.updateAutomatedTax = _this.updateAutomatedTax.bind(assertThisInitialized_default()(_this)); _this.setIsPending = _this.setIsPending.bind(assertThisInitialized_default()(_this)); _this.shouldShowSuccessScreen = _this.shouldShowSuccessScreen.bind(assertThisInitialized_default()(_this)); return _this; } createClass_default()(Tax, [{ key: "componentDidMount", value: function componentDidMount() { this.reset(); } }, { key: "reset", value: function reset() { this.setState(this.initialState); } }, { key: "shouldShowSuccessScreen", value: function shouldShowSuccessScreen() { var stepIndex = this.state.stepIndex; var _this$props = this.props, isJetpackConnected = _this$props.isJetpackConnected, pluginsToActivate = _this$props.pluginsToActivate, generalSettings = _this$props.generalSettings; var storeAddress = generalSettings.woocommerce_store_address, defaultCountry = generalSettings.woocommerce_default_country, storePostCode = generalSettings.woocommerce_store_postcode; var isCompleteAddress = Boolean(storeAddress && defaultCountry && storePostCode); return stepIndex !== null && isCompleteAddress && !pluginsToActivate.length && isJetpackConnected && this.isTaxJarSupported(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props2 = this.props, generalSettings = _this$props2.generalSettings, isJetpackConnected = _this$props2.isJetpackConnected, taxSettings = _this$props2.taxSettings, isGeneralSettingsRequesting = _this$props2.isGeneralSettingsRequesting; var calcTaxes = generalSettings.woocommerce_calc_taxes, storeAddress = generalSettings.woocommerce_store_address, defaultCountry = generalSettings.woocommerce_default_country, storePostCode = generalSettings.woocommerce_store_postcode; var stepIndex = this.state.stepIndex; var currentStep = this.getSteps()[stepIndex]; var currentStepKey = currentStep && currentStep.key; // If general settings have stopped requesting, check if we should show success screen. if (prevProps.isGeneralSettingsRequesting && !isGeneralSettingsRequesting) { if (this.shouldShowSuccessScreen()) { /* eslint-disable react/no-did-update-set-state */ this.setState({ stepIndex: null }); /* eslint-enable react/no-did-update-set-state */ return; } } if (taxSettings.wc_connect_taxes_enabled && taxSettings.wc_connect_taxes_enabled !== prevProps.taxSettings.wc_connect_taxes_enabled) { /* eslint-disable react/no-did-update-set-state */ this.setState({ automatedTaxEnabled: taxSettings.wc_connect_taxes_enabled === 'yes' ? true : false }); /* eslint-enable react/no-did-update-set-state */ } if (currentStepKey === 'connect' && isJetpackConnected) { this.completeStep(); } var isCompleteAddress = Boolean(storeAddress && defaultCountry && storePostCode); if (currentStepKey === 'store_location' && isCompleteAddress) { this.completeStep(); } var prevCalcTaxes = prevProps.generalSettings.woocommerce_calc_taxes; if (prevCalcTaxes === 'no' && calcTaxes === 'yes') { window.location = Object(client_settings["f" /* getAdminLink */])('admin.php?page=wc-settings&tab=tax&section=standard'); } } }, { key: "isTaxJarSupported", value: function isTaxJarSupported() { var _this$props3 = this.props, countryCode = _this$props3.countryCode, tosAccepted = _this$props3.tosAccepted; var _getSetting = Object(client_settings["g" /* getSetting */])('onboarding', {}), _getSetting$automated = _getSetting.automatedTaxSupportedCountries, automatedTaxSupportedCountries = _getSetting$automated === void 0 ? [] : _getSetting$automated, taxJarActivated = _getSetting.taxJarActivated; return !taxJarActivated && // WCS integration doesn't work with the official TaxJar plugin. tosAccepted && automatedTaxSupportedCountries.includes(countryCode); } }, { key: "completeStep", value: function completeStep() { var stepIndex = this.state.stepIndex; var steps = this.getSteps(); var nextStep = steps[stepIndex + 1]; if (nextStep) { this.setState({ stepIndex: stepIndex + 1 }); } else { Object(external_this_wc_navigation_["getHistory"])().push(Object(external_this_wc_navigation_["getNewPath"])({}, '/', {})); } } }, { key: "configureTaxRates", value: function () { var _configureTaxRates = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { var _this$props4, generalSettings, updateAndPersistSettingsForGroup; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this$props4 = this.props, generalSettings = _this$props4.generalSettings, updateAndPersistSettingsForGroup = _this$props4.updateAndPersistSettingsForGroup; if (!(generalSettings.woocommerce_calc_taxes !== 'yes')) { _context.next = 5; break; } this.setState({ isPending: true }); _context.next = 5; return updateAndPersistSettingsForGroup('general', { general: { woocommerce_calc_taxes: 'yes' } }); case 5: window.location = Object(client_settings["f" /* getAdminLink */])('admin.php?page=wc-settings&tab=tax&section=standard&wc_onboarding_active_task=tax'); case 6: case "end": return _context.stop(); } } }, _callee, this); })); function configureTaxRates() { return _configureTaxRates.apply(this, arguments); } return configureTaxRates; }() }, { key: "updateAutomatedTax", value: function () { var _updateAutomatedTax = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { var _this$props5, createNotice, updateAndPersistSettingsForGroup, automatedTaxEnabled; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _this$props5 = this.props, createNotice = _this$props5.createNotice, updateAndPersistSettingsForGroup = _this$props5.updateAndPersistSettingsForGroup; automatedTaxEnabled = this.state.automatedTaxEnabled; _context2.next = 4; return updateAndPersistSettingsForGroup('tax', { tax: { wc_connect_taxes_enabled: automatedTaxEnabled ? 'yes' : 'no' } }); case 4: _context2.next = 6; return updateAndPersistSettingsForGroup('general', { general: { woocommerce_calc_taxes: 'yes' } }); case 6: if (!this.props.isTaxSettingsError && !this.props.isGeneralSettingsError) { // @todo This is a workaround to force the task to mark as complete. // This should probably be updated to use wc-api so we can fetch tax rates. Object(client_settings["h" /* setSetting */])('onboarding', tax_objectSpread(tax_objectSpread({}, Object(client_settings["g" /* getSetting */])('onboarding', {})), {}, { isTaxComplete: true })); createNotice('success', Object(external_this_wp_i18n_["__"])("You're awesome! One less item on your to-do list ✅", 'woocommerce')); if (automatedTaxEnabled) { Object(external_this_wc_navigation_["getHistory"])().push(Object(external_this_wc_navigation_["getNewPath"])({}, '/', {})); } else { this.configureTaxRates(); } } else { createNotice('error', Object(external_this_wp_i18n_["__"])('There was a problem updating your tax settings.', 'woocommerce')); } case 7: case "end": return _context2.stop(); } } }, _callee2, this); })); function updateAutomatedTax() { return _updateAutomatedTax.apply(this, arguments); } return updateAutomatedTax; }() }, { key: "setIsPending", value: function setIsPending(value) { this.setState({ isPending: value }); } }, { key: "getSteps", value: function getSteps() { var _this2 = this; var _this$props6 = this.props, generalSettings = _this$props6.generalSettings, isGeneralSettingsRequesting = _this$props6.isGeneralSettingsRequesting, isJetpackConnected = _this$props6.isJetpackConnected; var _this$state = this.state, isPending = _this$state.isPending, pluginsToActivate = _this$state.pluginsToActivate; var steps = [{ key: 'store_location', label: Object(external_this_wp_i18n_["__"])('Set store location', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('The address from which your business operates', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(location_StoreLocation, extends_default()({}, this.props, { onComplete: function onComplete(values) { var country = Object(utils["a" /* getCountryCode */])(values.countryState); Object(tracks["b" /* recordEvent */])('tasklist_tax_set_location', { country: country }); if (_this2.shouldShowSuccessScreen()) { _this2.setState({ stepIndex: null }); // Only complete step if another update hasn't already shown succes screen. } else if (_this2.state.stepIndex !== null) { _this2.completeStep(); } }, isSettingsRequesting: isGeneralSettingsRequesting, settings: generalSettings })), visible: true }, { key: 'plugins', label: Object(external_this_wp_i18n_["__"])('Install Jetpack and WooCommerce Services', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('Jetpack and WooCommerce Services allow you to automate sales tax calculations', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Plugins"], { onComplete: function onComplete() { Object(tracks["b" /* recordEvent */])('tasklist_tax_install_extensions', { install_extensions: true }); _this2.completeStep(); }, onSkip: function onSkip() { Object(tracks["a" /* queueRecordEvent */])('tasklist_tax_install_extensions', { install_extensions: false }); window.location.href = Object(client_settings["f" /* getAdminLink */])('admin.php?page=wc-settings&tab=tax&section=standard'); }, skipText: Object(external_this_wp_i18n_["__"])('Set up tax rates manually', 'woocommerce') }), visible: pluginsToActivate.length && this.isTaxJarSupported() }, { key: 'connect', label: Object(external_this_wp_i18n_["__"])('Connect your store', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('Connect your store to WordPress.com to enable automated sales tax calculations', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(components_connect["a" /* default */], extends_default()({}, this.props, { setIsPending: this.setIsPending, onConnect: function onConnect() { Object(tracks["b" /* recordEvent */])('tasklist_tax_connect_store', { connect: true }); }, onSkip: function onSkip() { Object(tracks["a" /* queueRecordEvent */])('tasklist_tax_connect_store', { connect: false }); window.location.href = Object(client_settings["f" /* getAdminLink */])('admin.php?page=wc-settings&tab=tax&section=standard'); }, skipText: Object(external_this_wp_i18n_["__"])('Set up tax rates manually', 'woocommerce') })), visible: !isJetpackConnected && this.isTaxJarSupported() }, { key: 'manual_configuration', label: Object(external_this_wp_i18n_["__"])('Configure tax rates', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('Head over to the tax rate settings screen to configure your tax rates', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, isBusy: isPending, onClick: function onClick() { Object(tracks["b" /* recordEvent */])('tasklist_tax_config_rates'); _this2.configureTaxRates(); } }, Object(external_this_wp_i18n_["__"])('Configure', 'woocommerce')), Object(external_this_wp_element_["createElement"])("p", null, generalSettings.woocommerce_calc_taxes !== 'yes' && lib_default()({ mixedString: Object(external_this_wp_i18n_["__"])( /*eslint-disable max-len*/ 'By clicking "Configure" you\'re enabling tax rates and calculations. More info {{link}}here{{/link}}.', /*eslint-enable max-len*/ 'woocommerce'), components: { link: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], { href: "https://docs.woocommerce.com/document/setting-up-taxes-in-woocommerce/#section-1", target: "_blank", type: "external" }) } }))), visible: !this.isTaxJarSupported() }]; return Object(external_lodash_["filter"])(steps, function (step) { return step.visible; }); } }, { key: "render", value: function render() { var _this3 = this; var _this$state2 = this.state, isPending = _this$state2.isPending, stepIndex = _this$state2.stepIndex; var _this$props7 = this.props, isGeneralSettingsRequesting = _this$props7.isGeneralSettingsRequesting, isTaxSettingsRequesting = _this$props7.isTaxSettingsRequesting, taxSettings = _this$props7.taxSettings; var step = this.getSteps()[stepIndex]; return Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-tax" }, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Card"], { className: "is-narrow" }, step ? Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Stepper"], { isPending: isPending || isGeneralSettingsRequesting || isTaxSettingsRequesting, isVertical: true, currentStep: step.key, steps: this.getSteps() }) : Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-tax__success" }, Object(external_this_wp_element_["createElement"])("span", { className: "woocommerce-task-tax__success-icon", role: "img", "aria-labelledby": "woocommerce-task-tax__success-message" }, "\uD83C\uDF8A"), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["H"], { id: "woocommerce-task-tax__success-message" }, Object(external_this_wp_i18n_["__"])('Good news!', 'woocommerce')), Object(external_this_wp_element_["createElement"])("p", null, lib_default()({ mixedString: Object(external_this_wp_i18n_["__"])('{{strong}}Jetpack{{/strong}} and {{strong}}WooCommerce Services{{/strong}} ' + 'can automate your sales tax calculations for you.', 'woocommerce'), components: { strong: Object(external_this_wp_element_["createElement"])("strong", null) } })), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, isBusy: Object.keys(taxSettings).length && isTaxSettingsRequesting, onClick: function onClick() { Object(tracks["b" /* recordEvent */])('tasklist_tax_setup_automated_proceed', { setup_automatically: true }); _this3.setState({ automatedTaxEnabled: true }, _this3.updateAutomatedTax); } }, Object(external_this_wp_i18n_["__"])('Yes please', 'woocommerce')), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { onClick: function onClick() { Object(tracks["b" /* recordEvent */])('tasklist_tax_setup_automated_proceed', { setup_automatically: false }); _this3.setState({ automatedTaxEnabled: false }, _this3.updateAutomatedTax); } }, Object(external_this_wp_i18n_["__"])("No thanks, I'll configure taxes manually", 'woocommerce'))))); } }]); return Tax; }(external_this_wp_element_["Component"]); /* harmony default export */ var tax = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) { var _select = select(external_this_wc_data_["SETTINGS_STORE_NAME"]), getSettings = _select.getSettings, getSettingsError = _select.getSettingsError, isGetSettingsRequesting = _select.isGetSettingsRequesting; var _select2 = select(external_this_wc_data_["OPTIONS_STORE_NAME"]), getOption = _select2.getOption; var _select3 = select(external_this_wc_data_["PLUGINS_STORE_NAME"]), getActivePlugins = _select3.getActivePlugins, isJetpackConnected = _select3.isJetpackConnected; var _getSettings = getSettings('general'), _getSettings$general = _getSettings.general, generalSettings = _getSettings$general === void 0 ? {} : _getSettings$general; var isGeneralSettingsError = Boolean(getSettingsError('general')); var isGeneralSettingsRequesting = isGetSettingsRequesting('general'); var countryCode = Object(utils["a" /* getCountryCode */])(generalSettings.woocommerce_default_country); var _getSettings2 = getSettings('tax'), _getSettings2$tax = _getSettings2.tax, taxSettings = _getSettings2$tax === void 0 ? {} : _getSettings2$tax; var isTaxSettingsError = Boolean(getSettingsError('tax')); var isTaxSettingsRequesting = isGetSettingsRequesting('tax'); var activePlugins = getActivePlugins(); var pluginsToActivate = Object(external_lodash_["difference"])(['jetpack', 'woocommerce-services'], activePlugins); var connectOptions = getOption('wc_connect_options') || {}; var tosAccepted = connectOptions.tos_accepted || getOption('woocommerce_setup_jetpack_opted_in'); return { isGeneralSettingsError: isGeneralSettingsError, isGeneralSettingsRequesting: isGeneralSettingsRequesting, generalSettings: generalSettings, countryCode: countryCode, taxSettings: taxSettings, isTaxSettingsError: isTaxSettingsError, isTaxSettingsRequesting: isTaxSettingsRequesting, isJetpackConnected: isJetpackConnected(), pluginsToActivate: pluginsToActivate, tosAccepted: tosAccepted }; }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; var _dispatch2 = dispatch(external_this_wc_data_["SETTINGS_STORE_NAME"]), updateAndPersistSettingsForGroup = _dispatch2.updateAndPersistSettingsForGroup; return { createNotice: createNotice, updateAndPersistSettingsForGroup: updateAndPersistSettingsForGroup }; }))(tax_Tax)); // CONCATENATED MODULE: ./client/task-list/tasks/payments/bacs.js function bacs_createSuper(Derived) { var hasNativeReflectConstruct = bacs_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function bacs_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ var bacs_PayFast = /*#__PURE__*/function (_Component) { inherits_default()(PayFast, _Component); var _super = bacs_createSuper(PayFast); function PayFast() { var _temp, _this; classCallCheck_default()(this, PayFast); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return possibleConstructorReturn_default()(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.getInitialConfigValues = function () { return { account_name: '', account_number: '', bank_name: '', sort_code: '', iban: '', bic: '' }; }, _this.validate = function (values) { var errors = {}; if (!values.account_number && !values.iban) { errors.account_number = errors.iban = Object(external_this_wp_i18n_["__"])('Please enter an account number or IBAN', 'woocommerce'); } return errors; }, _this.updateSettings = /*#__PURE__*/function () { var _ref = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values) { var _this$props, updateOptions, createNotice, markConfigured, update; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this$props = _this.props, updateOptions = _this$props.updateOptions, createNotice = _this$props.createNotice, markConfigured = _this$props.markConfigured; _context.next = 3; return updateOptions({ woocommerce_bacs_settings: { enabled: 'yes' }, woocommerce_bacs_accounts: [values] }); case 3: update = _context.sent; if (update.success) { markConfigured('bacs'); createNotice('success', Object(external_this_wp_i18n_["__"])('Direct bank transfer details added successfully', 'woocommerce')); } else { createNotice('error', Object(external_this_wp_i18n_["__"])('There was a problem saving your payment setings', 'woocommerce')); } case 5: case "end": return _context.stop(); } } }, _callee); })); return function (_x) { return _ref.apply(this, arguments); }; }(), _temp)); } createClass_default()(PayFast, [{ key: "render", value: function render() { var isOptionsRequesting = this.props.isOptionsRequesting; return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Form"], { initialValues: this.getInitialConfigValues(), onSubmitCallback: this.updateSettings, validate: this.validate }, function (_ref2) { var getInputProps = _ref2.getInputProps, handleSubmit = _ref2.handleSubmit; return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["H"], null, Object(external_this_wp_i18n_["__"])('Add your bank details', 'woocommerce')), Object(external_this_wp_element_["createElement"])("p", null, Object(external_this_wp_i18n_["__"])('These details are required to receive payments via bank transfer', 'woocommerce')), Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-payment-method__fields" }, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('Account name', 'woocommerce'), required: true }, getInputProps('account_name'))), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('Account number', 'woocommerce'), required: true }, getInputProps('account_number'))), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('Bank name', 'woocommerce'), required: true }, getInputProps('bank_name'))), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('Sort code', 'woocommerce'), required: true }, getInputProps('sort_code'))), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('IBAN', 'woocommerce'), required: true }, getInputProps('iban'))), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('BIC / Swift', 'woocommerce'), required: true }, getInputProps('bic')))), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, isBusy: isOptionsRequesting, onClick: handleSubmit }, Object(external_this_wp_i18n_["__"])('Save', 'woocommerce'))); }); } }]); return PayFast; }(external_this_wp_element_["Component"]); /* harmony default export */ var bacs = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) { var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]), isOptionsUpdating = _select.isOptionsUpdating; var isOptionsRequesting = isOptionsUpdating(); return { isOptionsRequesting: isOptionsRequesting }; }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; var _dispatch2 = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]), updateOptions = _dispatch2.updateOptions; return { createNotice: createNotice, updateOptions: updateOptions }; }))(bacs_PayFast)); // CONCATENATED MODULE: ./client/task-list/tasks/payments/images/bacs.js /* harmony default export */ var images_bacs = (function () { return Object(external_this_wp_element_["createElement"])("svg", { width: "96", height: "32", viewBox: "0 0 96 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, Object(external_this_wp_element_["createElement"])("rect", { width: "32", height: "32", rx: "16", fill: "#8E9196" }), Object(external_this_wp_element_["createElement"])("mask", { id: "bacs0", "mask-type": "alpha", maskUnits: "userSpaceOnUse", x: "8", y: "8", width: "16", height: "16" }, Object(external_this_wp_element_["createElement"])("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.875 12.25L16 8.5L23.125 12.25V13.75H8.875V12.25ZM16 10.195L19.9075 12.25H12.0925L16 10.195ZM10.75 15.25H12.25V20.5H10.75V15.25ZM15.25 20.5V15.25H16.75V20.5H15.25ZM23.125 23.5V22H8.875V23.5H23.125ZM19.75 15.25H21.25V20.5H19.75V15.25Z", fill: "white" })), Object(external_this_wp_element_["createElement"])("g", { mask: "url(#bacs0)" }, Object(external_this_wp_element_["createElement"])("rect", { x: "7", y: "7", width: "18", height: "18", fill: "white" })), Object(external_this_wp_element_["createElement"])("mask", { id: "bacs1", "mask-type": "alpha", maskUnits: "userSpaceOnUse", x: "39", y: "10", width: "18", height: "12" }, Object(external_this_wp_element_["createElement"])("path", { d: "M39 17L53.17 17L49.59 20.59L51 22L57 16L51 10L49.59 11.41L53.17 15L39 15L39 17Z", fill: "white" })), Object(external_this_wp_element_["createElement"])("g", { mask: "url(#bacs1)" }, Object(external_this_wp_element_["createElement"])("rect", { x: "60", y: "28", width: "24", height: "24", transform: "rotate(-180 60 28)", fill: "#8E9196" })), Object(external_this_wp_element_["createElement"])("rect", { x: "64", width: "32", height: "32", rx: "16", fill: "#8E9196" }), Object(external_this_wp_element_["createElement"])("mask", { id: "bacs2", "mask-type": "alpha", maskUnits: "userSpaceOnUse", x: "72", y: "8", width: "16", height: "16" }, Object(external_this_wp_element_["createElement"])("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M72.875 12.25L80 8.5L87.125 12.25V13.75H72.875V12.25ZM80 10.195L83.9075 12.25H76.0925L80 10.195ZM74.75 15.25H76.25V20.5H74.75V15.25ZM79.25 20.5V15.25H80.75V20.5H79.25ZM87.125 23.5V22H72.875V23.5H87.125ZM83.75 15.25H85.25V20.5H83.75V15.25Z", fill: "white" })), Object(external_this_wp_element_["createElement"])("g", { mask: "url(#bacs2)" }, Object(external_this_wp_element_["createElement"])("rect", { x: "71", y: "7", width: "18", height: "18", fill: "white" }))); }); // CONCATENATED MODULE: ./client/task-list/tasks/payments/images/cod.js /* harmony default export */ var cod = (function () { return Object(external_this_wp_element_["createElement"])("svg", { width: "96", height: "32", viewBox: "0 0 96 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, Object(external_this_wp_element_["createElement"])("rect", { width: "32", height: "32", rx: "16", fill: "#8E9196" }), Object(external_this_wp_element_["createElement"])("mask", { id: "cod-mask-0", "mask-type": "alpha", maskUnits: "userSpaceOnUse", x: "7", y: "10", width: "18", height: "12" }, Object(external_this_wp_element_["createElement"])("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M22 13H19.75V10H9.25C8.425 10 7.75 10.675 7.75 11.5V19.75H9.25C9.25 20.995 10.255 22 11.5 22C12.745 22 13.75 20.995 13.75 19.75H18.25C18.25 20.995 19.255 22 20.5 22C21.745 22 22.75 20.995 22.75 19.75H24.25V16L22 13ZM21.625 14.125L23.095 16H19.75V14.125H21.625ZM10.75 19.75C10.75 20.1625 11.0875 20.5 11.5 20.5C11.9125 20.5 12.25 20.1625 12.25 19.75C12.25 19.3375 11.9125 19 11.5 19C11.0875 19 10.75 19.3375 10.75 19.75ZM13.165 18.25C12.7525 17.7925 12.1675 17.5 11.5 17.5C10.8325 17.5 10.2475 17.7925 9.835 18.25H9.25V11.5H18.25V18.25H13.165ZM19.75 19.75C19.75 20.1625 20.0875 20.5 20.5 20.5C20.9125 20.5 21.25 20.1625 21.25 19.75C21.25 19.3375 20.9125 19 20.5 19C20.0875 19 19.75 19.3375 19.75 19.75Z", fill: "white" })), Object(external_this_wp_element_["createElement"])("g", { mask: "url(#cod-mask-0)" }, Object(external_this_wp_element_["createElement"])("rect", { x: "7", y: "7", width: "18", height: "18", fill: "white" })), Object(external_this_wp_element_["createElement"])("mask", { id: "cod-mask-1", "mask-type": "alpha", maskUnits: "userSpaceOnUse", x: "39", y: "10", width: "18", height: "12" }, Object(external_this_wp_element_["createElement"])("path", { d: "M39 17L53.17 17L49.59 20.59L51 22L57 16L51 10L49.59 11.41L53.17 15L39 15L39 17Z", fill: "white" })), Object(external_this_wp_element_["createElement"])("g", { mask: "url(#cod-mask-1)" }, Object(external_this_wp_element_["createElement"])("rect", { x: "60", y: "28", width: "24", height: "24", transform: "rotate(-180 60 28)", fill: "#8E9196" })), Object(external_this_wp_element_["createElement"])("rect", { x: "64", width: "32", height: "32", rx: "16", fill: "#8E9196" }), Object(external_this_wp_element_["createElement"])("mask", { id: "cod-mask-2", "mask-type": "alpha", maskUnits: "userSpaceOnUse", x: "76", y: "9", width: "8", height: "14" }, Object(external_this_wp_element_["createElement"])("path", { d: "M80.2926 15.175C78.5901 14.7325 78.0426 14.275 78.0426 13.5625C78.0426 12.745 78.8001 12.175 80.0676 12.175C81.4026 12.175 81.8976 12.8125 81.9426 13.75H83.6001C83.5476 12.46 82.7601 11.275 81.1926 10.8925V9.25H78.9426V10.87C77.4876 11.185 76.3176 12.13 76.3176 13.5775C76.3176 15.31 77.7501 16.1725 79.8426 16.675C81.7176 17.125 82.0926 17.785 82.0926 18.4825C82.0926 19 81.7251 19.825 80.0676 19.825C78.5226 19.825 77.9151 19.135 77.8326 18.25H76.1826C76.2726 19.8925 77.5026 20.815 78.9426 21.1225V22.75H81.1926V21.1375C82.6551 20.86 83.8176 20.0125 83.8176 18.475C83.8176 16.345 81.9951 15.6175 80.2926 15.175Z", fill: "white" })), Object(external_this_wp_element_["createElement"])("g", { mask: "url(#cod-mask-2)" }, Object(external_this_wp_element_["createElement"])("rect", { x: "71", y: "7", width: "18", height: "18", fill: "white" }))); }); // EXTERNAL MODULE: ./client/lib/notices/index.js var notices = __webpack_require__(202); // CONCATENATED MODULE: ./client/task-list/tasks/payments/stripe.js function stripe_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function stripe_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { stripe_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { stripe_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function stripe_createSuper(Derived) { var hasNativeReflectConstruct = stripe_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function stripe_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ var stripe_Stripe = /*#__PURE__*/function (_Component) { inherits_default()(Stripe, _Component); var _super = stripe_createSuper(Stripe); function Stripe(props) { var _this; classCallCheck_default()(this, Stripe); _this = _super.call(this, props); _this.state = { oAuthConnectFailed: false, connectURL: null, isPending: false }; _this.updateSettings = _this.updateSettings.bind(assertThisInitialized_default()(_this)); return _this; } createClass_default()(Stripe, [{ key: "componentDidMount", value: function componentDidMount() { var stripeSettings = this.props.stripeSettings; var query = Object(external_this_wc_navigation_["getQuery"])(); // Handle redirect back from Stripe. if (query['stripe-connect'] && query['stripe-connect'] === '1') { var isStripeConnected = stripeSettings.publishable_key && stripeSettings.secret_key; if (isStripeConnected) { this.completeMethod(); return; } } if (!this.requiresManualConfig()) { this.fetchOAuthConnectURL(); } } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var activePlugins = this.props.activePlugins; if (!prevProps.activePlugins.includes('woocommerce-gateway-stripe') && activePlugins.includes('woocommerce-gateway-stripe')) { this.fetchOAuthConnectURL(); } } }, { key: "requiresManualConfig", value: function requiresManualConfig() { var _this$props = this.props, activePlugins = _this$props.activePlugins, isJetpackConnected = _this$props.isJetpackConnected; var oAuthConnectFailed = this.state.oAuthConnectFailed; return !isJetpackConnected || !activePlugins.includes('woocommerce-services') || oAuthConnectFailed; } }, { key: "completeMethod", value: function completeMethod() { var _this$props2 = this.props, createNotice = _this$props2.createNotice, markConfigured = _this$props2.markConfigured; this.setState({ isPending: false }); createNotice('success', Object(external_this_wp_i18n_["__"])('Stripe connected successfully.', 'woocommerce')); markConfigured('stripe'); } }, { key: "fetchOAuthConnectURL", value: function () { var _fetchOAuthConnectURL = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { var activePlugins, result; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: activePlugins = this.props.activePlugins; if (activePlugins.includes('woocommerce-gateway-stripe')) { _context.next = 3; break; } return _context.abrupt("return"); case 3: _context.prev = 3; this.setState({ isPending: true }); _context.next = 7; return external_this_wp_apiFetch_default()({ path: constants["e" /* WCS_NAMESPACE */] + '/connect/stripe/oauth/init', method: 'POST', data: { returnUrl: Object(client_settings["f" /* getAdminLink */])('admin.php?page=wc-admin&task=payments&method=stripe&stripe-connect=1') } }); case 7: result = _context.sent; if (!(!result || !result.oauthUrl)) { _context.next = 11; break; } this.setState({ oAuthConnectFailed: true, isPending: false }); return _context.abrupt("return"); case 11: this.setState({ connectURL: result.oauthUrl, isPending: false }); _context.next = 17; break; case 14: _context.prev = 14; _context.t0 = _context["catch"](3); this.setState({ oAuthConnectFailed: true, isPending: false }); case 17: case "end": return _context.stop(); } } }, _callee, this, [[3, 14]]); })); function fetchOAuthConnectURL() { return _fetchOAuthConnectURL.apply(this, arguments); } return fetchOAuthConnectURL; }() }, { key: "renderConnectButton", value: function renderConnectButton() { var connectURL = this.state.connectURL; return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, href: connectURL }, Object(external_this_wp_i18n_["__"])('Connect', 'woocommerce')); } }, { key: "updateSettings", value: function () { var _updateSettings = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(values) { var _this$props3, updateOptions, stripeSettings, createNotice, update; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _this$props3 = this.props, updateOptions = _this$props3.updateOptions, stripeSettings = _this$props3.stripeSettings, createNotice = _this$props3.createNotice; _context2.next = 3; return updateOptions({ woocommerce_stripe_settings: stripe_objectSpread(stripe_objectSpread({}, stripeSettings), {}, { publishable_key: values.publishable_key, secret_key: values.secret_key, enabled: 'yes' }) }); case 3: update = _context2.sent; if (update.success) { this.completeMethod(); } else { createNotice('error', Object(external_this_wp_i18n_["__"])('There was a problem saving your payment setings', 'woocommerce')); } case 5: case "end": return _context2.stop(); } } }, _callee2, this); })); function updateSettings(_x) { return _updateSettings.apply(this, arguments); } return updateSettings; }() }, { key: "getInitialConfigValues", value: function getInitialConfigValues() { return { publishable_key: '', secret_key: '' }; } }, { key: "validateManualConfig", value: function validateManualConfig(values) { var errors = {}; if (values.publishable_key.match(/^pk_live_/) === null) { errors.publishable_key = Object(external_this_wp_i18n_["__"])('Please enter a valid publishable key. Valid keys start with "pk_live".', 'woocommerce'); } if (values.secret_key.match(/^[rs]k_live_/) === null) { errors.secret_key = Object(external_this_wp_i18n_["__"])('Please enter a valid secret key. Valid keys start with "sk_live" or "rk_live".', 'woocommerce'); } return errors; } }, { key: "renderManualConfig", value: function renderManualConfig() { var isOptionsUpdating = this.props.isOptionsUpdating; var stripeHelp = lib_default()({ mixedString: Object(external_this_wp_i18n_["__"])('Your API details can be obtained from your {{docsLink}}Stripe account{{/docsLink}}. Don’t have a Stripe account? {{registerLink}}Create one.{{/registerLink}}', 'woocommerce'), components: { docsLink: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], { href: "https://stripe.com/docs/keys", target: "_blank", type: "external" }), registerLink: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], { href: "https://dashboard.stripe.com/register", target: "_blank", type: "external" }) } }); return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Form"], { initialValues: this.getInitialConfigValues(), onSubmitCallback: this.updateSettings, validate: this.validateManualConfig }, function (_ref) { var getInputProps = _ref.getInputProps, handleSubmit = _ref.handleSubmit; return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('Live Publishable Key', 'woocommerce'), required: true }, getInputProps('publishable_key'))), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('Live Secret Key', 'woocommerce'), required: true }, getInputProps('secret_key'))), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, isBusy: isOptionsUpdating, onClick: handleSubmit }, Object(external_this_wp_i18n_["__"])('Proceed', 'woocommerce')), Object(external_this_wp_element_["createElement"])("p", null, stripeHelp)); }); } }, { key: "getConnectStep", value: function getConnectStep() { var _this$state = this.state, connectURL = _this$state.connectURL, isPending = _this$state.isPending, oAuthConnectFailed = _this$state.oAuthConnectFailed; var connectStep = { key: 'connect', label: Object(external_this_wp_i18n_["__"])('Connect your Stripe account', 'woocommerce') }; if (isPending) { return connectStep; } if (!oAuthConnectFailed && connectURL) { return stripe_objectSpread(stripe_objectSpread({}, connectStep), {}, { description: Object(external_this_wp_i18n_["__"])('A Stripe account is required to process payments.', 'woocommerce'), content: this.renderConnectButton() }); } return stripe_objectSpread(stripe_objectSpread({}, connectStep), {}, { description: Object(external_this_wp_i18n_["__"])('Connect your store to your Stripe account. Don’t have a Stripe account? Create one.', 'woocommerce'), content: this.renderManualConfig() }); } }, { key: "render", value: function render() { var _this$props4 = this.props, installStep = _this$props4.installStep, isOptionsUpdating = _this$props4.isOptionsUpdating; var isPending = this.state.isPending; return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Stepper"], { isVertical: true, isPending: !installStep.isComplete || isOptionsUpdating || isPending, currentStep: installStep.isComplete ? 'connect' : 'install', steps: [installStep, this.getConnectStep()] }); } }]); return Stripe; }(external_this_wp_element_["Component"]); /* harmony default export */ var stripe = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) { var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]), getOption = _select.getOption, isOptionsUpdating = _select.isOptionsUpdating; var _select2 = select(external_this_wc_data_["PLUGINS_STORE_NAME"]), getActivePlugins = _select2.getActivePlugins, isJetpackConnected = _select2.isJetpackConnected; return { activePlugins: getActivePlugins(), isJetpackConnected: isJetpackConnected(), isOptionsUpdating: isOptionsUpdating(), stripeSettings: getOption('woocommerce_stripe_settings') || [] }; }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; var _dispatch2 = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]), updateOptions = _dispatch2.updateOptions; return { createNotice: createNotice, updateOptions: updateOptions }; }))(stripe_Stripe)); // CONCATENATED MODULE: ./client/task-list/tasks/payments/square.js function square_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function square_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { square_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { square_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function square_createSuper(Derived) { var hasNativeReflectConstruct = square_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function square_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ var square_Square = /*#__PURE__*/function (_Component) { inherits_default()(Square, _Component); var _super = square_createSuper(Square); function Square(props) { var _this; classCallCheck_default()(this, Square); _this = _super.call(this, props); _this.state = { isPending: false }; _this.connect = _this.connect.bind(assertThisInitialized_default()(_this)); return _this; } createClass_default()(Square, [{ key: "componentDidMount", value: function componentDidMount() { var _this$props = this.props, createNotice = _this$props.createNotice, markConfigured = _this$props.markConfigured; var query = Object(external_this_wc_navigation_["getQuery"])(); // Handle redirect back from Square if (query['square-connect']) { if (query['square-connect'] === '1') { createNotice('success', Object(external_this_wp_i18n_["__"])('Square connected successfully.', 'woocommerce')); markConfigured('square'); } } } }, { key: "connect", value: function () { var _connect = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { var _this$props2, createNotice, hasCbdIndustry, options, updateOptions, errorMessage, newWindow, result; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this$props2 = this.props, createNotice = _this$props2.createNotice, hasCbdIndustry = _this$props2.hasCbdIndustry, options = _this$props2.options, updateOptions = _this$props2.updateOptions; this.setState({ isPending: true }); updateOptions({ woocommerce_square_credit_card_settings: square_objectSpread(square_objectSpread({}, options.woocommerce_square_credit_card_settings), {}, { enabled: 'yes' }) }); errorMessage = Object(external_this_wp_i18n_["__"])('There was an error connecting to Square. Please try again or skip to connect later in store settings.', 'woocommerce'); _context.prev = 4; newWindow = null; if (hasCbdIndustry) { // It's necessary to declare the new tab before the async call, // otherwise, it won't be possible to open it. newWindow = window.open('/', '_blank'); } _context.next = 9; return external_this_wp_apiFetch_default()({ path: constants["f" /* WC_ADMIN_NAMESPACE */] + '/plugins/connect-square', method: 'POST' }); case 9: result = _context.sent; if (!(!result || !result.connectUrl)) { _context.next = 15; break; } this.setState({ isPending: false }); createNotice('error', errorMessage); if (hasCbdIndustry) { newWindow.close(); } return _context.abrupt("return"); case 15: this.setState({ isPending: true }); this.redirect(result.connectUrl, newWindow); _context.next = 23; break; case 19: _context.prev = 19; _context.t0 = _context["catch"](4); this.setState({ isPending: false }); createNotice('error', errorMessage); case 23: case "end": return _context.stop(); } } }, _callee, this, [[4, 19]]); })); function connect() { return _connect.apply(this, arguments); } return connect; }() }, { key: "redirect", value: function redirect(connectUrl, newWindow) { if (newWindow) { newWindow.location.href = connectUrl; window.location = Object(client_settings["f" /* getAdminLink */])('admin.php?page=wc-admin'); } else { window.location = connectUrl; } } }, { key: "render", value: function render() { var installStep = this.props.installStep; var isPending = this.state.isPending; return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Stepper"], { isVertical: true, isPending: !installStep.isComplete || isPending, currentStep: installStep.isComplete ? 'connect' : 'install', steps: [installStep, { key: 'connect', label: Object(external_this_wp_i18n_["__"])('Connect your Square account', 'woocommerce'), description: Object(external_this_wp_i18n_["__"])('A Square account is required to process payments. You will be redirected to the Square website to create the connection.', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, isBusy: isPending, onClick: this.connect }, Object(external_this_wp_i18n_["__"])('Connect', 'woocommerce'))) }] }); } }]); return Square; }(external_this_wp_element_["Component"]); /* harmony default export */ var square = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) { var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]), getOption = _select.getOption, isResolving = _select.isResolving; var options = getOption('woocommerce_square_credit_card_settings'); var optionsIsRequesting = isResolving('getOption', ['woocommerce_square_credit_card_settings']); return { options: options, optionsIsRequesting: optionsIsRequesting }; }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; var _dispatch2 = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]), updateOptions = _dispatch2.updateOptions; return { createNotice: createNotice, updateOptions: updateOptions }; }))(square_Square)); // CONCATENATED MODULE: ./client/task-list/tasks/payments/wcpay.js function wcpay_createSuper(Derived) { var hasNativeReflectConstruct = wcpay_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function wcpay_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ var wcpay_WCPay = /*#__PURE__*/function (_Component) { inherits_default()(WCPay, _Component); var _super = wcpay_createSuper(WCPay); function WCPay() { classCallCheck_default()(this, WCPay); return _super.apply(this, arguments); } createClass_default()(WCPay, [{ key: "componentDidMount", value: function componentDidMount() { var _this$props = this.props, createNotice = _this$props.createNotice, markConfigured = _this$props.markConfigured; var query = Object(external_this_wc_navigation_["getQuery"])(); // Handle redirect back from WCPay on-boarding if (query['wcpay-connection-success']) { createNotice('success', Object(external_this_wp_i18n_["__"])('WooCommerce Payments connected successfully.', 'woocommerce')); markConfigured('wcpay'); } } }, { key: "render", value: function render() { return null; } }]); return WCPay; }(external_this_wp_element_["Component"]); /* harmony default export */ var wcpay = (Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; return { createNotice: createNotice }; })(wcpay_WCPay)); // CONCATENATED MODULE: ./client/task-list/tasks/payments/images/wcpay.js /* harmony default export */ var images_wcpay = (function () { return Object(external_this_wp_element_["createElement"])("svg", { width: "100", height: "64", viewBox: "-10 0 120 64", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, Object(external_this_wp_element_["createElement"])("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.78073 0.5H91.1787C96.3299 0.5 100.5 4.77335 100.5 10.0522V41.8929C100.5 47.1717 96.3299 51.4451 91.1787 51.4451H61.9883L65.9948 61.5L48.3742 51.4451H9.82161C4.67036 51.4451 0.500298 47.1717 0.500298 41.8929V10.0522C0.459415 4.81524 4.62947 0.5 9.78073 0.5Z", fill: "#7F54B3" }), Object(external_this_wp_element_["createElement"])("path", { d: "M5.48791 9.1725C6.06028 8.37648 6.91882 7.95752 8.06354 7.87373C10.1486 7.70615 11.3342 8.71165 11.6204 10.8902C12.8877 19.6464 14.2778 27.0619 15.7495 33.1368L24.7029 15.6663C25.5206 14.0743 26.5426 13.2364 27.7691 13.1526C29.568 13.0269 30.6718 14.2 31.1215 16.6718C32.1436 22.2439 33.4519 26.9781 35.0054 31.0001C36.0684 20.3586 37.8672 12.6917 40.402 7.95753C41.0152 6.78445 41.9146 6.19791 43.1002 6.11412C44.0405 6.03033 44.8991 6.3236 45.6759 6.95203C46.4526 7.58047 46.8615 8.37648 46.9432 9.34008C46.9841 10.0942 46.8615 10.7226 46.5344 11.3511C44.94 14.3676 43.6317 19.4369 42.5688 26.4754C41.5467 33.3044 41.1787 38.6251 41.424 42.4376C41.5058 43.485 41.3423 44.4067 40.9334 45.2027C40.4428 46.1244 39.707 46.6272 38.7666 46.711C37.7037 46.7948 36.5998 46.292 35.5369 45.1608C31.7348 41.1807 28.7094 35.2316 26.5018 27.3133C23.8444 32.6759 21.882 36.6979 20.6146 39.3792C18.2025 44.1134 16.1584 46.5434 14.4413 46.6691C13.3374 46.7529 12.3971 45.7893 11.5795 43.7783C9.49445 38.2899 7.24589 27.6904 4.83379 11.9795C4.71114 10.8902 4.91555 9.92662 5.48791 9.1725Z", fill: "white" }), Object(external_this_wp_element_["createElement"])("path", { d: "M93.3864 15.7499C91.9146 13.1105 89.7478 11.5185 86.8451 10.89C86.0683 10.7225 85.3324 10.6387 84.6374 10.6387C80.7127 10.6387 77.5238 12.7335 75.0299 16.923C72.904 20.4841 71.8411 24.4223 71.8411 28.7376C71.8411 31.9635 72.4952 34.7286 73.8034 37.0329C75.2752 39.6723 77.442 41.2644 80.3447 41.8928C81.1215 42.0604 81.8574 42.1442 82.5524 42.1442C86.518 42.1442 89.7069 40.0494 92.1599 35.8598C94.2858 32.2568 95.3488 28.3186 95.3488 24.0034C95.3488 20.7355 94.6946 18.0123 93.3864 15.7499ZM88.2351 27.355C87.6628 30.1201 86.6407 32.173 85.128 33.5556C83.9424 34.6449 82.8386 35.1057 81.8165 34.8962C80.8353 34.6868 80.0177 33.8069 79.4044 32.173C78.9138 30.8742 78.6685 29.5755 78.6685 28.3605C78.6685 27.3131 78.7503 26.2657 78.9547 25.3021C79.3226 23.5844 80.0177 21.9086 81.1215 20.3166C82.4706 18.2637 83.9015 17.4258 85.3733 17.719C86.3545 17.9285 87.1722 18.8083 87.7854 20.4422C88.276 21.741 88.5213 23.0398 88.5213 24.2547C88.5213 25.344 88.3987 26.3914 88.2351 27.355Z", fill: "white" }), Object(external_this_wp_element_["createElement"])("path", { d: "M67.7528 15.7499C66.281 13.1105 64.0734 11.5185 61.2116 10.89C60.4348 10.7225 59.6989 10.6387 59.0039 10.6387C55.0791 10.6387 51.8903 12.7335 49.3964 16.923C47.2705 20.4841 46.2075 24.4223 46.2075 28.7376C46.2075 31.9635 46.8616 34.7286 48.1699 37.0329C49.6417 39.6723 51.8085 41.2644 54.7112 41.8928C55.488 42.0604 56.2238 42.1442 56.9189 42.1442C60.8845 42.1442 64.0734 40.0494 66.5263 35.8598C68.6523 32.2568 69.7152 28.3186 69.7152 24.0034C69.7152 20.7355 69.0611 18.0123 67.7528 15.7499ZM62.6016 27.355C62.0292 30.1201 61.0071 32.173 59.4945 33.5556C58.3089 34.6449 57.205 35.1057 56.183 34.8962C55.2018 34.6868 54.3841 33.8069 53.7709 32.173C53.2803 30.8742 53.035 29.5755 53.035 28.3605C53.035 27.3131 53.1167 26.2657 53.3212 25.3021C53.6891 23.5844 54.3841 21.9086 55.4879 20.3166C56.8371 18.2637 58.268 17.4258 59.7398 17.719C60.721 17.9285 61.5386 18.8083 62.1519 20.4422C62.6425 21.741 62.8878 23.0398 62.8878 24.2547C62.8878 25.344 62.806 26.3914 62.6016 27.355Z", fill: "white" })); }); // CONCATENATED MODULE: ./client/task-list/tasks/payments/paypal.js function paypal_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function paypal_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { paypal_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { paypal_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function paypal_createSuper(Derived) { var hasNativeReflectConstruct = paypal_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function paypal_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ var paypal_PayPal = /*#__PURE__*/function (_Component) { inherits_default()(PayPal, _Component); var _super = paypal_createSuper(PayPal); function PayPal(props) { var _this; classCallCheck_default()(this, PayPal); _this = _super.call(this, props); _this.state = { autoConnectFailed: false, connectURL: '', isPending: false }; _this.updateSettings = _this.updateSettings.bind(assertThisInitialized_default()(_this)); return _this; } createClass_default()(PayPal, [{ key: "componentDidMount", value: function componentDidMount() { var _this$props = this.props, createNotice = _this$props.createNotice, markConfigured = _this$props.markConfigured; var query = Object(external_this_wc_navigation_["getQuery"])(); // Handle redirect back from PayPal if (query['paypal-connect']) { if (query['paypal-connect'] === '1') { createNotice('success', Object(external_this_wp_i18n_["__"])('PayPal connected successfully.', 'woocommerce')); markConfigured('paypal'); return; } /* eslint-disable react/no-did-mount-set-state */ this.setState({ autoConnectFailed: true }); /* eslint-enable react/no-did-mount-set-state */ return; } this.fetchOAuthConnectURL(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var activePlugins = this.props.activePlugins; if (!prevProps.activePlugins.includes('woocommerce-gateway-paypal-express-checkout') && activePlugins.includes('woocommerce-gateway-paypal-express-checkout')) { this.fetchOAuthConnectURL(); } } }, { key: "fetchOAuthConnectURL", value: function () { var _fetchOAuthConnectURL = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { var activePlugins, result; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: activePlugins = this.props.activePlugins; if (activePlugins.includes('woocommerce-gateway-paypal-express-checkout')) { _context.next = 3; break; } return _context.abrupt("return"); case 3: this.setState({ isPending: true }); _context.prev = 4; _context.next = 7; return external_this_wp_apiFetch_default()({ path: constants["f" /* WC_ADMIN_NAMESPACE */] + '/plugins/connect-paypal', method: 'POST' }); case 7: result = _context.sent; if (!(!result || !result.connectUrl)) { _context.next = 11; break; } this.setState({ autoConnectFailed: true }); return _context.abrupt("return"); case 11: this.setState({ connectURL: result.connectUrl, isPending: false }); _context.next = 17; break; case 14: _context.prev = 14; _context.t0 = _context["catch"](4); this.setState({ autoConnectFailed: true, isPending: false }); case 17: case "end": return _context.stop(); } } }, _callee, this, [[4, 14]]); })); function fetchOAuthConnectURL() { return _fetchOAuthConnectURL.apply(this, arguments); } return fetchOAuthConnectURL; }() }, { key: "renderConnectButton", value: function renderConnectButton() { var connectURL = this.state.connectURL; return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, href: connectURL }, Object(external_this_wp_i18n_["__"])('Connect', 'woocommerce')); } }, { key: "updateSettings", value: function () { var _updateSettings = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(values) { var _this$props2, createNotice, options, updateOptions, markConfigured, update; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: _this$props2 = this.props, createNotice = _this$props2.createNotice, options = _this$props2.options, updateOptions = _this$props2.updateOptions, markConfigured = _this$props2.markConfigured; _context2.next = 3; return updateOptions({ woocommerce_ppec_paypal_settings: paypal_objectSpread(paypal_objectSpread({}, options.woocommerce_ppec_paypal_settings), {}, { api_username: values.api_username, api_password: values.api_password, enabled: 'yes' }) }); case 3: update = _context2.sent; if (update.success) { createNotice('success', Object(external_this_wp_i18n_["__"])('PayPal connected successfully.', 'woocommerce')); markConfigured('paypal'); } else { createNotice('error', Object(external_this_wp_i18n_["__"])('There was a problem saving your payment settings.', 'woocommerce')); } case 5: case "end": return _context2.stop(); } } }, _callee2, this); })); function updateSettings(_x) { return _updateSettings.apply(this, arguments); } return updateSettings; }() }, { key: "getInitialConfigValues", value: function getInitialConfigValues() { return { api_username: '', api_password: '' }; } }, { key: "validate", value: function validate(values) { var errors = {}; if (!values.api_username) { errors.api_username = Object(external_this_wp_i18n_["__"])('Please enter your API username', 'woocommerce'); } if (!values.api_password) { errors.api_password = Object(external_this_wp_i18n_["__"])('Please enter your API password', 'woocommerce'); } return errors; } }, { key: "renderManualConfig", value: function renderManualConfig() { var isOptionsUpdating = this.props.isOptionsUpdating; var link = Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], { href: "https://docs.woocommerce.com/document/paypal-express-checkout/#section-8", target: "_blank", type: "external" }); var help = lib_default()({ mixedString: Object(external_this_wp_i18n_["__"])('Your API details can be obtained from your {{link}}PayPal account{{/link}}', 'woocommerce'), components: { link: link } }); return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Form"], { initialValues: this.getInitialConfigValues(), onSubmitCallback: this.updateSettings, validate: this.validate }, function (_ref) { var getInputProps = _ref.getInputProps, handleSubmit = _ref.handleSubmit; return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('API Username', 'woocommerce'), required: true }, getInputProps('api_username'))), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('API Password', 'woocommerce'), required: true }, getInputProps('api_password'))), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { onClick: handleSubmit, isPrimary: true, isBusy: isOptionsUpdating }, Object(external_this_wp_i18n_["__"])('Proceed', 'woocommerce')), Object(external_this_wp_element_["createElement"])("p", null, help)); }); } }, { key: "getConnectStep", value: function getConnectStep() { var _this$state = this.state, autoConnectFailed = _this$state.autoConnectFailed, connectURL = _this$state.connectURL, isPending = _this$state.isPending; var connectStep = { key: 'connect', label: Object(external_this_wp_i18n_["__"])('Connect your PayPal account', 'woocommerce') }; if (isPending) { return connectStep; } if (!autoConnectFailed && connectURL) { return paypal_objectSpread(paypal_objectSpread({}, connectStep), {}, { description: Object(external_this_wp_i18n_["__"])('A Paypal account is required to process payments. You will be redirected to the Paypal website to create the connection.', 'woocommerce'), content: this.renderConnectButton() }); } return paypal_objectSpread(paypal_objectSpread({}, connectStep), {}, { description: Object(external_this_wp_i18n_["__"])('Connect your store to your PayPal account. Don’t have a PayPal account? Create one.', 'woocommerce'), content: this.renderManualConfig() }); } }, { key: "render", value: function render() { var installStep = this.props.installStep; var isPending = this.state.isPending; return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Stepper"], { isVertical: true, isPending: !installStep.isComplete || isPending, currentStep: installStep.isComplete ? 'connect' : 'install', steps: [installStep, this.getConnectStep()] }); } }]); return PayPal; }(external_this_wp_element_["Component"]); paypal_PayPal.defaultProps = { manualConfig: false // WCS is not required for the PayPal OAuth flow, so we can default to smooth connection. }; /* harmony default export */ var paypal = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) { var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]), getOption = _select.getOption, isOptionsUpdating = _select.isOptionsUpdating; var _select2 = select(external_this_wc_data_["PLUGINS_STORE_NAME"]), getActivePlugins = _select2.getActivePlugins; var options = getOption('woocommerce_ppec_paypal_settings'); var activePlugins = getActivePlugins(); return { activePlugins: activePlugins, options: options, isOptionsUpdating: isOptionsUpdating() }; }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; var _dispatch2 = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]), updateOptions = _dispatch2.updateOptions; return { createNotice: createNotice, updateOptions: updateOptions }; }))(paypal_PayPal)); // CONCATENATED MODULE: ./client/task-list/tasks/payments/klarna.js function klarna_createSuper(Derived) { var hasNativeReflectConstruct = klarna_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function klarna_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ var klarna_Klarna = /*#__PURE__*/function (_Component) { inherits_default()(Klarna, _Component); var _super = klarna_createSuper(Klarna); function Klarna(props) { var _this; classCallCheck_default()(this, Klarna); _this = _super.call(this, props); _this.continue = _this.continue.bind(assertThisInitialized_default()(_this)); return _this; } createClass_default()(Klarna, [{ key: "continue", value: function _continue() { var _this$props = this.props, markConfigured = _this$props.markConfigured, plugin = _this$props.plugin; var slug = plugin === 'checkout' ? 'klarna-checkout' : 'klarna-payments'; markConfigured(slug); } }, { key: "renderConnectStep", value: function renderConnectStep() { var plugin = this.props.plugin; var slug = plugin === 'checkout' ? 'klarna-checkout' : 'klarna-payments'; var section = plugin === 'checkout' ? 'kco' : 'klarna_payments'; var link = Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], { href: client_settings["a" /* ADMIN_URL */] + 'admin.php?page=wc-settings&tab=checkout&section=' + section, target: "_blank", type: "external" }); var helpLink = Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], { href: 'https://docs.woocommerce.com/document/' + slug + '/#section-3', target: "_blank", type: "external" }); var configureText = lib_default()({ mixedString: Object(external_this_wp_i18n_["__"])('Klarna can be configured under your {{link}}store settings{{/link}}. Figure out {{helpLink}}what you need{{/helpLink}}.', 'woocommerce'), components: { link: link, helpLink: helpLink } }); return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("p", null, configureText), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, onClick: this.continue }, Object(external_this_wp_i18n_["__"])('Continue', 'woocommerce'))); } }, { key: "render", value: function render() { var installStep = this.props.installStep; return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Stepper"], { isVertical: true, isPending: !installStep.isComplete, currentStep: installStep.isComplete ? 'connect' : 'install', steps: [installStep, { key: 'connect', label: Object(external_this_wp_i18n_["__"])('Connect your Klarna account', 'woocommerce'), content: this.renderConnectStep() }] }); } }]); return Klarna; }(external_this_wp_element_["Component"]); /* harmony default export */ var klarna = (klarna_Klarna); // CONCATENATED MODULE: ./client/task-list/tasks/payments/payfast.js function payfast_createSuper(Derived) { var hasNativeReflectConstruct = payfast_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function payfast_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ var payfast_PayFast = /*#__PURE__*/function (_Component) { inherits_default()(PayFast, _Component); var _super = payfast_createSuper(PayFast); function PayFast() { var _temp, _this; classCallCheck_default()(this, PayFast); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return possibleConstructorReturn_default()(_this, (_temp = _this = _super.call.apply(_super, [this].concat(args)), _this.getInitialConfigValues = function () { return { merchant_id: '', merchant_key: '', pass_phrase: '' }; }, _this.validate = function (values) { var errors = {}; if (!values.merchant_id) { errors.merchant_id = Object(external_this_wp_i18n_["__"])('Please enter your merchant ID', 'woocommerce'); } if (!values.merchant_key) { errors.merchant_key = Object(external_this_wp_i18n_["__"])('Please enter your merchant key', 'woocommerce'); } if (!values.pass_phrase) { errors.pass_phrase = Object(external_this_wp_i18n_["__"])('Please enter your passphrase', 'woocommerce'); } return errors; }, _this.updateSettings = /*#__PURE__*/function () { var _ref = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee(values) { var _this$props, updateOptions, createNotice, markConfigured, update; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this$props = _this.props, updateOptions = _this$props.updateOptions, createNotice = _this$props.createNotice, markConfigured = _this$props.markConfigured; // Because the PayFast extension only works with the South African Rand // currency, force the store to use it while setting the PayFast settings _context.next = 3; return updateOptions({ woocommerce_currency: 'ZAR', woocommerce_payfast_settings: { merchant_id: values.merchant_id, merchant_key: values.merchant_key, pass_phrase: values.pass_phrase, enabled: 'yes' } }); case 3: update = _context.sent; if (update.success) { markConfigured('payfast'); createNotice('success', Object(external_this_wp_i18n_["__"])('PayFast connected successfully', 'woocommerce')); } else { createNotice('error', Object(external_this_wp_i18n_["__"])('There was a problem saving your payment setings', 'woocommerce')); } case 5: case "end": return _context.stop(); } } }, _callee); })); return function (_x) { return _ref.apply(this, arguments); }; }(), _temp)); } createClass_default()(PayFast, [{ key: "renderConnectStep", value: function renderConnectStep() { var isOptionsRequesting = this.props.isOptionsRequesting; var helpText = lib_default()({ mixedString: Object(external_this_wp_i18n_["__"])('Your API details can be obtained from your {{link}}PayFast account{{/link}}', 'woocommerce'), components: { link: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], { href: "https://www.payfast.co.za/", target: "_blank", type: "external" }) } }); return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Form"], { initialValues: this.getInitialConfigValues(), onSubmitCallback: this.updateSettings, validate: this.validate }, function (_ref2) { var getInputProps = _ref2.getInputProps, handleSubmit = _ref2.handleSubmit; return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('Merchant ID', 'woocommerce'), required: true }, getInputProps('merchant_id'))), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('Merchant Key', 'woocommerce'), required: true }, getInputProps('merchant_key'))), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["TextControl"], extends_default()({ label: Object(external_this_wp_i18n_["__"])('Passphrase', 'woocommerce'), required: true }, getInputProps('pass_phrase'))), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, isBusy: isOptionsRequesting, onClick: handleSubmit }, Object(external_this_wp_i18n_["__"])('Proceed', 'woocommerce')), Object(external_this_wp_element_["createElement"])("p", null, helpText)); }); } }, { key: "render", value: function render() { var _this$props2 = this.props, installStep = _this$props2.installStep, isOptionsRequesting = _this$props2.isOptionsRequesting; return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Stepper"], { isVertical: true, isPending: !installStep.isComplete || isOptionsRequesting, currentStep: installStep.isComplete ? 'connect' : 'install', steps: [installStep, { key: 'connect', label: Object(external_this_wp_i18n_["__"])('Connect your PayFast account', 'woocommerce'), content: this.renderConnectStep() }] }); } }]); return PayFast; }(external_this_wp_element_["Component"]); /* harmony default export */ var payfast = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withSelect"])(function (select) { var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]), isOptionsUpdating = _select.isOptionsUpdating; var isOptionsRequesting = isOptionsUpdating(); return { isOptionsRequesting: isOptionsRequesting }; }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; var _dispatch2 = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]), updateOptions = _dispatch2.updateOptions; return { createNotice: createNotice, updateOptions: updateOptions }; }))(payfast_PayFast)); // CONCATENATED MODULE: ./client/task-list/tasks/payments/methods.js /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ function getPaymentMethods(_ref) { var activePlugins = _ref.activePlugins, countryCode = _ref.countryCode, createNotice = _ref.createNotice, installAndActivatePlugins = _ref.installAndActivatePlugins, options = _ref.options, profileItems = _ref.profileItems; var settings = Object(client_settings["g" /* getSetting */])('onboarding', { stripeSupportedCountries: [], wcPayIsConnected: false }); var stripeSupportedCountries = settings.stripeSupportedCountries, wcPayIsConnected = settings.wcPayIsConnected; var hasCbdIndustry = Object(external_lodash_["some"])(profileItems.industry, { slug: 'cbd-other-hemp-derived-products' }) || false; var methods = []; if (window.wcAdminFeatures.wcpay) { var tosLink = Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], { href: 'https://wordpress.com/tos/', target: "_blank", type: "external" }); var tosPrompt = lib_default()({ mixedString: Object(external_this_wp_i18n_["__"])('By clicking "Set up," you agree to the {{link}}Terms of Service{{/link}}', 'woocommerce'), components: { link: tosLink } }); var wcPayDocLink = Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], { href: 'https://docs.woocommerce.com/document/payments/testing/dev-mode/', target: "_blank", type: "external" }); var wcPayDocPrompt = lib_default()({ mixedString: Object(external_this_wp_i18n_["__"])('Setting up a store for a client? {{link}}Start here{{/link}}', 'woocommerce'), components: { link: wcPayDocLink } }); var wcPaySettingsLink = Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], { href: Object(client_settings["f" /* getAdminLink */])('admin.php?page=wc-settings&tab=checkout&section=woocommerce_payments'), type: "wp-admin" }, Object(external_this_wp_i18n_["__"])('Settings', 'woocommerce')); methods.push({ key: 'wcpay', title: Object(external_this_wp_i18n_["__"])('WooCommerce Payments', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_i18n_["__"])('Accept credit card payments the easy way! No setup fees. No ' + 'monthly fees. Just 2.9% + $0.30 per transaction ' + 'on U.S. issued cards. ', 'woocommerce'), wcPayIsConnected && wcPaySettingsLink, !wcPayIsConnected && Object(external_this_wp_element_["createElement"])("p", null, tosPrompt), profileItems.setup_client && Object(external_this_wp_element_["createElement"])("p", null, wcPayDocPrompt)), before: Object(external_this_wp_element_["createElement"])(images_wcpay, null), onClick: function onClick(resolve, reject) { var errorMessage = Object(external_this_wp_i18n_["__"])('There was an error connecting to WooCommerce Payments. Please try again or connect later in store settings.', 'woocommerce'); var connect = function connect() { external_this_wp_apiFetch_default()({ path: constants["f" /* WC_ADMIN_NAMESPACE */] + '/plugins/connect-wcpay', method: 'POST' }).then(function (response) { window.location = response.connectUrl; }).catch(function () { createNotice('error', errorMessage); reject(); }); }; installAndActivatePlugins(['woocommerce-payments']).then(function () { return connect(); }).catch(function (error) { Object(notices["a" /* createNoticesFromResponse */])(error); reject(); }); }, visible: ['US', 'PR'].includes(countryCode) && !hasCbdIndustry, plugins: ['woocommerce-payments'], container: Object(external_this_wp_element_["createElement"])(wcpay, null), isConfigured: wcPayIsConnected, isEnabled: options.woocommerce_woocommerce_payments_settings && options.woocommerce_woocommerce_payments_settings.enabled === 'yes', optionName: 'woocommerce_woocommerce_payments_settings' }); } methods.push({ key: 'stripe', title: Object(external_this_wp_i18n_["__"])('Credit cards - powered by Stripe', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_i18n_["__"])('Accept debit and credit cards in 135+ currencies, methods such as Alipay, ' + 'and one-touch checkout with Apple Pay.', 'woocommerce')), before: Object(external_this_wp_element_["createElement"])("img", { src: client_settings["e" /* WC_ASSET_URL */] + 'images/stripe.png', alt: "" }), visible: stripeSupportedCountries.includes(countryCode) && !hasCbdIndustry, plugins: ['woocommerce-gateway-stripe'], container: Object(external_this_wp_element_["createElement"])(stripe, null), isConfigured: options.woocommerce_stripe_settings && options.woocommerce_stripe_settings.publishable_key && options.woocommerce_stripe_settings.secret_key, isEnabled: options.woocommerce_stripe_settings && options.woocommerce_stripe_settings.enabled === 'yes', optionName: 'woocommerce_stripe_settings' }, { key: 'paypal', title: Object(external_this_wp_i18n_["__"])('PayPal Checkout', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_i18n_["__"])("Safe and secure payments using credit cards or your customer's PayPal account.", 'woocommerce')), before: Object(external_this_wp_element_["createElement"])("img", { src: client_settings["e" /* WC_ASSET_URL */] + 'images/paypal.png', alt: "" }), visible: !hasCbdIndustry, plugins: ['woocommerce-gateway-paypal-express-checkout'], container: Object(external_this_wp_element_["createElement"])(paypal, null), isConfigured: options.woocommerce_ppec_paypal_settings && options.woocommerce_ppec_paypal_settings.api_username && options.woocommerce_ppec_paypal_settings.api_password, isEnabled: options.woocommerce_ppec_paypal_settings && options.woocommerce_ppec_paypal_settings.enabled === 'yes', optionName: 'woocommerce_ppec_paypal_settings' }, { key: 'klarna_checkout', title: Object(external_this_wp_i18n_["__"])('Klarna Checkout', 'woocommerce'), content: Object(external_this_wp_i18n_["__"])('Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries.', 'woocommerce'), before: Object(external_this_wp_element_["createElement"])("img", { src: client_settings["e" /* WC_ASSET_URL */] + 'images/klarna-black.png', alt: "" }), visible: ['SE', 'FI', 'NO', 'NL'].includes(countryCode) && !hasCbdIndustry, plugins: ['klarna-checkout-for-woocommerce'], container: Object(external_this_wp_element_["createElement"])(klarna, { plugin: 'checkout' }), // @todo This should check actual Klarna connection information. isConfigured: activePlugins.includes('klarna-checkout-for-woocommerce'), isEnabled: options.woocommerce_kco_settings && options.woocommerce_kco_settings.enabled === 'yes', optionName: 'woocommerce_kco_settings' }, { key: 'klarna_payments', title: Object(external_this_wp_i18n_["__"])('Klarna Payments', 'woocommerce'), content: Object(external_this_wp_i18n_["__"])('Choose the payment that you want, pay now, pay later or slice it. No credit card numbers, no passwords, no worries.', 'woocommerce'), before: Object(external_this_wp_element_["createElement"])("img", { src: client_settings["e" /* WC_ASSET_URL */] + 'images/klarna-black.png', alt: "" }), visible: ['DK', 'DE', 'AT'].includes(countryCode) && !hasCbdIndustry, plugins: ['klarna-payments-for-woocommerce'], container: Object(external_this_wp_element_["createElement"])(klarna, { plugin: 'payments' }), // @todo This should check actual Klarna connection information. isConfigured: activePlugins.includes('klarna-payments-for-woocommerce'), isEnabled: options.woocommerce_klarna_payments_settings && options.woocommerce_klarna_payments_settings.enabled === 'yes', optionName: 'woocommerce_klarna_payments_settings' }, { key: 'square', title: Object(external_this_wp_i18n_["__"])('Square', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_i18n_["__"])('Securely accept credit and debit cards with one low rate, no surprise fees (custom rates available). ' + 'Sell online and in store and track sales and inventory in one place.', 'woocommerce'), hasCbdIndustry && Object(external_this_wp_element_["createElement"])("span", { className: "text-style-strong" }, Object(external_this_wp_i18n_["__"])(' Selling CBD products is only supported by Square.', 'woocommerce'))), before: Object(external_this_wp_element_["createElement"])("img", { src: client_settings["e" /* WC_ASSET_URL */] + 'images/square-black.png', alt: "" }), visible: hasCbdIndustry && ['US'].includes(countryCode) || ['brick-mortar', 'brick-mortar-other'].includes(profileItems.selling_venues) && ['US', 'CA', 'JP', 'GB', 'AU'].includes(countryCode), plugins: ['woocommerce-square'], container: Object(external_this_wp_element_["createElement"])(square, null), isConfigured: options.wc_square_refresh_tokens && options.wc_square_refresh_tokens.length, isEnabled: options.woocommerce_square_credit_card_settings && options.woocommerce_square_credit_card_settings.enabled === 'yes', optionName: 'woocommerce_square_credit_card_settings', hasCbdIndustry: hasCbdIndustry }, { key: 'payfast', title: Object(external_this_wp_i18n_["__"])('PayFast', 'woocommerce'), content: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_i18n_["__"])('The PayFast extension for WooCommerce enables you to accept payments by Credit Card and EFT via one of South Africa’s most popular payment gateways. No setup fees or monthly subscription costs.', 'woocommerce'), Object(external_this_wp_element_["createElement"])("p", null, Object(external_this_wp_i18n_["__"])('Selecting this extension will configure your store to use South African rands as the selected currency.', 'woocommerce'))), before: Object(external_this_wp_element_["createElement"])("img", { src: client_settings["e" /* WC_ASSET_URL */] + 'images/payfast.png', alt: "PayFast logo" }), visible: ['ZA'].includes(countryCode) && !hasCbdIndustry, plugins: ['woocommerce-payfast-gateway'], container: Object(external_this_wp_element_["createElement"])(payfast, null), isConfigured: options.woocommerce_payfast_settings && options.woocommerce_payfast_settings.merchant_id && options.woocommerce_payfast_settings.merchant_key && options.woocommerce_payfast_settings.pass_phrase, isEnabled: options.woocommerce_payfast_settings && options.woocommerce_payfast_settings.enabled === 'yes', optionName: 'woocommerce_payfast_settings' }, { key: 'cod', title: Object(external_this_wp_i18n_["__"])('Cash on delivery', 'woocommerce'), content: Object(external_this_wp_i18n_["__"])('Take payments in cash upon delivery.', 'woocommerce'), before: Object(external_this_wp_element_["createElement"])(cod, null), visible: !hasCbdIndustry, isEnabled: options.woocommerce_cod_settings && options.woocommerce_cod_settings.enabled === 'yes', optionName: 'woocommerce_cod_settings' }, { key: 'bacs', title: Object(external_this_wp_i18n_["__"])('Direct bank transfer', 'woocommerce'), content: Object(external_this_wp_i18n_["__"])('Take payments via bank transfer.', 'woocommerce'), before: Object(external_this_wp_element_["createElement"])(images_bacs, null), visible: !hasCbdIndustry, container: Object(external_this_wp_element_["createElement"])(bacs, null), isConfigured: options.woocommerce_bacs_accounts && options.woocommerce_bacs_accounts.length, isEnabled: options.woocommerce_bacs_settings && options.woocommerce_bacs_settings.enabled === 'yes', optionName: 'woocommerce_bacs_settings' }); return Object(external_lodash_["filter"])(methods, function (method) { return method.visible; }); } // CONCATENATED MODULE: ./client/task-list/tasks/payments/index.js function payments_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function payments_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { payments_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { payments_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function payments_createSuper(Derived) { var hasNativeReflectConstruct = payments_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function payments_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ var payments_Payments = /*#__PURE__*/function (_Component) { inherits_default()(Payments, _Component); var _super = payments_createSuper(Payments); function Payments(props) { var _this; classCallCheck_default()(this, Payments); _this = _super.apply(this, arguments); var methods = props.methods; var enabledMethods = {}; methods.forEach(function (method) { return enabledMethods[method.key] = method.isEnabled; }); _this.state = { busyMethod: null, enabledMethods: enabledMethods, recommendedMethod: _this.getRecommendedMethod() }; _this.completeTask = _this.completeTask.bind(assertThisInitialized_default()(_this)); _this.markConfigured = _this.markConfigured.bind(assertThisInitialized_default()(_this)); _this.skipTask = _this.skipTask.bind(assertThisInitialized_default()(_this)); return _this; } createClass_default()(Payments, [{ key: "componentDidUpdate", value: function componentDidUpdate() { var recommendedMethod = this.state.recommendedMethod; var method = this.getRecommendedMethod(); if (recommendedMethod !== method) { this.setState({ recommendedMethod: method }); } } }, { key: "getRecommendedMethod", value: function getRecommendedMethod() { var methods = this.props.methods; return methods.find(function (m) { return m.key === 'wcpay' && m.visible; }) ? 'wcpay' : 'stripe'; } }, { key: "completeTask", value: function () { var _completeTask = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { var _this$props, createNotice, methods, updateOptions, update; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _this$props = this.props, createNotice = _this$props.createNotice, methods = _this$props.methods, updateOptions = _this$props.updateOptions; _context.next = 3; return updateOptions({ woocommerce_task_list_payments: { completed: 1, timestamp: Math.floor(Date.now() / 1000) } }); case 3: update = _context.sent; Object(tracks["b" /* recordEvent */])('tasklist_payment_done', { configured: methods.filter(function (method) { return method.isConfigured; }).map(function (method) { return method.key; }) }); if (update.success) { createNotice('success', Object(external_this_wp_i18n_["__"])('💰 Ka-ching! Your store can now accept payments 💳', 'woocommerce')); Object(external_this_wc_navigation_["getHistory"])().push(Object(external_this_wc_navigation_["getNewPath"])({}, '/', {})); } else { createNotice('error', Object(external_this_wp_i18n_["__"])('There was a problem updating settings', 'woocommerce')); } case 6: case "end": return _context.stop(); } } }, _callee, this); })); function completeTask() { return _completeTask.apply(this, arguments); } return completeTask; }() }, { key: "skipTask", value: function skipTask() { var _this$props2 = this.props, methods = _this$props2.methods, updateOptions = _this$props2.updateOptions; updateOptions({ woocommerce_task_list_payments: { skipped: 1, timestamp: Math.floor(Date.now() / 1000) } }); Object(tracks["b" /* recordEvent */])('tasklist_payment_skip_task', { options: methods.map(function (method) { return method.key; }) }); Object(external_this_wc_navigation_["getHistory"])().push(Object(external_this_wc_navigation_["getNewPath"])({}, '/', {})); } }, { key: "markConfigured", value: function markConfigured(method) { var enabledMethods = this.state.enabledMethods; this.setState({ enabledMethods: payments_objectSpread(payments_objectSpread({}, enabledMethods), {}, defineProperty_default()({}, method, true)) }); Object(external_this_wc_navigation_["getHistory"])().push(Object(external_this_wc_navigation_["getNewPath"])({ task: 'payments' }, '/', {})); Object(tracks["b" /* recordEvent */])('tasklist_payment_connect_method', { payment_method: method }); } }, { key: "getCurrentMethod", value: function getCurrentMethod() { var _this$props3 = this.props, methods = _this$props3.methods, query = _this$props3.query; if (!query.method) { return; } return methods.find(function (method) { return method.key === query.method; }); } }, { key: "getInstallStep", value: function getInstallStep() { var currentMethod = this.getCurrentMethod(); if (!currentMethod.plugins || !currentMethod.plugins.length) { return; } var activePlugins = this.props.activePlugins; var pluginsToInstall = currentMethod.plugins.filter(function (method) { return !activePlugins.includes(method); }); var pluginNamesString = currentMethod.plugins.map(function (pluginSlug) { return external_this_wc_data_["pluginNames"][pluginSlug]; }).join(' ' + Object(external_this_wp_i18n_["__"])('and', 'woocommerce') + ' '); return { key: 'install', label: Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('Install %s', 'woocommerce'), pluginNamesString), content: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Plugins"], { onComplete: function onComplete() { Object(tracks["b" /* recordEvent */])('tasklist_payment_install_method', { plugins: currentMethod.plugins }); }, autoInstall: true, pluginSlugs: currentMethod.plugins }), isComplete: !pluginsToInstall.length }; } }, { key: "toggleMethod", value: function toggleMethod(key) { var _this$props4 = this.props, methods = _this$props4.methods, options = _this$props4.options, updateOptions = _this$props4.updateOptions; var enabledMethods = this.state.enabledMethods; var method = methods.find(function (option) { return option.key === key; }); enabledMethods[key] = !enabledMethods[key]; this.setState({ enabledMethods: enabledMethods }); Object(tracks["b" /* recordEvent */])('tasklist_payment_toggle', { enabled: !method.isEnabled, payment_method: key }); updateOptions(defineProperty_default()({}, method.optionName, payments_objectSpread(payments_objectSpread({}, options[method.optionName]), {}, { enabled: method.isEnabled ? 'no' : 'yes' }))); } }, { key: "handleClick", value: function () { var _handleClick = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(method) { var _this2 = this; var methods, key, onClick; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: methods = this.props.methods; key = method.key, onClick = method.onClick; Object(tracks["b" /* recordEvent */])('tasklist_payment_setup', { options: methods.map(function (option) { return option.key; }), selected: key }); if (!onClick) { _context2.next = 8; break; } this.setState({ busyMethod: key }); _context2.next = 7; return new Promise(onClick).then(function () { _this2.setState({ busyMethod: null }); }).catch(function () { _this2.setState({ busyMethod: null }); }); case 7: return _context2.abrupt("return"); case 8: Object(external_this_wc_navigation_["updateQueryString"])({ method: key }); case 9: case "end": return _context2.stop(); } } }, _callee2, this); })); function handleClick(_x) { return _handleClick.apply(this, arguments); } return handleClick; }() }, { key: "render", value: function render() { var _this3 = this; var currentMethod = this.getCurrentMethod(); var _this$state = this.state, busyMethod = _this$state.busyMethod, enabledMethods = _this$state.enabledMethods, recommendedMethod = _this$state.recommendedMethod; var _this$props5 = this.props, methods = _this$props5.methods, query = _this$props5.query, requesting = _this$props5.requesting; var hasEnabledMethods = Object.keys(enabledMethods).filter(function (method) { return enabledMethods[method]; }).length; if (currentMethod) { return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Card"], { className: "woocommerce-task-payment-method is-narrow" }, Object(external_this_wp_element_["cloneElement"])(currentMethod.container, { query: query, installStep: this.getInstallStep(), markConfigured: this.markConfigured, hasCbdIndustry: currentMethod.hasCbdIndustry })); } return Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-payments" }, methods.map(function (method) { var before = method.before, container = method.container, content = method.content, isConfigured = method.isConfigured, key = method.key, title = method.title, visible = method.visible; if (!visible) { return null; } var classes = classnames_default()('woocommerce-task-payment', 'is-narrow', !isConfigured && 'woocommerce-task-payment-not-configured', 'woocommerce-task-payment-' + key); var isRecommended = key === recommendedMethod && !isConfigured; var showRecommendedRibbon = isRecommended && key !== 'wcpay'; var showRecommendedPill = isRecommended && key === 'wcpay'; return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Card"], { key: key, className: classes }, Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-payment__before" }, showRecommendedRibbon && Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-payment__recommended-ribbon" }, Object(external_this_wp_element_["createElement"])("span", null, Object(external_this_wp_i18n_["__"])('Recommended', 'woocommerce'))), before), Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-payment__text" }, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["H"], { className: "woocommerce-task-payment__title" }, title, showRecommendedPill && Object(external_this_wp_element_["createElement"])("span", { className: "woocommerce-task-payment__recommended-pill" }, Object(external_this_wp_i18n_["__"])('Recommended', 'woocommerce'))), Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-payment__content" }, content)), Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-payment__after" }, container && !isConfigured ? Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: key === recommendedMethod, isSecondary: key !== recommendedMethod, isBusy: busyMethod === key, disabled: busyMethod, onClick: function onClick() { return _this3.handleClick(method); } }, Object(external_this_wp_i18n_["__"])('Set up', 'woocommerce')) : Object(external_this_wp_element_["createElement"])(form_toggle["a" /* default */], { checked: enabledMethods[key], onChange: function onChange() { return _this3.toggleMethod(key); }, onClick: function onClick(e) { return e.stopPropagation(); } }))); }), Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-payments__actions" }, !hasEnabledMethods ? Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isLink: true, onClick: this.skipTask }, Object(external_this_wp_i18n_["__"])('My store doesn’t take payments', 'woocommerce')) : Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, isBusy: requesting, onClick: this.completeTask }, Object(external_this_wp_i18n_["__"])('Done', 'woocommerce')))); } }]); return Payments; }(external_this_wp_element_["Component"]); /* harmony default export */ var tasks_payments = (Object(compose["a" /* default */])(Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch('core/notices'), createNotice = _dispatch.createNotice; var _dispatch2 = dispatch(external_this_wc_data_["PLUGINS_STORE_NAME"]), installAndActivatePlugins = _dispatch2.installAndActivatePlugins; var _dispatch3 = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]), updateOptions = _dispatch3.updateOptions; return { createNotice: createNotice, installAndActivatePlugins: installAndActivatePlugins, updateOptions: updateOptions }; }), Object(with_select["a" /* default */])(function (select, props) { var createNotice = props.createNotice, installAndActivatePlugins = props.installAndActivatePlugins; var _select = select(external_this_wc_data_["ONBOARDING_STORE_NAME"]), getProfileItems = _select.getProfileItems; var _select2 = select(external_this_wc_data_["OPTIONS_STORE_NAME"]), getOption = _select2.getOption, isOptionsUpdating = _select2.isOptionsUpdating; var _select3 = select(external_this_wc_data_["PLUGINS_STORE_NAME"]), getActivePlugins = _select3.getActivePlugins, isJetpackConnected = _select3.isJetpackConnected; var _select4 = select(external_this_wc_data_["SETTINGS_STORE_NAME"]), getSettings = _select4.getSettings; var _getSettings = getSettings('general'), _getSettings$general = _getSettings.general, generalSettings = _getSettings$general === void 0 ? {} : _getSettings$general; var activePlugins = getActivePlugins(); var profileItems = getProfileItems(); var optionNames = ['woocommerce_woocommerce_payments_settings', 'woocommerce_stripe_settings', 'woocommerce_ppec_paypal_settings', 'woocommerce_payfast_settings', 'woocommerce_square_credit_card_settings', 'woocommerce_klarna_payments_settings', 'woocommerce_kco_settings', 'wc_square_refresh_tokens', 'woocommerce_cod_settings', 'woocommerce_bacs_settings', 'woocommerce_bacs_accounts']; var options = optionNames.reduce(function (result, name) { result[name] = getOption(name); return result; }, {}); var countryCode = Object(utils["a" /* getCountryCode */])(generalSettings.woocommerce_default_country); var methods = getPaymentMethods({ activePlugins: activePlugins, countryCode: countryCode, createNotice: createNotice, installAndActivatePlugins: installAndActivatePlugins, isJetpackConnected: isJetpackConnected(), options: options, profileItems: profileItems }); var requesting = isOptionsUpdating(); return { countryCode: countryCode, profileItems: profileItems, activePlugins: activePlugins, options: options, methods: methods, requesting: requesting }; }))(payments_Payments)); // CONCATENATED MODULE: ./client/task-list/tasks.js /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ function getAllTasks(_ref) { var profileItems = _ref.profileItems, taskListPayments = _ref.taskListPayments, query = _ref.query, toggleCartModal = _ref.toggleCartModal, installedPlugins = _ref.installedPlugins; var _getSetting = Object(client_settings["g" /* getSetting */])('onboarding', { hasPhysicalProducts: false, hasProducts: false, isAppearanceComplete: false, isTaxComplete: false, shippingZonesCount: 0 }), hasPhysicalProducts = _getSetting.hasPhysicalProducts, hasProducts = _getSetting.hasProducts, isAppearanceComplete = _getSetting.isAppearanceComplete, isTaxComplete = _getSetting.isTaxComplete, shippingZonesCount = _getSetting.shippingZonesCount; var productIds = Object(utils["d" /* getProductIdsForCart */])(profileItems, true, installedPlugins); var remainingProductIds = Object(utils["d" /* getProductIdsForCart */])(profileItems, false, installedPlugins); var paymentsCompleted = Boolean(taskListPayments && taskListPayments.completed); var paymentsSkipped = Boolean(taskListPayments && taskListPayments.skipped); var tasks = [{ key: 'store_details', title: Object(external_this_wp_i18n_["__"])('Store details', 'woocommerce'), container: null, onClick: function onClick() { window.location = Object(client_settings["f" /* getAdminLink */])('admin.php?page=wc-admin&reset_profiler=1'); }, completed: profileItems.completed, visible: true, time: Object(external_this_wp_i18n_["__"])('4 minutes', 'woocommerce') }, { key: 'purchase', title: Object(external_this_wp_i18n_["__"])('Purchase & install extensions', 'woocommerce'), container: null, onClick: function onClick() { return remainingProductIds.length ? toggleCartModal() : null; }, visible: productIds.length, completed: productIds.length && !remainingProductIds.length, time: Object(external_this_wp_i18n_["__"])('2 minutes', 'woocommerce') }, { key: 'connect', title: Object(external_this_wp_i18n_["__"])('Connect your store to WooCommerce.com', 'woocommerce'), container: Object(external_this_wp_element_["createElement"])(tasks_connect, { query: query }), visible: profileItems.items_purchased && !profileItems.wccom_connected, completed: profileItems.wccom_connected, time: Object(external_this_wp_i18n_["__"])('1 minute', 'woocommerce') }, { key: 'products', title: Object(external_this_wp_i18n_["__"])('Add my products', 'woocommerce'), container: Object(external_this_wp_element_["createElement"])(products_Products, null), completed: hasProducts, visible: true, time: Object(external_this_wp_i18n_["__"])('1 minute per product', 'woocommerce') }, { key: 'appearance', title: Object(external_this_wp_i18n_["__"])('Personalize my store', 'woocommerce'), container: Object(external_this_wp_element_["createElement"])(appearance, null), completed: isAppearanceComplete, visible: true, time: Object(external_this_wp_i18n_["__"])('2 minutes', 'woocommerce') }, { key: 'shipping', title: Object(external_this_wp_i18n_["__"])('Set up shipping', 'woocommerce'), container: Object(external_this_wp_element_["createElement"])(shipping, null), completed: shippingZonesCount > 0, visible: profileItems.product_types && profileItems.product_types.includes('physical') || hasPhysicalProducts, time: Object(external_this_wp_i18n_["__"])('1 minute', 'woocommerce') }, { key: 'tax', title: Object(external_this_wp_i18n_["__"])('Set up tax', 'woocommerce'), container: Object(external_this_wp_element_["createElement"])(tax, null), completed: isTaxComplete, visible: true, time: Object(external_this_wp_i18n_["__"])('1 minute', 'woocommerce') }, { key: 'payments', title: Object(external_this_wp_i18n_["__"])('Set up payments', 'woocommerce'), container: Object(external_this_wp_element_["createElement"])(tasks_payments, null), completed: paymentsCompleted || paymentsSkipped, onClick: function onClick() { if (paymentsCompleted || paymentsSkipped) { window.location = Object(client_settings["f" /* getAdminLink */])('admin.php?page=wc-settings&tab=checkout'); return; } Object(external_this_wc_navigation_["updateQueryString"])({ task: 'payments' }); }, visible: true, time: Object(external_this_wp_i18n_["__"])('2 minutes', 'woocommerce') }]; return Object(external_this_wp_hooks_["applyFilters"])('woocommerce_admin_onboarding_task_list', tasks, query); } // CONCATENATED MODULE: ./client/task-list/index.js function task_list_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function task_list_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { task_list_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { task_list_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function task_list_createSuper(Derived) { var hasNativeReflectConstruct = task_list_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; } function task_list_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WooCommerce dependencies */ /** * Internal dependencies */ var task_list_TaskDashboard = /*#__PURE__*/function (_Component) { inherits_default()(TaskDashboard, _Component); var _super = task_list_createSuper(TaskDashboard); function TaskDashboard(props) { var _this; classCallCheck_default()(this, TaskDashboard); _this = _super.call(this, props); _this.state = { isCartModalOpen: false, isWelcomeModalOpen: !props.modalDismissed }; return _this; } createClass_default()(TaskDashboard, [{ key: "componentDidMount", value: function componentDidMount() { var _this$props = this.props, incompleteTasks = _this$props.incompleteTasks, updateOptions = _this$props.updateOptions; document.body.classList.add('woocommerce-onboarding'); document.body.classList.add('woocommerce-task-dashboard__body'); this.recordTaskView(); this.recordTaskListView(); if (!incompleteTasks.length) { updateOptions({ woocommerce_task_list_complete: 'yes' }); } this.possiblyTrackCompletedTasks(); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props2 = this.props, completedTaskKeys = _this$props2.completedTaskKeys, incompleteTasks = _this$props2.incompleteTasks, query = _this$props2.query, updateOptions = _this$props2.updateOptions; var prevCompletedTaskKeys = prevProps.completedTaskKeys, prevIncompleteTasks = prevProps.incompleteTasks, prevQuery = prevProps.query; var prevTask = prevQuery.task; var task = query.task; if (prevTask !== task) { window.document.documentElement.scrollTop = 0; this.recordTaskView(); } if (!incompleteTasks.length && prevIncompleteTasks.length) { updateOptions({ woocommerce_task_list_complete: 'yes' }); } if (!Object(external_lodash_["isEqual"])(prevCompletedTaskKeys, completedTaskKeys)) { this.possiblyTrackCompletedTasks(); } } }, { key: "possiblyTrackCompletedTasks", value: function possiblyTrackCompletedTasks() { var _this$props3 = this.props, completedTaskKeys = _this$props3.completedTaskKeys, trackedCompletedTasks = _this$props3.trackedCompletedTasks, updateOptions = _this$props3.updateOptions; if (!Object(external_lodash_["isEqual"])(trackedCompletedTasks, completedTaskKeys)) { updateOptions({ woocommerce_task_list_tracked_completed_tasks: completedTaskKeys }); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { document.body.classList.remove('woocommerce-onboarding'); document.body.classList.remove('woocommerce-task-dashboard__body'); } }, { key: "getTasks", value: function getTasks() { var _this$props4 = this.props, profileItems = _this$props4.profileItems, query = _this$props4.query, taskListPayments = _this$props4.taskListPayments, installedPlugins = _this$props4.installedPlugins; return getAllTasks({ profileItems: profileItems, taskListPayments: taskListPayments, query: query, toggleCartModal: this.toggleCartModal.bind(this), installedPlugins: installedPlugins }).filter(function (task) { return task.visible; }); } }, { key: "getPluginsInformation", value: function getPluginsInformation() { var _this$props5 = this.props, isJetpackConnected = _this$props5.isJetpackConnected, activePlugins = _this$props5.activePlugins, installedPlugins = _this$props5.installedPlugins; return { wcs_installed: installedPlugins.includes('woocommerce-services'), wcs_active: activePlugins.includes('woocommerce-services'), jetpack_installed: installedPlugins.includes('jetpack'), jetpack_active: activePlugins.includes('jetpack'), jetpack_connected: isJetpackConnected }; } }, { key: "recordTaskView", value: function recordTaskView() { var task = this.props.query.task; // eslint-disable-next-line @wordpress/no-unused-vars-before-return var pluginsInformation = this.getPluginsInformation(); if (!task) { return; } Object(tracks["b" /* recordEvent */])('task_view', task_list_objectSpread({ task_name: task }, pluginsInformation)); } }, { key: "recordTaskListView", value: function recordTaskListView() { if (this.getCurrentTask()) { return; } var profileItems = this.props.profileItems; var tasks = this.getTasks(); Object(tracks["b" /* recordEvent */])('tasklist_view', { number_tasks: tasks.length, store_connected: profileItems.wccom_connected }); } }, { key: "keepTaskCard", value: function keepTaskCard() { Object(tracks["b" /* recordEvent */])('tasklist_completed', { action: 'keep_card' }); this.props.updateOptions({ woocommerce_task_list_prompt_shown: true }); } }, { key: "hideTaskCard", value: function hideTaskCard(action) { Object(tracks["b" /* recordEvent */])('tasklist_completed', { action: action }); this.props.updateOptions({ woocommerce_task_list_hidden: 'yes', woocommerce_task_list_prompt_shown: true }); } }, { key: "getCurrentTask", value: function getCurrentTask() { var task = this.props.query.task; var currentTask = this.getTasks().find(function (s) { return s.key === task; }); if (!currentTask) { return null; } return currentTask; } }, { key: "renderMenu", value: function renderMenu() { var _this2 = this; return Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-card__menu woocommerce-card__header-item" }, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["EllipsisMenu"], { label: Object(external_this_wp_i18n_["__"])('Task List Options', 'woocommerce'), renderContent: function renderContent() { return Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-card__section-controls" }, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { onClick: function onClick() { return _this2.hideTaskCard('remove_card'); } }, Object(external_this_wp_i18n_["__"])('Hide this', 'woocommerce'))); } })); } }, { key: "toggleCartModal", value: function toggleCartModal() { var isCartModalOpen = this.state.isCartModalOpen; if (!isCartModalOpen) { Object(tracks["b" /* recordEvent */])('tasklist_purchase_extensions'); } this.setState({ isCartModalOpen: !isCartModalOpen }); } }, { key: "closeWelcomeModal", value: function closeWelcomeModal() { // Prevent firing this event before the modal is seen. if (document.body.classList.contains('woocommerce-admin-is-loading')) { return; } this.setState({ isWelcomeModalOpen: false }); this.props.updateOptions({ woocommerce_task_list_welcome_modal_dismissed: true }); } }, { key: "renderWelcomeModal", value: function renderWelcomeModal() { var _this3 = this; return Object(external_this_wp_element_["createElement"])(modal["a" /* default */], { title: Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("span", { role: "img", "aria-hidden": "true", focusable: "false", className: "woocommerce-task-dashboard__welcome-modal-icon" }, "\uD83D\uDE80"), Object(external_this_wp_i18n_["__"])("Woo hoo - you're almost there!", 'woocommerce')), onRequestClose: function onRequestClose() { return _this3.closeWelcomeModal(); }, className: "woocommerce-task-dashboard__welcome-modal" }, Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-dashboard__welcome-modal-wrapper" }, Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-dashboard__welcome-modal-message" }, Object(external_this_wp_element_["createElement"])("p", null, Object(external_this_wp_i18n_["__"])('Based on the information you provided we’ve prepared some final set up tasks for you to perform.', 'woocommerce')), Object(external_this_wp_element_["createElement"])("p", null, Object(external_this_wp_i18n_["__"])('Once complete your store will be ready for launch - exciting!', 'woocommerce'))), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { isPrimary: true, onClick: function onClick() { return _this3.closeWelcomeModal(); } }, Object(external_this_wp_i18n_["__"])('Continue', 'woocommerce')))); } }, { key: "render", value: function render() { var _this4 = this; var query = this.props.query; var _this$state = this.state, isCartModalOpen = _this$state.isCartModalOpen, isWelcomeModalOpen = _this$state.isWelcomeModalOpen; var currentTask = this.getCurrentTask(); var listTasks = this.getTasks().map(function (task) { task.className = classnames_default()(task.completed ? 'is-complete' : null, task.className); task.before = Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task__icon" }, task.completed && Object(external_this_wp_element_["createElement"])(icon["a" /* default */], { icon: check["a" /* default */] })); task.title = Object(external_this_wp_element_["createElement"])(build_module_text["a" /* default */], { as: "div", variant: task.completed ? 'body.small' : 'button' }, task.title); if (!task.completed) { task.after = task.time ? Object(external_this_wp_element_["createElement"])("span", { className: "woocommerce-task-estimated-time" }, task.time) : Object(external_this_wp_element_["createElement"])(icon["a" /* default */], { icon: chevron_right["a" /* default */] }); } if (!task.onClick) { task.onClick = function () { return Object(external_this_wc_navigation_["updateQueryString"])({ task: task.key }); }; } return task; }); var numCompleteTasks = listTasks.filter(function (task) { return task.completed; }).length; var progressBarClass = classnames_default()('woocommerce-task-card__progress-bar', { completed: listTasks.length === numCompleteTasks }); return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("div", { className: "woocommerce-task-dashboard__container" }, currentTask ? Object(external_this_wp_element_["cloneElement"])(currentTask.container, { query: query }) : Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(card["a" /* default */], { size: "large", className: "woocommerce-task-card woocommerce-homescreen-card" }, Object(external_this_wp_element_["createElement"])("progress", { className: progressBarClass, max: listTasks.length, value: numCompleteTasks }), Object(external_this_wp_element_["createElement"])(header["a" /* default */], { size: "medium" }, Object(external_this_wp_element_["createElement"])(build_module_text["a" /* default */], { variant: "title.small" }, Object(external_this_wp_i18n_["__"])('Finish setup', 'woocommerce')), this.renderMenu()), Object(external_this_wp_element_["createElement"])(body["a" /* default */], null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["List"], { items: listTasks }))), isWelcomeModalOpen && this.renderWelcomeModal())), isCartModalOpen && Object(external_this_wp_element_["createElement"])(cart_modal, { onClose: function onClose() { return _this4.toggleCartModal(); }, onClickPurchaseLater: function onClickPurchaseLater() { return _this4.toggleCartModal(); } })); } }]); return TaskDashboard; }(external_this_wp_element_["Component"]); /* harmony default export */ var task_list = __webpack_exports__["default"] = (Object(compose["a" /* default */])(Object(with_select["a" /* default */])(function (select, props) { var _select = select(external_this_wc_data_["ONBOARDING_STORE_NAME"]), getProfileItems = _select.getProfileItems; var _select2 = select(external_this_wc_data_["OPTIONS_STORE_NAME"]), getOption = _select2.getOption; var _select3 = select(external_this_wc_data_["PLUGINS_STORE_NAME"]), getActivePlugins = _select3.getActivePlugins, getInstalledPlugins = _select3.getInstalledPlugins, isJetpackConnected = _select3.isJetpackConnected; var profileItems = getProfileItems(); var modalDismissed = getOption('woocommerce_task_list_welcome_modal_dismissed') || false; var taskListPayments = getOption('woocommerce_task_list_payments'); var trackedCompletedTasks = getOption('woocommerce_task_list_tracked_completed_tasks') || []; var payments = getOption('woocommerce_task_list_payments'); var installedPlugins = getInstalledPlugins(); var tasks = getAllTasks({ profileItems: profileItems, options: payments, query: props.query, installedPlugins: installedPlugins }); var completedTaskKeys = tasks.filter(function (task) { return task.completed; }).map(function (task) { return task.key; }); var incompleteTasks = tasks.filter(function (task) { return task.visible && !task.completed; }); var activePlugins = getActivePlugins(); return { modalDismissed: modalDismissed, profileItems: profileItems, taskListPayments: taskListPayments, isJetpackConnected: isJetpackConnected(), incompleteTasks: incompleteTasks, trackedCompletedTasks: trackedCompletedTasks, completedTaskKeys: completedTaskKeys, activePlugins: activePlugins, installedPlugins: installedPlugins }; }), Object(external_this_wp_data_["withDispatch"])(function (dispatch) { var _dispatch = dispatch(external_this_wc_data_["OPTIONS_STORE_NAME"]), updateOptions = _dispatch.updateOptions; return { updateOptions: updateOptions }; }))(task_list_TaskDashboard)); /***/ }) }]);
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. */ 'use strict'; var util = require('util'); var async = require('async'); var msRestAzure = require('ms-rest-azure'); var ResourceManagementClient = require('azure-arm-resource').ResourceManagementClient; _validateEnvironmentVariables(); var clientId = process.env['CLIENT_ID']; var domain = process.env['DOMAIN']; var secret = process.env['APPLICATION_SECRET']; var subscriptionId = process.env['AZURE_SUBSCRIPTION_ID']; var resourceClient; //Sample Config var randomIds = {}; var location = 'westus'; var resourceGroupName = _generateRandomId('testrg', randomIds); var resourceName = _generateRandomId('testresource', randomIds); var resourceProviderNamespace = 'Microsoft.KeyVault'; var parentResourcePath = ''; var resourceType = 'vaults'; var apiVersion = '2015-06-01'; /////////////////////////////////////// //Entrypoint for the sample script // /////////////////////////////////////// msRestAzure.loginWithServicePrincipalSecret(clientId, secret, domain, function (err, credentials) { if (err) return console.log(err); resourceClient = new ResourceManagementClient(credentials, subscriptionId); // Work flow of this sample: // 1. create a resource group // 2. list resource groups // 3. update a resource group // 4. create a key vault resource in the resource group // 5. get details for a given resource // 6. export the resource group template // 7. delete a resource(optional) // 8. delete a resource group(optional) async.series([ function (callback) { //Task 1 createResourceGroup(function (err, result, request, response) { if (err) { return callback(err); } callback(null, result); }); }, function (callback) { //Task 2 listResourceGroups(function (err, result, request, response) { if (err) { return callback(err); } console.log(util.format('\nResource Groups in subscription %s : \n%s', subscriptionId, util.inspect(result, { depth: null }))); callback(null, result); }); }, function (callback) { //Task 3 updateResourceGroup(function (err, result, request, response) { if (err) { return callback(err); } console.log(util.format('\nUpdated Resource Groups %s : \n%s', resourceGroupName, util.inspect(result, { depth: null }))); callback(null, result); }); }, function (callback) { //Task 4 createResource(function (err, result, request, response) { if (err) { return callback(err); } console.log(util.format('\nCreated a Key Vault resource in Resource Groups %s : \n%s', resourceGroupName, util.inspect(result, { depth: null }))); callback(null, result); }); }, function (callback) { //Task 5 getResource(function (err, result, request, response) { if (err) { return callback(err); } console.log(util.format('\nResource details: \n%s', util.inspect(result, { depth: null }))); callback(null, result); }); }, function (callback) { //Task 6 exportResourceGroupTemplate(function (err, result, request, response) { if (err) { return callback(err); } console.log(util.format('\nResource group template: \n%s', util.inspect(result, { depth: null }))); callback(null, result); }); } ], // Once above operations finish, cleanup and exit. function (err, results) { if (err) { console.log(util.format('\n??????Error occurred in one of the operations.\n%s', util.inspect(err, { depth: null }))); } else { //console.log(util.format('\n######You can browse the website at: https://%s.', results[4].enabledHostNames[0])); } console.log('\n###### Exit ######'); console.log(util.format('Please execute the following script for cleanup:\nnode cleanup.js %s %s', resourceGroupName, resourceName)); process.exit(); }); }); // Helper functions function createResourceGroup(callback) { var groupParameters = { location: location, tags: { sampletag: 'sampleValue' } }; console.log('\nCreating resource group: ' + resourceGroupName); return resourceClient.resourceGroups.createOrUpdate(resourceGroupName, groupParameters, callback); } function listResourceGroups(callback) { console.log('\nListing all resource groups: '); return resourceClient.resourceGroups.list(callback); } function updateResourceGroup(callback) { var groupParameters = { location: location, tags: { sampletag: 'helloworld' } }; console.log('\nUpdating resource group: ' + resourceGroupName); return resourceClient.resourceGroups.createOrUpdate(resourceGroupName, groupParameters, callback); } function createResource(callback) { var keyvaultParameter = { location : "West US", properties : { sku : { family : 'A', name : 'standard' }, accessPolicies : [], enabledForDeployment: true, enabledForTemplateDeployment: true, tenantId : domain }, tags : {} }; console.log(util.format('\nCreating Key Vault resource %s in resource group %s'), resourceName, resourceGroupName); return resourceClient.resources.createOrUpdate(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, keyvaultParameter, callback); } function getResource(callback) { console.log(util.format('\nGetting resource %s details in resource group %s'), resourceName, resourceGroupName); return resourceClient.resources.get(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, callback); } function exportResourceGroupTemplate(callback) { var rgParameter = { resources: ['*'] }; console.log(util.format('\nExporting resource group template: %s'), resourceGroupName); return resourceClient.resourceGroups.exportTemplate(resourceGroupName, rgParameter, callback); } function deleteResource(callback) { console.log(util.format('\nDeleting resource %s in resource group %s'), resourceName, resourceGroupName); return resourceClient.resources.deleteMethod(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, callback); } function deleteResourceGroup(callback) { console.log('\nDeleting resource group: ' + resourceGroupName); return resourceClient.resourceGroups.deleteMethod(resourceGroupName, callback); } function _validateEnvironmentVariables() { var envs = []; if (!process.env['CLIENT_ID']) envs.push('CLIENT_ID'); if (!process.env['DOMAIN']) envs.push('DOMAIN'); if (!process.env['APPLICATION_SECRET']) envs.push('APPLICATION_SECRET'); if (!process.env['AZURE_SUBSCRIPTION_ID']) envs.push('AZURE_SUBSCRIPTION_ID'); if (envs.length > 0) { throw new Error(util.format('please set/export the following environment variables: %s', envs.toString())); } } function _generateRandomId(prefix, exsitIds) { var newNumber; while (true) { newNumber = prefix + Math.floor(Math.random() * 10000); if (!exsitIds || !(newNumber in exsitIds)) { break; } } return newNumber; }
/** * (public) invite page template * called when a person is invited to whyd * @author adrienjoly, whyd **/ var config = require('../models/config.js'); var uiSnippets = require('../templates/uiSnippets.js'); var mainTemplate = require('./mainTemplate.js'); var templateLoader = require('../templates/templateLoader.js'); var pageTemplate = null; exports.refreshTemplates = function(callback) { pageTemplate = templateLoader.loadTemplate( 'app/templates/invitePage.html', callback ); }; exports.refreshTemplates(); var FIELDS = [ 'inviteCode', 'plC', // playlist contest 'iPo', // post/track from which user was invited 'fbRequest', // id of facebook request used to invite 'email', 'redirect' ]; // TODO : verify usefullness exports.renderSignupPage = function(p) { p = p || {}; // FIELDS + loggedUser var params = { title: 'Join Whyd', pageDesc: !p.sender ? mainTemplate.defaultPageMeta.desc : p.sender.name + ' uses OpenWhyd to access the billions of tracks available on the web today. ' + 'Join our community to listen to ' + p.sender.name + "'s music and add your favorite tracks!", pageThumb: !p.sender ? mainTemplate.defaultPageMeta.img : config.imgUrl('/u/' + p.sender.id), urlPrefix: config.urlPrefix, whydUrl: config.urlPrefix + '/', loggedUid: (p.loggedUser || {}).id || '', head: mainTemplate.analyticsHeading, sender: p.sender && { id: p.sender.id, name: p.sender.name, img: config.imgUrl('/u/' + p.sender.id) } }; FIELDS.map(function(field) { params[field] = p[field]; }); if (p.redirect && p.redirect[0] == '/') params.redirect = config.urlPrefix + p.redirect; return pageTemplate.render(params); }; exports.renderInvitePage = function( sender, loggedUser, inviteCode, iPo, email, fbRequest, plC, redirect ) { var params = {}; params.title = /*config.landingStream &&*/ !inviteCode ? 'Join Whyd' : 'Your invitation to Whyd'; params.pageDesc = !sender ? mainTemplate.defaultPageMeta.desc : sender.name + ' uses OpenWhyd to access the billions of tracks available on the web today. ' + 'Join our community to listen to ' + sender.name + "'s music and add your favorite tracks!"; params.pageThumb = !sender ? mainTemplate.defaultPageMeta.img : config.imgUrl('/u/' + sender.id); params.urlPrefix = config.urlPrefix; params.whydUrl = config.urlPrefix + '/'; params.loggedUid = loggedUser && loggedUser.id ? loggedUser.id : ''; params.head = mainTemplate.analyticsHeading; if (sender) { params.sender = [ { id: sender.id, name: sender.name, img: config.imgUrl('/u/' + sender.id) } ]; } if (inviteCode) params.inviteCode = inviteCode; if (plC) params.plC = plC; if (iPo) params.iPo = iPo; if (fbRequest) params.fbRequest = fbRequest; if (email) params.email = email; // TODO if (redirect) params.redirect = (redirect[0] == '/' ? config.urlPrefix : '') + redirect; var html = pageTemplate.render(params); return html; };
/** * apply_ops_wc.js * * This file tests SERVER-22270 that applyOps commands should take a writeConcern. * This first tests that invalid write concerns cause writeConcern errors. * Next, it tests replication with writeConcerns of w:2 and w:majority. * When there are 3 nodes up in a replica set, applyOps commands succeed. * It then stops replication at one seconday and confirms that applyOps commands still succeed. * It finally stops replication at another secondary and confirms that applyOps commands fail. */ (function() { "use strict"; var nodeCount = 3; var replTest = new ReplSetTest({name: 'applyOpsWCSet', nodes: nodeCount}); replTest.startSet(); var cfg = replTest.getReplSetConfig(); cfg.settings = {}; cfg.settings.chainingAllowed = false; replTest.initiate(cfg); var testDB = "applyOps-wc-test"; // Get test collection. var master = replTest.getPrimary(); var db = master.getDB(testDB); var coll = db.apply_ops_wc; function dropTestCollection() { coll.drop(); assert.eq(0, coll.find().itcount(), "test collection not empty"); } dropTestCollection(); // Set up the applyOps command. var applyOpsReq = { applyOps: [ {op: "i", ns: coll.getFullName(), o: {_id: 2, x: "b"}}, {op: "i", ns: coll.getFullName(), o: {_id: 3, x: "c"}}, {op: "i", ns: coll.getFullName(), o: {_id: 4, x: "d"}}, ] }; function assertApplyOpsCommandWorked(res) { assert.eq(3, res.applied); assert.commandWorked(res); assert.eq([true, true, true], res.results); } function assertWriteConcernError(res) { assert(res.writeConcernError); assert(res.writeConcernError.code); assert(res.writeConcernError.errmsg); } var invalidWriteConcerns = [{w: 'invalid'}, {w: nodeCount + 1}]; function testInvalidWriteConcern(wc) { jsTest.log("Testing invalid write concern " + tojson(wc)); applyOpsReq.writeConcern = wc; var res = coll.runCommand(applyOpsReq); assertApplyOpsCommandWorked(res); assertWriteConcernError(res); } // Verify that invalid write concerns yield an error. coll.insert({_id: 1, x: "a"}); invalidWriteConcerns.forEach(testInvalidWriteConcern); var secondaries = replTest.getSecondaries(); var majorityWriteConcerns = [ {w: 2, wtimeout: 30000}, {w: 'majority', wtimeout: 30000}, ]; function testMajorityWriteConcerns(wc) { jsTest.log("Testing " + tojson(wc)); // Reset secondaries to ensure they can replicate. secondaries[0].getDB('admin').runCommand( {configureFailPoint: 'rsSyncApplyStop', mode: 'off'}); secondaries[1].getDB('admin').runCommand( {configureFailPoint: 'rsSyncApplyStop', mode: 'off'}); // Set the writeConcern of the applyOps command. applyOpsReq.writeConcern = wc; dropTestCollection(); // applyOps with a full replica set should succeed. coll.insert({_id: 1, x: "a"}); var res = db.runCommand(applyOpsReq); assertApplyOpsCommandWorked(res); assert(!res.writeConcernError, 'applyOps on a full replicaset had writeConcern error ' + tojson(res.writeConcernError)); dropTestCollection(); // Stop replication at one secondary. secondaries[0].getDB('admin').runCommand( {configureFailPoint: 'rsSyncApplyStop', mode: 'alwaysOn'}); // applyOps should succeed with only 1 node not replicating. coll.insert({_id: 1, x: "a"}); res = db.runCommand(applyOpsReq); assertApplyOpsCommandWorked(res); assert(!res.writeConcernError, 'applyOps on a replicaset with 2 working nodes had writeConcern error ' + tojson(res.writeConcernError)); dropTestCollection(); // Stop replication at a second secondary. secondaries[1].getDB('admin').runCommand( {configureFailPoint: 'rsSyncApplyStop', mode: 'alwaysOn'}); // applyOps should fail after two nodes have stopped replicating. coll.insert({_id: 1, x: "a"}); applyOpsReq.writeConcern.wtimeout = 5000; res = db.runCommand(applyOpsReq); assertApplyOpsCommandWorked(res); assertWriteConcernError(res); } majorityWriteConcerns.forEach(testMajorityWriteConcerns); // Allow clean shutdown secondaries[0].getDB('admin').runCommand({configureFailPoint: 'rsSyncApplyStop', mode: 'off'}); secondaries[1].getDB('admin').runCommand({configureFailPoint: 'rsSyncApplyStop', mode: 'off'}); replTest.stopSet(); })();
import { apiLocation } from '../../config/env.json'; import axios from 'axios'; const base = apiLocation + '/internal'; axios.defaults.withCredentials = true; function get(path) { return axios.get(`${base}${path}`); } export function post(path, body) { return axios.post(`${base}${path}`, body); } function put(path, body) { return axios.put(`${base}${path}`, body); } // function del(path) { // return axios.delete(`${base}${path}`); // } /** GET **/ export function getSessionUser() { return get('/user/get-session-user'); } export function getUserProfile(username) { return get(`/api/users/get-public-profile?username=${username}`); } export function getShowCert(username, cert) { return get(`/certificate/showCert/${username}/${cert}`); } export function getUsernameExists(username) { return get(`/api/users/exists?username=${username}`); } export function getArticleById(shortId) { return get(`/n/${shortId}`); } /** POST **/ export function putUpdateLegacyCert(body) { return post('/update-my-projects', body); } export function postReportUser(body) { return post('/user/report-user', body); } export function postDeleteAccount(body) { return post('/account/delete', body); } export function postResetProgress(body) { return post('/account/reset-progress', body); } /** PUT **/ export function putUpdateMyAbout(values) { return put('/update-my-about', { ...values }); } export function putUpdateMyUsername(username) { return put('/update-my-username', { username }); } export function putUpdateMyProfileUI(profileUI) { return put('/update-my-profileui', { profileUI }); } export function putUpdateUserFlag(update) { return put('/update-user-flag', update); } export function putUserAcceptsTerms(quincyEmails) { return put('/update-privacy-terms', { quincyEmails }); } export function putUserUpdateEmail(email) { return put('/update-my-email', { email }); } export function putVerifyCert(superBlock) { return put('/certificate/verify', { superBlock }); } /** DELETE **/
import React, { Component } from 'react' import styled from 'styled-components'; import {ProductConsumer} from '../context'; import {ButtonContainer} from './Button'; import {Link} from 'react-router-dom'; export default class Modal extends Component { render() { return ( <ProductConsumer> {(value) => { const {modalOpen, closeModal} = value; const {img, title, price} = value.modalProduct; if (!modalOpen) { return null; } else { return ( <ModalContainer> <div className="container"> <div className="row"> <div id="modal" className="col-8 mx-auto col-md-6 col-lg-4 text-center text-capitalize p-5"> <h5> item added to the cart</h5> <img src={img} className="img-fluid" alt="product"></img> <h5>{title}</h5> <h5 className="text-muted">price: $ {price}</h5> <Link to='/'> <ButtonContainer onClick={()=>{ closeModal(); }}> store </ButtonContainer> </Link> <Link to='/cart'> <ButtonContainer cart onClick={()=>{ closeModal(); }}> go to cart </ButtonContainer> </Link> </div> </div> </div> </ModalContainer> ); } }} </ProductConsumer> ) } } const ModalContainer = styled.div` position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.3); display:flex; align-item:center; justify-content:center; #modal { background: var(--mainWhite); } `;
import { __decorate } from "tslib"; import { Injectable } from '@angular/core'; import * as i0 from "@angular/core"; /** * A configuration service for the [`NgbTypeahead`](#/components/typeahead/api#NgbTypeahead) component. * * You can inject this service, typically in your root component, and customize the values of its properties in * order to provide default values for all the typeaheads used in the application. */ import * as ɵngcc0 from '@angular/core'; let NgbTypeaheadConfig = class NgbTypeaheadConfig { constructor() { this.editable = true; this.focusFirst = true; this.showHint = false; this.placement = ['bottom-left', 'bottom-right', 'top-left', 'top-right']; } }; NgbTypeaheadConfig.ɵfac = function NgbTypeaheadConfig_Factory(t) { return new (t || NgbTypeaheadConfig)(); }; NgbTypeaheadConfig.ɵprov = i0.ɵɵdefineInjectable({ factory: function NgbTypeaheadConfig_Factory() { return new NgbTypeaheadConfig(); }, token: NgbTypeaheadConfig, providedIn: "root" }); (function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(NgbTypeaheadConfig, [{ type: Injectable, args: [{ providedIn: 'root' }] }], function () { return []; }, null); })(); export { NgbTypeaheadConfig }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZWFoZWFkLWNvbmZpZy5qcyIsInNvdXJjZXMiOlsiQG5nLWJvb3RzdHJhcC9uZy1ib290c3RyYXAvdHlwZWFoZWFkL3R5cGVhaGVhZC1jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDekM7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsR0FBRzs7QUFFSCxJQUFhLGtCQUFrQixHQUEvQixNQUFhLGtCQUFrQjtBQUMvQixJQURBO0FBQWdCLFFBRWQsYUFBUSxHQUFHLElBQUksQ0FBQztBQUNsQixRQUFFLGVBQVUsR0FBRyxJQUFJLENBQUM7QUFDcEIsUUFBRSxhQUFRLEdBQUcsS0FBSyxDQUFDO0FBQ25CLFFBQUUsY0FBUyxHQUFtQixDQUFDLGFBQWEsRUFBRSxjQUFjLEVBQUUsVUFBVSxFQUFFLFdBQVcsQ0FBQyxDQUFDO0FBQ3ZGLEtBQUM7QUFDRCxDQURDOzZHQUFBO0FBQ0Q7QUFQYSxrQkFBa0Isb0JBRDlCLFVBQVUsQ0FBQyxFQUFDLFVBQVUsRUFBRSxNQUFNLEVBQUMsQ0FBQyxJQUNwQixrQkFBa0IsQ0FNOUI7OztnREFDRDtBQUFDLFNBUFksa0JBQWtCO0FBQzlCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtJbmplY3RhYmxlfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7UGxhY2VtZW50QXJyYXl9IGZyb20gJy4uL3V0aWwvcG9zaXRpb25pbmcnO1xuXG4vKipcbiAqIEEgY29uZmlndXJhdGlvbiBzZXJ2aWNlIGZvciB0aGUgW2BOZ2JUeXBlYWhlYWRgXSgjL2NvbXBvbmVudHMvdHlwZWFoZWFkL2FwaSNOZ2JUeXBlYWhlYWQpIGNvbXBvbmVudC5cbiAqXG4gKiBZb3UgY2FuIGluamVjdCB0aGlzIHNlcnZpY2UsIHR5cGljYWxseSBpbiB5b3VyIHJvb3QgY29tcG9uZW50LCBhbmQgY3VzdG9taXplIHRoZSB2YWx1ZXMgb2YgaXRzIHByb3BlcnRpZXMgaW5cbiAqIG9yZGVyIHRvIHByb3ZpZGUgZGVmYXVsdCB2YWx1ZXMgZm9yIGFsbCB0aGUgdHlwZWFoZWFkcyB1c2VkIGluIHRoZSBhcHBsaWNhdGlvbi5cbiAqL1xuQEluamVjdGFibGUoe3Byb3ZpZGVkSW46ICdyb290J30pXG5leHBvcnQgY2xhc3MgTmdiVHlwZWFoZWFkQ29uZmlnIHtcbiAgY29udGFpbmVyO1xuICBlZGl0YWJsZSA9IHRydWU7XG4gIGZvY3VzRmlyc3QgPSB0cnVlO1xuICBzaG93SGludCA9IGZhbHNlO1xuICBwbGFjZW1lbnQ6IFBsYWNlbWVudEFycmF5ID0gWydib3R0b20tbGVmdCcsICdib3R0b20tcmlnaHQnLCAndG9wLWxlZnQnLCAndG9wLXJpZ2h0J107XG59XG4iXX0=
import Session from '../../src/session'; import SuspendResume from '../../src/suspend-resume'; import ApiCache from '../../src/api-cache'; import RPCMock from '../mocks/rpc-mock'; import SocketMock from '../mocks/socket-mock'; describe('Session', () => { let session; let sandbox; let suspendResume; let apis; const intercept = { executeRequests: (sess, promise) => promise, executeResponses: (sess, promise) => promise, }; const createSession = (throwError, rpc, suspendOnClose = false) => { const defaultRpc = new RPCMock({ Promise, url: 'http://localhost:4848', createSocket: url => new SocketMock(url, throwError), }); apis = new ApiCache(); suspendResume = new SuspendResume({ Promise, rpc: rpc || defaultRpc, apis }); const config = { Promise, suspendOnClose, protocol: { delta: true }, }; session = new Session({ apis, config, intercept, rpc: rpc || defaultRpc, suspendResume, }); }; beforeEach(() => { createSession(); sandbox = sinon.createSandbox(); SocketMock.on('created', socket => socket.open()); }); afterEach(() => { sandbox.restore(); SocketMock.removeAllListeners(); }); it('should be a constructor', () => { expect(Session).to.be.a('function'); expect(Session).to.throw(); }); it('should expose the config object', () => { expect(session.config).to.be.an('object'); }); it('should return a promise when open is called', () => { session.getObjectApi = () => {}; const open = session.open(); const anotherOpen = session.open(); expect(open).to.be.an.instanceOf(Promise); expect(anotherOpen).to.equal(open); }); it("should call reject callback if connection can't be established", (done) => { createSession(true); session.open().then(() => {}, () => { done(); }); }); it("should call catch reject callback if connection can't be established", (done) => { createSession(true); session.open().catch(() => { done(); }); }); describe('listeners', () => { it('should call notification listeners', () => { const event = 'notification:Foo'; const spy = sandbox.spy(); session.on(event, spy); session.emit(event, { prop: 'foo' }); expect(spy).to.have.been.calledWithExactly({ prop: 'foo' }); }); it('should emit the opened and closed events', () => { const openedCallback = sinon.spy(); const closedCallback = sinon.spy(); session.on('opened', openedCallback); session.on('closed', closedCallback); session.getObjectApi = () => {}; return session.open() .then(() => expect(openedCallback.calledOnce).to.equal(true)) .then(() => session.close()) .then(() => expect(closedCallback.calledOnce).to.equal(true)); }); }); describe('send', () => { it("should throw when trying to send a message if connection isn't established", () => { expect(session.send).to.throw(); }); it('should add `requestId` to promise chain', () => { const request = {}; const promise = session.send(request); expect(request).to.have.property('id', 1); expect(promise).to.have.property('requestId', 1); }); it('should return response argument if qHandle/qType are undefined', () => { const rpc = new RPCMock({ Promise, url: 'http://localhost:4848', createSocket: url => new SocketMock(url), }); createSession(false, rpc); sinon.stub(rpc, 'send').callsFake((data) => { data.id = 1; return Promise.resolve({ message: 'hello!' }); }); const request = {}; return session.send(request).then((response) => { expect(response).to.deep.equal({ message: 'hello!' }); }); }); it('should add additional protocol parameters to request object', () => { const rpc = new RPCMock({ Promise, url: 'http://localhost:4848', createSocket: url => new SocketMock(url), }); createSession(false, rpc); session.config.protocol.foo = 'bar'; const send = sinon.spy(rpc, 'send'); return session.send({ method: 'a', handle: 1, params: [], delta: true, xyz: 'xyz', }) .then(() => expect(send.lastCall.args[0].foo).to.equal('bar')); }); it('should honor delta blacklist', () => { const rpc = new RPCMock({ Promise, url: 'http://localhost:4848', createSocket: url => new SocketMock(url), }); createSession(false, rpc); session.config.protocol.delta = true; const send = sinon.spy(rpc, 'send'); return session.send({ method: 'a', handle: 1, params: [], delta: false, xyz: 'xyz', }) .then(() => expect(send.lastCall.args[0].delta).to.equal(false)); }); }); it('should listen to notification and message', () => { const rpc = new RPCMock({ Promise, url: 'http://localhost:4848', createSocket: url => new SocketMock(url), }); const rpcSpy = sinon.spy(rpc, 'on'); createSession(false, rpc); expect(rpcSpy).to.have.been.calledWith('notification', sinon.match.func); expect(rpcSpy).to.have.been.calledWith('message', sinon.match.func); }); it('should emit notification:method from rpc', () => { const rpc = new RPCMock({ Promise, url: 'http://localhost:4848', createSocket: url => new SocketMock(url), }); createSession(false, rpc); const spy = sinon.spy(session, 'emit'); rpc.emit('notification', { method: 'FooBar', params: { prop: 'bar' } }); expect(spy).to.have.been.calledWith('notification:FooBar', { prop: 'bar' }); }); it('should emit notifications:* from rpc', () => { const rpc = new RPCMock({ Promise, url: 'http://localhost:4848', createSocket: url => new SocketMock(url), }); createSession(false, rpc); const spy = sinon.spy(session, 'emit'); rpc.emit('notification', { method: 'Foo', params: { prop: 'foo' } }); rpc.emit('notification', { method: 'FooBar', params: { prop: 'bar' } }); expect(spy.firstCall).to.have.been.calledWithExactly('notification:*', 'Foo', { prop: 'foo' }); expect(spy.thirdCall).to.have.been.calledWithExactly('notification:*', 'FooBar', { prop: 'bar' }); }); it('should process message from rpc', () => { const rpc = new RPCMock({ Promise, url: 'http://localhost:4848', createSocket: url => new SocketMock(url), }); createSession(false, rpc); session.removeAllListeners(); const on = sinon.spy(); const emit = sinon.spy(); const removeAllListeners = sinon.spy(); session.apis.add(1, { on, emit, removeAllListeners }); session.apis.add(2, { on, emit, removeAllListeners }); session.apis.add(3, { on, emit, removeAllListeners }); rpc.emit('message', { change: [1, 2, 3] }); expect(emit.calledThrice).to.equal(true); emit.getCalls().forEach(call => expect(call.args[0]).to.equal('changed')); emit.resetHistory(); rpc.emit('message', { close: [1, 2, 3] }); expect(emit.calledThrice).to.equal(true); emit.getCalls().forEach(call => expect(call.args[0]).to.equal('closed')); expect(removeAllListeners.calledThrice).to.equal(true); }); it('should emit socket error', () => { const rpc = new RPCMock({ Promise, url: 'http://localhost:4848', createSocket: url => new SocketMock(url), }); createSession(false, rpc); const emit = sinon.spy(session, 'emit'); rpc.emit('socket-error', 'fubar'); expect(emit).to.have.been.calledWith('socket-error', 'fubar'); }); it('should close', () => { const rpc = new RPCMock({ Promise, url: 'http://localhost:4848', createSocket: url => new SocketMock(url), }); createSession(false, rpc); session.getObjectApi = () => {}; session.open(); const close = sinon.spy(rpc, 'close'); const closePromise = session.close(); expect(closePromise).to.be.an.instanceOf(Promise); expect(close.calledOnce).to.equal(true); }); describe('addToPromiseChain', () => { it('should add value on promise', () => { const promise = Promise.resolve(); Session.addToPromiseChain(promise, 'foo', 'bar'); expect(promise.foo).to.equal('bar'); }); it('should add value to chained promise', () => { const promise = Promise.resolve(); Session.addToPromiseChain(promise, 'foo', 'bar'); const p1 = promise.then(); const p2 = p1.then(); expect(p1.foo).to.equal('bar'); expect(p2.foo).to.equal('bar'); }); it('should chain as normal', () => { const promise = Promise.resolve('baz'); Session.addToPromiseChain(promise, 'foo', 'bar'); const p1 = promise.then(s => `${s}1`); return expect(p1).to.eventually.equal('baz1'); }); }); describe('suspend/resume', () => { it('should reject send() calls during suspended state', () => { suspendResume.isSuspended = true; expect(session.send()).to.eventually.be.rejectedWith('Session suspended'); }); it('should not trigger events during suspended state', () => { suspendResume.isSuspended = true; const spy = sinon.spy(); session.on('socket-error', spy); session.on('suspended', spy); session.on('closed', spy); session.onRpcError(); session.onRpcClosed(); session.onRpcMessage(); expect(spy.callCount).to.equal(0); }); it('should close socket and emit suspended', () => { const spy = sinon.spy(); const stub = sinon.stub(session.rpc, 'close').returns(Promise.resolve()); session.on('suspended', spy); return session.suspend().then(() => { expect(suspendResume.isSuspended).to.equal(true); expect(stub.calledOnce).to.equal(true); expect(spy.calledOnce).to.equal(true); }); }); it('should set session as suspended when suspendOnClose is true', () => { createSession(false, null, true); apis.add(-1, { on: sinon.stub() }); const spy = sinon.spy(); session.on('suspended', spy); return session.open() .then(() => session.rpc.close(9999)) .then(() => { expect(suspendResume.isSuspended).to.equal(true); expect(spy.callCount).to.equal(1); }); }); it('should open socket and emit resumed', () => { const spy = sinon.spy(); suspendResume.isSuspended = true; suspendResume.resume = () => Promise.resolve(); session.on('resumed', spy); return session.resume().then(() => { expect(spy.calledOnce).to.equal(true); }); }); }); describe('getObjectApi', () => { it('should return an existing api', () => { const cacheEntry = { Foo: 'bar', on: sinon.stub(), }; apis.add(-1, cacheEntry); const api = session.getObjectApi({ handle: -1, id: 'id_1234', type: 'Foo', genericType: 'Bar', }); expect(api).to.equal(cacheEntry); }); it('should create and return an api', () => { const create = sinon.stub().returns({ on: sinon.spy() }); const generate = sinon.stub().returns(create); session.definition = { generate }; session.getObjectApi({ handle: -1, id: 'id_1234', type: 'Foo', genericType: 'Bar', }); expect(generate).to.be.calledWith('Foo'); expect(create).to.be.calledWith(session, -1, 'id_1234', 'Bar'); }); }); });
/** * Generated bundle index. Do not edit. */ export * from './public-api'; export { ConfigurableFocusTrapConfig as ɵangular_material_src_cdk_a11y_a11y_b } from './focus-trap/configurable-focus-trap-config'; export { FocusTrapManager as ɵangular_material_src_cdk_a11y_a11y_a } from './focus-trap/focus-trap-manager'; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3NyYy9jZGsvYTExeS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0EsR0FBRztBQUVILGNBQWMsY0FBYyxDQUFDO0FBRTdCLE9BQU8sRUFBQywyQkFBMkIsSUFBSSxxQ0FBcUMsRUFBQyxNQUFNLDZDQUE2QyxDQUFDO0FBQ2pJLE9BQU8sRUFBQyxnQkFBZ0IsSUFBSSxxQ0FBcUMsRUFBQyxNQUFNLGlDQUFpQyxDQUFDO0FBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG5cbmV4cG9ydCB7Q29uZmlndXJhYmxlRm9jdXNUcmFwQ29uZmlnIGFzIMm1YW5ndWxhcl9tYXRlcmlhbF9zcmNfY2RrX2ExMXlfYTExeV9ifSBmcm9tICcuL2ZvY3VzLXRyYXAvY29uZmlndXJhYmxlLWZvY3VzLXRyYXAtY29uZmlnJztcbmV4cG9ydCB7Rm9jdXNUcmFwTWFuYWdlciBhcyDJtWFuZ3VsYXJfbWF0ZXJpYWxfc3JjX2Nka19hMTF5X2ExMXlfYX0gZnJvbSAnLi9mb2N1cy10cmFwL2ZvY3VzLXRyYXAtbWFuYWdlcic7Il19
const pageRenderer = require('../../component-tests/pageRenderer'); const page = '../templates/case/case.njk'; const render = pageRenderer(page); describe(page, () => { let wrapper; const params = { deal: { _id: '12345678', details: { submissionType: 'Automatic Inclusion Notice', }, submissionDetails: { supplierName: 'The Supplier name', buyerName: 'The Buyer name', }, } }; beforeEach(() => { wrapper = render(params); }); it('should render case summary component', () => { wrapper.expectElement('[data-cy="case-summary"]').toExist(); }); it('should render case sub navigation', () => { wrapper.expectElement('[data-cy="case-sub-navigation"]').toExist(); }); });
import { NavigationContainer } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; import MainScreen from './scr/screen/MainScreen'; import MemberScreen from './scr/screen/MemberScreen'; import ProfileScreen from './scr/screen/ProfileScreen'; import * as React from "react"; import color from './scr/constant/color'; const Stack = createStackNavigator() const defaultStackNavOption={ headerStyle: { backgroundColor: color.primaryColor }, headerTintColor: "white", } function App() { return ( <NavigationContainer > <Stack.Navigator initialRouteName="Home" screenOptions={ defaultStackNavOption } > <Stack.Screen name="Home" component={MainScreen} options={{headerShown: false}}></Stack.Screen> <Stack.Screen name="MemberScreen" component={MemberScreen} ></Stack.Screen> <Stack.Screen name="ProfileScreen" component={ProfileScreen} ></Stack.Screen> </Stack.Navigator> </NavigationContainer> ) } export default App;
function request_unhighlight(lemma) { chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { chrome.tabs.sendMessage(tabs[0].id, {wdm_unhighlight: lemma}); }); } function make_id_suffix(text) { var before = btoa(text); var after = before.replace(/\+/g, '_').replace(/\//g, '-').replace(/=/g, '_') return after; } function sync_if_needed() { var req_keys = ['wd_last_sync', 'wd_gd_sync_enabled', 'wd_last_sync_error']; chrome.storage.local.get(req_keys, function(result) { var wd_last_sync = result.wd_last_sync; var wd_gd_sync_enabled = result.wd_gd_sync_enabled; var wd_last_sync_error = result.wd_last_sync_error; if (!wd_gd_sync_enabled || wd_last_sync_error != null) { return; } var cur_date = new Date(); var mins_passed = (cur_date.getTime() - wd_last_sync) / (60 * 1000); var sync_period_mins = 30; if (mins_passed >= sync_period_mins) { chrome.runtime.sendMessage({wdm_request: "gd_sync", interactive_mode: false}); } }); } function add_lexeme(lexeme, result_handler) { var req_keys = ['words_discoverer_eng_dict', 'wd_idioms', 'wd_user_vocabulary', 'wd_user_vocab_added', 'wd_user_vocab_deleted']; chrome.storage.local.get(req_keys, function(result) { var dict_words = result.words_discoverer_eng_dict; var dict_idioms = result.wd_idioms; var user_vocabulary = result.wd_user_vocabulary; var wd_user_vocab_added = result.wd_user_vocab_added; var wd_user_vocab_deleted = result.wd_user_vocab_deleted; if (lexeme.length > 100) { result_handler("bad", undefined); return; } lexeme = lexeme.toLowerCase(); lexeme = lexeme.trim(); if (!lexeme) { result_handler("bad", undefined); return; } var key = lexeme; if (dict_words.hasOwnProperty(lexeme)) { var wf = dict_words[lexeme]; if (wf) { key = wf[0]; } } else if (dict_idioms.hasOwnProperty(lexeme)) { var wf = dict_idioms[lexeme]; if (wf && wf != -1) { key = wf; } } if (user_vocabulary.hasOwnProperty(key)) { result_handler("exists", key); return; } var new_state = {'wd_user_vocabulary': user_vocabulary}; user_vocabulary[key] = 1; if (typeof wd_user_vocab_added !== 'undefined') { wd_user_vocab_added[key] = 1; new_state['wd_user_vocab_added'] = wd_user_vocab_added; } if (typeof wd_user_vocab_deleted !== 'undefined') { delete wd_user_vocab_deleted[key]; new_state['wd_user_vocab_deleted'] = wd_user_vocab_deleted; } chrome.storage.local.set(new_state, function() { sync_if_needed(); result_handler("ok", key); }); }); } function make_hl_style(hl_params) { if (!hl_params.enabled) return undefined; result = ""; if (hl_params.bold) result += "font-weight:bold;"; if (hl_params.useBackground) result += "background-color:" + hl_params.backgroundColor + ";"; if (hl_params.useColor) result += "color:" + hl_params.color + ";"; if (!result) return undefined; result += "font-size:inherit;display:inline;"; return result; } function localizeHtmlPage() { //Localize by replacing __MSG_***__ meta tags var objects = document.getElementsByTagName('html'); for (var j = 0; j < objects.length; j++) { var obj = objects[j]; var valStrH = obj.innerHTML.toString(); var valNewH = valStrH.replace(/__MSG_(\w+)__/g, function(match, v1) { return v1 ? chrome.i18n.getMessage(v1) : ""; }); if(valNewH != valStrH) { obj.innerHTML = valNewH; } } } function spformat(src) { var args = Array.prototype.slice.call(arguments, 1); return src.replace(/{(\d+)}/g, function(match, number) { return typeof args[number] != 'undefined' ? args[number] : match; }); }
import type * as ns from "ModuleName";
var events = [ {'Date': new Date(2020, 6, 7), 'Title': 'Doctor appointment at 3:25pm.'}, {'Date': new Date(2020, 6, 18), 'Title': 'New Garfield movie comes out!', 'Link': 'https://garfield.com'}, {'Date': new Date(2020, 6, 27), 'Title': '25 year anniversary', 'Link': 'https://www.google.com.au/#q=anniversary+gifts'}, ]; var settings = {}; var element = document.getElementById('caleandar'); caleandar(element, events, settings);
import { Config } from 'curvature/base/Config'; import { Import } from 'curvature/base/Import'; import { View as BaseView } from 'curvature/base/View'; import { CurvatureFrame } from '../../control/CurvatureFrame'; import { Editor } from '../../component/editor/Editor'; import { rawquire } from 'rawquire/rawquire.macro'; const Legacy = require('Config'); export class View extends BaseView { constructor() { super(); this.template = require('./template'); this.args.theme = Config.get('theme'); const sandbox = new CurvatureFrame; const editor = new Editor; editor.args.files = [ { filename: '*' , label: '*' } , { filename: 'SvgExample.js' , label: 'SvgExample.js' , value: rawquire('./sample/SvgExample.js') , type: 'application/javascript' } , { filename: 'svg-example-template.svg' , label: 'svg-example-template.svg' , value: rawquire('./sample/svg-example-template.svg') , type: 'application/xml' } , { filename: 'svg-example-initialize.js' , label: 'svg-example-initialize.js' , value: rawquire('./sample/svg-example-initialize.js') , type: 'application/javascript' , hide: true } , { filename: 'result' , label: 'result' , control: sandbox } ]; this.args.editor = editor; this.args.sandbox = sandbox; editor.addEventListener('execute', ()=>{ sandbox.buildPage(); }); } }
import React, { Component } from 'react' import styled from 'styled-components' import { colors, fonts } from './theme' class Footer extends Component { render() { return ( <Container> © {new Date().getFullYear()}, Built with {` `} <a href="https://www.gatsbyjs.org">Gatsby</a> </Container> ) } } export default Footer
memberSearchIndex = [{"p":"main","c":"UsingTheFlowLayout","l":"main(String[])","url":"main-java.lang.String:A-"},{"p":"main","c":"UsingTheFlowLayout","l":"UsingTheFlowLayout()"}]
var ditasearch = { div : document.getElementsByClassName("ditasearch")[0], init : function(){ if (typeof ditasearch.div != "undefined") { // Functional CSS var css = document.createTextNode('\ .ditasearch { overflow: visible; height: 1.5em; } \ .ditasearch > * { width: 100%; margin: 0; padding: 2px; border: 1px solid #bfbfbf; font: inherit; } \ .ditasearch > input { } \ .ditasearch > nav { max-height: 15em; overflow-y: auto; background: #e7f2d2; opacity: .99; padding: 0 2px; border-top: 0px none;} \ .ditasearch > nav > ol { margin: 10px 0 0 0; } .ditasearch > nav > ol > li {margin: 0 !important; padding: .25em !important;} \ .ditasearch > nav > ol > li > a:focus {outline:0} .ditasearch > nav > ol > li.dsselected { background-color: #cae29d; } \ .ditasearch > nav > ol p { margin: 0 0 10px 0; font-size: 90%; } \ .ditasearch > nav.dspending * { color: #bfbfbf; } \ .ditasearch > nav.dshidden { display: none } \ '); var style = document.createElement("STYLE"); style.setAttribute("type","text/css"); style.appendChild(css); document.getElementsByTagName("HEAD")[0].appendChild(style); // HTML ditasearch.div.innerHTML = '<input type="text" placeholder="' + ditasearch.strings.input_placeholder + '" aria-label="' + ditasearch.strings.input_aria_label + '"><nav class="dshidden" aria-live="polite" aria-label="' + ditasearch.strings.results_aria_label + '"></nav>'; ditasearch.div.setAttribute("role","search"); ditasearch.div.setAttribute("aria-label",ditasearch.strings.searchdiv_aria_label); // Shorthand for child elements ditasearch.div.input = ditasearch.div.querySelector("input"); ditasearch.div.results = ditasearch.div.querySelector("nav"); var saved = ditasearch.load(); if (saved != null) { ditasearch.div.input.value = saved.query; ditasearch.results.toHTML(saved.results); ditasearch.results.hide(); } // Event handlers ditasearch.div.addEventListener("click", ditasearch.results.show); ditasearch.div.addEventListener("blur", ditasearch.cancel); ditasearch.div.input.addEventListener("focus", ditasearch.results.show); ditasearch.div.input.addEventListener("input", ditasearch.delaySearch); ditasearch.div.addEventListener("keydown", function(event){ ditasearch.keyboard( event ); }); ditasearch.div.addEventListener("click", function(event) { event.stopPropagation(); }); document.getElementsByTagName("BODY")[0].addEventListener("click", ditasearch.cancel); ditasearch.div.results.addEventListener("focus", function ( event ) { event.target.parentNode.className = "dsselected"; }, true); ditasearch.div.results.addEventListener("blur", function ( event ) { event.target.parentNode.className = ""; }, true); ditasearch.div.results.addEventListener("click", function ( event ) { if ( event.target.nodeName == 'A' ) { event.stopPropagation(); ditasearch.cancel(); } }); } }, keyboard : function ( event ) { var key = event.target.nodeName + "-" + event.which; var current = event.target; var navTarget = null; switch ( key ) { case "INPUT-27": ditasearch.cancel(); break; case "A-27": ditasearch.cancel(); break; case "INPUT-13": event.stopPropagation(); navTarget = current.nextElementSibling; break; case "INPUT-40": event.stopPropagation(); navTarget = current.nextElementSibling; break; case "A-40": event.stopPropagation(); navTarget = current.parentNode.nextElementSibling; break; case "A-38": event.stopPropagation(); navTarget = current.parentNode.previousElementSibling; navTarget = (navTarget) ? navTarget : current.parentNode.parentNode.parentNode.previousElementSibling; break; } navTarget = (navTarget && (navTarget.nodeName == 'LI' || navTarget.nodeName == 'NAV')) ? navTarget.getElementsByTagName("A")[0] : navTarget; if (navTarget) { navTarget.focus(); } // to style the active li: // add/remove li class with onfocus/onblur events for the A child }, timer : null, cancel : function() { window.clearTimeout(ditasearch.timer); ditasearch.div.input.blur(); ditasearch.results.hide(); }, delaySearch : function() { window.clearTimeout(ditasearch.timer); ditasearch.timer = window.setTimeout(ditasearch.search,500); ditasearch.results.pending(); }, query : { value : "", get : function() { ditasearch.query.value = ditasearch.div.input.value; return ditasearch.query.prestem(ditasearch.query.value); }, prestem : function( words ) { words = words.toLowerCase(); words = words.replace(/([0-9])[,\.]+(?=[0-9])/g,"$1"); words = words.replace(/([0-9][0-9,\.]*[0-9])/g," $1 "); // digits2words var ones = words.replace(/([a-z])1/g,"$1one").replace(/1([a-z])/g,"one$1"); var tos = ones.replace(/([a-z])2/g,"$1to").replace(/2([a-z])/g,"to$1"); var fors = tos.replace(/([a-z])4/g,"$1for").replace(/4([a-z])/g,"for$1"); words = words.replace(/[^a-z0-9' ]/g," "); return words.trim(); } }, "comparestrings" : function( stringa, stringb ) { // need to normalize spaces or remove ellipses? var stringa = stringa || ''; var stringb = stringb || ''; var a = stringa.trim(); var b = stringb.trim(); if (a == b) { return 100; } else { var l = Math.min(a.length, b.length); a = a.substr(0,l); b = b.substr(0,l); for (var i = 0; a.substr(0,i) == b.substr(0,i); i++) {} return Math.round(i*100/l); } }, "search" : function(){ var query = ditasearch.query.get(); var terms = query.split(" "); ditasearchStems = []; for (var i = 0; i < terms.length; i++) { // stem each search term ditasearchStems.push(ditasearch.porter2.stem(terms[i])); } ditasearchStems = ditasearchStems.concat(ditasearch.getSynonyms(ditasearchStems)); var results = []; for (var i = 0; i < ditasearchStems.length; i++) { // each search stem (including synonyms) var termbonus = (i >= terms.length ? 100 : 1000 ); // reduced bonus for synonyms var stem = ditasearchStems[i]; if ( typeof(ditasearch.helpindex[stem]) != 'undefined' ) { for (var j = 0; j < ditasearch.helpindex[stem].length; j++) { // each result for the term var thishref = Object.keys(ditasearch.helpindex[stem][j])[0]; var thissummary = ditasearch.topicsummaries[thishref] || {"searchtitle":"","shortdesc": ""}; var thistitle = (thissummary.searchtitle.length > 0) ? thissummary.searchtitle.replace(/[<>]/gi,'') : "***"; var thisdesc = (thissummary.shortdesc.length > 0) ? thissummary.shortdesc.replace(/[<>]/gi,'') : ""; var thisresult = { "title" : thistitle, "href" : thishref, "shortdesc" : thisdesc, "terms" : stem, "score" : parseInt(ditasearch.helpindex[stem][j][thishref]) + termbonus }; if (ditasearchStems.length > 1) { // combine dups var matched = results.filter(function(item){ return item.href == thishref; }); if (matched.length == 1) { // matched.length can be 0 or 1 var unmatched = results.filter(function(item){ return item.href != thishref; }); thisresult.terms += " " + matched[0].terms; thisresult.score += matched[0].score; results = unmatched; } } results.push(thisresult); } } } if ( query == "") { ditasearch.results.clear(); sessionStorage.removeItem("ditasearch"); } else if ( results.length == 0 ) { results.push({ "title" : ditasearch.strings.results_no_results }); ditasearch.save({"query":ditasearch.query.value, "results":results}); ditasearch.results.toHTML(results); } else { results.sort(function(a,b) {return b.score - a.score}); ditasearch.save({"query":ditasearch.query.value, "results":results}); ditasearch.results.toHTML(results); } }, save : function(object) { sessionStorage.setItem("ditasearch",JSON.stringify(object)); }, load : function() { return JSON.parse(sessionStorage.getItem("ditasearch")); }, "getSynonyms" : function(stemlist){ var synonyms = []; for (var i = 0; i < stemlist.length; i++) { for (var j = stemlist.length; j >= i; j--) { // find longest matching phrase from end var phrase = stemlist.slice(i,j+1).join('_'); if ( phrase in ditasearch.configs.synonyms ) { synonyms = synonyms.concat(ditasearch.configs.synonyms[phrase]); } } } // remove duplicates for (var i = 0; i < synonyms.length; i++) { for (var j = 0; j < stemlist.length; j++) { if (synonyms[i] == stemlist[j]) { synonyms.splice(i,1); } } } for (var i = 0; i < synonyms.length; i++) { for (var j = i+1; j < synonyms.length; j++) { if (synonyms[i] == synonyms[j]) { synonyms.splice(j,1); } } } return synonyms; }, results : { "pending" : function() { ditasearch.div.results.className = "dspending"; }, "toHTML" : function (results) { /* results data structure : "title" : string, "href" : string, "shortdesc" : string, "terms" : string, "score" : number */ var alinkbase = '<a href="' + ditasearch.div.getAttribute("data-searchroot"); var queryparam = '?query=' + encodeURIComponent(ditasearch.query.value); var resultsHTML = "<ol>"; for (var i = 0; i < results.length; i++) { var scoreattr = stemsattr = ''; if (typeof results[i].score == "number") { scoreattr = ' data-score="' + results[i].score + '"'; } if (typeof results[i].terms == "string") { stemsattr = ' data-stems="' + results[i].terms + '"'; } var alink = (typeof results[i].href == "string" && results[i].href.length > 0) ? alinkbase + results[i].href + queryparam + '">' + results[i].title + '</a>' : '<p>' + results[i].title + '</p>'; var shortdesc = (typeof results[i].shortdesc == "string" && results[i].shortdesc.length > 0) ? '<p class="shortdesc">' + results[i].shortdesc + '</p>' : ''; resultsHTML += '<li' + scoreattr + stemsattr + '>' + alink + shortdesc + '</li>'; } resultsHTML += "</ol>"; ditasearch.div.results.innerHTML = resultsHTML; ditasearch.div.results.scrollTop = 0; ditasearch.results.show(); }, "show" : function() { ditasearch.div.results.className = ""; }, "hide" : function() { ditasearch.div.results.className = "dshidden"; }, "clear" : function() { ditasearch.div.results.innerHTML = ""; } }, "remove" : function() { ditasearch.div.innerHTML = ""; }, "porter2" : { apos : "'", nonwordchars : "[^a-z']", exceptionlist : [ {"skis":"ski"},{"skies":"sky"},{"dying":"die"},{"lying":"lie"},{"tying":"tie"},{"idly":"idl"},{"gently":"gentl"},{"ugly":"ugli"},{"early":"earli"},{"only":"onli"},{"singly":"singl"},{"sky":"sky"},{"news":"news"},{"howe":"howe"},{"atlas":"atlas"},{"cosmos":"cosmos"},{"bias":"bias"},{"andes":"andes"},{"cacti":"cactus"},{"addenda":"addendum"},{"appendices":"appendix"},{"bases":"basi"},{"codices":"codex"},{"compendia":"compendium"},{"crematoria":"crematorium"},{"crises":"crisi"},{"cruces":"crux"},{"ellipses":"ellipsi"},{"foci":"focus"},{"formulae":"formula"},{"genera":"genus"},{"helices":"helix"},{"indices":"index"},{"matrices":"matrix"},{"maxima":"maximum"},{"memoranda":"memorandum"},{"minima":"minimum"},{"nuclei":"nucleus"},{"oases":"oasi"},{"pedagogical":"pedagogi"},{"radices":"radix"},{"radii":"radius"},{"referenda":"referendum"},{"stigmata":"stigma"},{"strata":"stratum"},{"theses":"thesi"},{"vortices":"vortex"},{"arose":"aris"},{"arisen":"aris"},{"awaken":"awak"},{"awoke":"awak"},{"awoken":"awak"},{"was":"be"},{"were":"be"},{"been":"be"},{"bore":"bear"},{"born":"bear"},{"beaten":"beat"},{"became":"becom"},{"began":"begin"},{"begun":"begin"},{"bent":"bend"},{"bound":"bind"},{"bit":"bite"},{"bitten":"bite"},{"bled":"bleed"},{"blew":"blow"},{"blown":"blow"},{"broke":"break"},{"broken":"break"},{"bred":"breed"},{"brought":"bring"},{"built":"build"},{"burnt":"burn"},{"bought":"buy"},{"caught":"catch"},{"chose":"choos"},{"chosen":"choos"},{"clung":"cling"},{"came":"come"},{"crept":"creep"},{"dealt":"deal"},{"dug":"dig"},{"dove":"dive"},{"did":"do"},{"done":"do"},{"drew":"draw"},{"drawn":"draw"},{"drank":"drink"},{"drunk":"drink"},{"drove":"drive"},{"driven":"drive"},{"ate":"eat"},{"eaten":"eat"},{"fell":"fall"},{"fallen":"fall"},{"fed":"feed"},{"felt":"feel"},{"fought":"fight"},{"found":"find"},{"fled":"flee"},{"flung":"fling"},{"flew":"fli"},{"flown":"fli"},{"forbad":"forbid"},{"forbidden":"forbid"},{"foresaw":"forese"},{"foreseen":"forese"},{"forgot":"forget"},{"forgotten":"forget"},{"forgave":"forgiv"},{"forgiven":"forgiv"},{"forsook":"forsak"},{"forsaken":"forsak"},{"froze":"freez"},{"frozen":"freez"},{"frostbitten":"frostbit"},{"got":"get"},{"gotten":"get"},{"gave":"give"},{"given":"give"},{"went":"go"},{"gone":"go"},{"ground":"grind"},{"grew":"grow"},{"grown":"grow"},{"handwritten":"handwrit"},{"hung":"hang"},{"had":"have"},{"heard":"hear"},{"hid":"hide"},{"hidden":"hide"},{"held":"hold"},{"inlaid":"inlay"},{"interwove":"interweav"},{"interwoven":"interweav"},{"kept":"keep"},{"knelt":"kneel"},{"knew":"know"},{"known":"know"},{"laid":"lay"},{"led":"lead"},{"leapt":"leap"},{"left":"leav"},{"lent":"lend"},{"lay":"lie"},{"lain":"lie"},{"lit":"light"},{"lost":"lose"},{"made":"make"},{"meant":"mean"},{"met":"meet"},{"misheard":"mishear"},{"mislaid":"mislay"},{"misled":"mislead"},{"misspoke":"misspeak"},{"misspoken":"misspeak"},{"misspent":"misspend"},{"mistook":"mistak"},{"mistaken":"mistak"},{"mistaught":"misteach"},{"misunderstood":"misunderstand"},{"miswrote":"miswrit"},{"miswritten":"miswrit"},{"mown":"mow"},{"outdid":"outdo"},{"outdone":"outdo"},{"outdrew":"outdraw"},{"outdrawn":"outdraw"},{"outdrank":"outdrink"},{"outdrunk":"outdrink"},{"outdrove":"outdriv"},{"outdriven":"outdriv"},{"outfought":"outfight"},{"outflew":"outfli"},{"outflown":"outfli"},{"outgrew":"outgrow"},{"outgrown":"outgrow"},{"outrode":"outrid"},{"outridden":"outrid"},{"outran":"outrun"},{"outsold":"outsel"},{"outshone":"outshin"},{"outshot":"outshoot"},{"outsang":"outs"},{"outsung":"outs"},{"outsat":"outsit"},{"outslept":"outsleep"},{"outspoke":"outspeak"},{"outspoken":"outspeak"},{"outsped":"outspe"},{"outspent":"outspend"},{"outswore":"outswear"},{"outsworn":"outswear"},{"outswam":"outswim"},{"outswum":"outswim"},{"outthought":"outthink"},{"outthrew":"outthrow"},{"outthrown":"outthrow"},{"outwrote":"outwrit"},{"outwritten":"outwrit"},{"overbreed":"overbre"},{"overbuilt":"overbuild"},{"overbought":"overbuy"},{"overcame":"overcom"},{"overdid":"overdo"},{"overdone":"overdo"},{"overdrew":"overdraw"},{"overdrawn":"overdraw"},{"overdrank":"overdrink"},{"overdrunk":"overdrink"},{"overate":"overeat"},{"overeaten":"overeat"},{"overfeed":"overfe"},{"overhung":"overhang"},{"overheard":"overhear"},{"overlaid":"overlay"},{"overpaid":"overpay"},{"overrode":"overrid"},{"overridden":"overrid"},{"overran":"overrun"},{"oversaw":"overse"},{"overseen":"overse"},{"oversold":"oversel"},{"oversewn":"oversew"},{"overshot":"overshoot"},{"overslept":"oversleep"},{"overspoke":"overspeak"},{"overspoken":"overspeak"},{"overtook":"overtak"},{"overtaken":"overtak"},{"overthought":"overthink"},{"overthrew":"overthrow"},{"overthrown":"overthrow"},{"overwound":"overwind"},{"overwrote":"overwrit"},{"overwritten":"overwrit"},{"partook":"partak"},{"partaken":"partak"},{"paid":"pay"},{"pled":"plead"},{"prebuilt":"prebuild"},{"predid":"predo"},{"predone":"predo"},{"premade":"premak"},{"prepaid":"prepay"},{"presold":"presel"},{"preshrank":"preshrink"},{"preshrunk":"preshrink"},{"proven":"prove"},{"reawoke":"reawak"},{"reawaken":"reawak"},{"rebound":"rebind"},{"rebuilt":"rebuild"},{"redealt":"redeal"},{"redid":"redo"},{"redone":"redo"},{"redrew":"redraw"},{"redrawn":"redraw"},{"reground":"regrind"},{"regrew":"regrow"},{"regrown":"regrow"},{"rehung":"rehang"},{"reheard":"rehear"},{"relaid":"relay"},{"relit":"relight"},{"remad":"remak"},{"repaid":"repay"},{"reran":"rerun"},{"resold":"resel"},{"resent":"resend"},{"resewn":"resew"},{"retook":"retak"},{"retaken":"retak"},{"retaught":"reteach"},{"retore":"retear"},{"retorn":"retear"},{"retold":"retel"},{"rethought":"rethink"},{"rewoke":"rewak"},{"rewaken":"rewak"},{"rewore":"rewear"},{"reworn":"rewear"},{"rewove":"reweav"},{"rewoven":"reweav"},{"rewon":"rewin"},{"rewound":"rewind"},{"rewrote":"rewrit"},{"rewritten":"rewrit"},{"rode":"ride"},{"ridden":"ride"},{"rang":"ring"},{"rung":"ring"},{"rose":"rise"},{"risen":"rise"},{"ran":"run"},{"sawn":"saw"},{"said":"say"},{"saw":"see"},{"seen":"see"},{"sought":"seek"},{"sold":"sell"},{"sent":"send"},{"sewn":"sew"},{"shook":"shake"},{"shaken":"shake"},{"shaven":"shave"},{"shorn":"shear"},{"shone":"shine"},{"shot":"shoot"},{"shown":"show"},{"shrank":"shrink"},{"shrunk":"shrink"},{"sang":"sing"},{"sung":"sing"},{"sank":"sink"},{"sunk":"sink"},{"sat":"sit"},{"slept":"sleep"},{"slid":"slide"},{"slung":"sling"},{"sown":"sow"},{"spoke":"speak"},{"spoken":"speak"},{"sped":"speed"},{"spent":"spend"},{"spun":"spin"},{"spat":"spit"},{"sprang":"spring"},{"sprung":"spring"},{"stood":"stand"},{"stole":"steal"},{"stolen":"steal"},{"stuck":"stick"},{"stung":"sting"},{"stank":"stink"},{"stunk":"stink"},{"strewn":"strew"},{"strode":"stride"},{"stridden":"stride"},{"struck":"strike"},{"stricken":"strike"},{"strung":"string"},{"strove":"strive"},{"striven":"strive"},{"swore":"swear"},{"sworn":"swear"},{"swept":"sweep"},{"swollen":"swell"},{"swam":"swim"},{"swum":"swim"},{"swung":"swing"},{"took":"take"},{"taken":"take"},{"taught":"teach"},{"tore":"tear"},{"torn":"tear"},{"told":"tell"},{"thought":"think"},{"threw":"throw"},{"thrown":"throw"},{"typewrote":"typewrit"},{"typewritten":"typewrit"},{"unbound":"unbind"},{"underfeed":"underfe"},{"underwent":"undergo"},{"undergone":"undergo"},{"underlay":"underli"},{"underlain":"underli"},{"undersold":"undersel"},{"underspent":"underspend"},{"understood":"understand"},{"undertook":"undertak"},{"undertaken":"undertak"},{"underwrote":"underwrit"},{"underwritten":"underwrit"},{"undid":"undo"},{"undone":"undo"},{"unfroze":"unfreez"},{"unfrozen":"unfreez"},{"unhung":"unhang"},{"unhidden":"unhid"},{"unsewn":"unsew"},{"unslung":"unsl"},{"unspun":"unspin"},{"unstuck":"unstick"},{"unstrung":"unstr"},{"unwove":"unweav"},{"unwoven":"unweav"},{"unwound":"unwind"},{"upheld":"uphold"},{"woke":"wake"},{"woken":"wake"},{"waylaid":"waylay"},{"wore":"wear"},{"worn":"wear"},{"wove":"weav"},{"woven":"weav"},{"wept":"weep"},{"won":"win"},{"wound":"wind"},{"withdrew":"withdraw"},{"withdrawn":"withdraw"},{"withheld":"withhold"},{"withstood":"withstand"},{"wrung":"wring"},{"wrote":"write"},{"written":"write"},{"unbent":"unbend"},{"calves":"calf"},{"elves":"elf"},{"halves":"half"},{"hooves":"hoof"},{"knives":"knife"},{"leaves":"leaf"},{"lives":"life"},{"loaves":"loaf"},{"shelves":"shelf"},{"thieves":"thief"},{"wives":"wife"},{"wolves":"wolf"},{"scarves":"scarf"},{"wharves":"wharf"},{"dwarves":"dwarf"},{"analyses":"analysi"},{"axis":"axe"},{"hypotheses":"hypothesi"},{"parentheses":"parenthesi"},{"synopses":"synopsi"},{"curricula":"curriculum"},{"millenia":"millenium"},{"criteria":"criterion"},{"phenomena":"phenomenon"},{"alumni":"alumnus"},{"antennae":"antenna"},{"html5":"html"} ], post_s1a_exceptions : [ {"inning" : "inning"}, {"outing" : "outing"}, {"canning" : "canning"}, {"herring" : "herring"}, {"earring" : "earring"}, {"proceed" : "proceed"}, {"exceed" : "exceed"}, {"succeed" : "succeed"} ], s0_sfxs : /('|'s|'s')$/, s1a_replacements : [ { "suffix" : "sses", "with" : "ss" }, { "suffix" : "ied", "with" : "i|ie", "complexrule" : "s1a" }, { "suffix" : "ies", "with" : "i|ie", "complexrule" : "s1a" }, { "suffix" : "us", "with" : "us" }, { "suffix" : "ss", "with" : "ss" }, { "suffix" : "s", "with" : "", "ifprecededby" : "[aeiouy].+" } ], s1b_replacements : [ { "suffix" : "eedly", "with" : "ee", "ifin" : "R1" }, { "suffix" : "ingly", "with" : "", "ifprecededby" : "[aeiouy].*", "complexrule" : "s1b" }, { "suffix" : "edly", "with" : "", "ifprecededby" : "[aeiouy].*", "complexrule" : "s1b" }, { "suffix" : "eed", "with" : "ee", "ifin" : "R1" }, { "suffix" : "ing", "with" : "", "ifprecededby" : "[aeiouy].*", "complexrule" : "s1b" }, { "suffix" : "ed", "with" : "", "ifprecededby" : "[aeiouy].*", "complexrule" : "s1b" } ], s2_replacements : [ { "suffix" : "ization", "with" : "ize", "ifin" : "R1" }, { "suffix" : "ational", "with" : "ate", "ifin" : "R1" }, { "suffix" : "fulness", "with" : "ful", "ifin" : "R1" }, { "suffix" : "ousness", "with" : "ous", "ifin" : "R1" }, { "suffix" : "iveness", "with" : "ive", "ifin" : "R1" }, { "suffix" : "tional", "with" : "tion", "ifin" : "R1" }, { "suffix" : "biliti", "with" : "ble", "ifin" : "R1" }, { "suffix" : "lessli", "with" : "less", "ifin" : "R1" }, { "suffix" : "entli", "with" : "ent", "ifin" : "R1" }, { "suffix" : "ation", "with" : "ate", "ifin" : "R1" }, { "suffix" : "alism", "with" : "al", "ifin" : "R1" }, { "suffix" : "aliti", "with" : "al", "ifin" : "R1" }, { "suffix" : "ousli", "with" : "ous", "ifin" : "R1" }, { "suffix" : "iviti", "with" : "ive", "ifin" : "R1" }, { "suffix" : "fulli", "with" : "ful", "ifin" : "R1" }, { "suffix" : "enci", "with" : "ence", "ifin" : "R1" }, { "suffix" : "anci", "with" : "ance", "ifin" : "R1" }, { "suffix" : "abli", "with" : "able", "ifin" : "R1" }, { "suffix" : "izer", "with" : "ize", "ifin" : "R1" }, { "suffix" : "ator", "with" : "ate", "ifin" : "R1" }, { "suffix" : "alli", "with" : "al", "ifin" : "R1" }, { "suffix" : "bli", "with" : "ble", "ifin" : "R1" }, { "suffix" : "ogi", "with" : "og", "ifin" : "R1", "ifprecededby" : "l" }, { "suffix" : "li", "with" : "", "ifin" : "R1", "ifprecededby" : "[cdeghkmnrt]" } ], s3_replacements : [ { "suffix" : "ational", "with" : "ate", "ifin" : "R1" }, { "suffix" : "tional", "with" : "tion", "ifin" : "R1" }, { "suffix" : "alize", "with" : "al", "ifin" : "R1" }, { "suffix" : "ative", "with" : "", "ifin" : "R1,R2" }, { "suffix" : "icate", "with" : "ic", "ifin" : "R1" }, { "suffix" : "iciti", "with" : "ic", "ifin" : "R1" }, { "suffix" : "ical", "with" : "ic", "ifin" : "R1" }, { "suffix" : "ness", "with" : "", "ifin" : "R1" }, { "suffix" : "ful", "with" : "", "ifin" : "R1" } ], s4_replacements : [ { "suffix" : "ement", "with" : "", "ifin" : "R2" }, { "suffix" : "ance", "with" : "", "ifin" : "R2" }, { "suffix" : "ence", "with" : "", "ifin" : "R2" }, { "suffix" : "able", "with" : "", "ifin" : "R2" }, { "suffix" : "ible", "with" : "", "ifin" : "R2" }, { "suffix" : "ment", "with" : "", "ifin" : "R2" }, { "suffix" : "ant", "with" : "", "ifin" : "R2" }, { "suffix" : "ate", "with" : "", "ifin" : "R2" }, { "suffix" : "ent", "with" : "", "ifin" : "R2" }, { "suffix" : "ion", "with" : "", "ifin" : "R2", "ifprecededby" : "[st]" }, { "suffix" : "ism", "with" : "", "ifin" : "R2" }, { "suffix" : "iti", "with" : "", "ifin" : "R2" }, { "suffix" : "ive", "with" : "", "ifin" : "R2" }, { "suffix" : "ize", "with" : "", "ifin" : "R2" }, { "suffix" : "ous", "with" : "", "ifin" : "R2" }, { "suffix" : "ic", "with" : "", "ifin" : "R2" }, { "suffix" : "er", "with" : "", "ifin" : "R2" }, { "suffix" : "al", "with" : "", "ifin" : "R2" } ], s5_replacements : [ { "suffix" : "e", "with" : "", "complexrule" : "s5" }, { "suffix" : "l", "with" : "", "ifin" : "R2", "ifprecededby" : "l" } ], R1 : function(thisword) { var exceptions = /^(gener|commun|arsen)/; var r1base = /^.*?[aeiouy][^aeiouy]/; if (exceptions.test(thisword)) { return thisword.replace(exceptions,""); } else if (r1base.test(thisword)) { return thisword.replace(r1base,""); } else { return ""; } }, R2 : function(thisword) { thisword = ditasearch.porter2.R1(thisword); var r1base = /^.*?[aeiouy][^aeiouy]/; if (r1base.test(thisword)) { return thisword.replace(r1base,""); } else { return ""; } }, endsWithShortSyllable : function(thisword) { var eSS = /([^aeiouy][aeiouy][^aeiouywxY]$|^[aeiouy][^aeiouy]$)/; return eSS.test(thisword); }, isShort : function(thisword) { return (ditasearch.porter2.R1(thisword).length == 0 && ditasearch.porter2.endsWithShortSyllable(thisword)); }, keyMatches : function(object) { // object is the array object passed from ditasearch.porter2.firstMatch var thisword = this[0]; var wholeword = this[1]; var suffix = object.suffix || Object.keys(object)[0]; var regex = new RegExp(wholeword ? "^"+ suffix + "$" : suffix + "$"); if (regex.test(thisword)) { } return regex.test(thisword); }, firstMatch : function(array,thisword,wholeword) { var wholeword = wholeword || false; var data = [thisword,wholeword]; return array.filter(ditasearch.porter2.keyMatches,data)[0] || []; }, stem : function(thisword) { // note: ditasearch.porter2.stemOrException subsumed into ditasearch.porter2.stem thisword = thisword.toLowerCase().replace(ditasearch.porter2.nonwordchars,""); var exception = ditasearch.porter2.firstMatch(ditasearch.porter2.exceptionlist,thisword,true); // exception = array containing first matching object or nothing if (thisword.length <= 2) { return thisword; } else if (exception.length != 0) { return exception[thisword]; } else { return ditasearch.porter2.getStem(thisword); } }, replace_suffix : function(thisword,array) { var replacearray = ditasearch.porter2.firstMatch(array,thisword); if (typeof(replacearray) == 'undefined' || replacearray.length == 0) { // no matches return thisword; } var replace = replacearray; var restrictions = ''; if (replace.hasOwnProperty("ifin")) { restrictions += (replace.ifin.indexOf('R1') > -1 ? 'R1' : ''); restrictions += (replace.ifin.indexOf('R2') > -1 ? 'R2' : ''); } if (replace.hasOwnProperty("ifprecededby")) { restrictions += (replace.ifprecededby.length > 0 ? 'PrecededBy' : ''); } if (replace.hasOwnProperty("complexrule")) { restrictions += (replace.complexrule.length > 0 ? 'ComplexRule_'+replace.complexrule : ''); } var suffix = new RegExp(replace.suffix + '$'); var precededsuffix = new RegExp(replace.ifprecededby + suffix.source); switch (restrictions) { // no restrictions case "": thisword = thisword.replace(suffix,replace.with); break; // restrictions case "R1": if (ditasearch.porter2.R1(thisword).search(suffix) > -1) { thisword = thisword.replace(suffix,replace.with); } break; case "R2": if (ditasearch.porter2.R2(thisword).search(suffix) > -1) { thisword = thisword.replace(suffix,replace.with); } break; case "R1R2": if (ditasearch.porter2.R1(thisword).search(suffix) > -1 && ditasearch.porter2.R2(thisword).search(suffix) > -1) { thisword = thisword.replace(suffix,replace.with); } break; case "PrecededBy": if (thisword.search(precededsuffix) > -1) { thisword = thisword.replace(suffix,replace.with); } break; case "R1PrecededBy": if (ditasearch.porter2.R1(thisword).search(suffix) > -1 && thisword.search(precededsuffix) > -1) { thisword = thisword.replace(suffix,replace.with); } break; case "R2PrecededBy": if (ditasearch.porter2.R2(thisword).search(suffix) > -1 && thisword.search(precededsuffix) > -1) { thisword = thisword.replace(suffix,replace.with); } break; // complex rules case "ComplexRule_s1a": precededsuffix = new RegExp('..'+suffix.source); if (thisword.search(precededsuffix) > -1) { thisword = thisword.replace(suffix,'i'); } else { thisword = thisword.replace(suffix,'ie'); } break; case "PrecededByComplexRule_s1b": if (thisword.search(precededsuffix) > -1) { thisword = thisword.replace(suffix,''); if (thisword.search(/(at|bl|iz)$/) > -1) { thisword = thisword + 'e'; } else if (thisword.search(/(bb|dd|ff|gg|mm|nn|pp|rr|tt)$/) > -1) { thisword = thisword.replace(/.$/,''); } else if (ditasearch.porter2.isShort(thisword)) { thisword = thisword + 'e'; } } break; case "ComplexRule_s5": if ((ditasearch.porter2.R2(thisword).search(suffix) > -1) || (ditasearch.porter2.R1(thisword).search(suffix) > -1) && !(ditasearch.porter2.endsWithShortSyllable(thisword.replace(suffix,'')))) { thisword = thisword.replace(suffix,''); } break; } return thisword; }, getStem : function(word) { var noinitpostrophes = word.replace(/^'/,''); var consonantY = noinitpostrophes.replace(/(^|[aeiouy])y/,'$1Y'); var s0 = consonantY.replace(ditasearch.porter2.s0_sfxs,''); var s1a = ditasearch.porter2.replace_suffix(s0,ditasearch.porter2.s1a_replacements); var s1b = ditasearch.porter2.replace_suffix(s1a,ditasearch.porter2.s1b_replacements); var s1c = s1b.replace(/(.[^aeiouy])[yY]$/,'$1i'); var s2 = ditasearch.porter2.replace_suffix(s1c,ditasearch.porter2.s2_replacements); var s3 = ditasearch.porter2.replace_suffix(s2,ditasearch.porter2.s3_replacements); var s4 = ditasearch.porter2.replace_suffix(s3,ditasearch.porter2.s4_replacements); var s5 = ditasearch.porter2.replace_suffix(s4,ditasearch.porter2.s5_replacements); var post_s1a_exception = ditasearch.porter2.firstMatch(ditasearch.porter2.post_s1a_exceptions,s1a,true); if (post_s1a_exception.length != 0) { return post_s1a_exception[s1a]; } else { return s5.toLowerCase(); } } }, strings : { searchdiv_aria_label:"search",input_aria_label:"search terms",input_placeholder:"Search",results_aria_label:"search results",results_no_results:"No topics found" }, configs : { stopwords : "stopwords are not indexed", synonyms : { "abandon":["forsak","desert"],"abbey":["monasteri"],"abl":["capabl"],"abort":["termin"],"abridg":["shorten","cut"],"absolut":["perfect","complet"],"absorpt":["preoccup","engross","assimil"],"abund":["plenti"],"abus":["insult","maltreat"],"academi":["school"],"accept":["adopt","espous"],"access":["entre","access","admitt"],"accid":["mishap","fortuiti"],"account":["explan","comptrol","control"],"accumul":["accret"],"achiev":["accomplish","attain"],"acquaint":["familiar"],"acquisit":["possess"],"acquit":["clear"],"act":["action","activ"],"activ":["vigor","activ","action"],"add":["total"],"addict":["hook"],"addit":["improv","summat","plus"],"adjust":["conform","adapt"],"administr":["presid"],"admir":["esteem"],"admiss":["acknowledg"],"admit":["acknowledg"],"adopt":["borrow"],"adult":["grownup"],"advanc":["progress","march"],"advantag":["benefit"],"adventur":["escapad"],"advertis":["push","promot","ad","advertis"],"advis":["advisor","consult"],"advoc":["propon"],"affair":["affair","intimaci","liaison","involv"],"affect":["impact"],"affin":["kinship","attract"],"age":["period","epoch","era"],"agil":["nimbl","spri","quick"],"agoni":["torment"],"agre":["consent","assent"],"agreement":["accord"],"agricultur":["farm","husbandri"],"air":["gase"],"alarm":["dismay","constern","fear","warn"],"alcohol":["intoxic","inebri"],"aliv":["live"],"alloc":["allot","share"],"allow":["permit","let"],"alli":["friend"],"aloof":["distant"],"aluminium":["aluminum","al"],"amber":["yellowish"],"ambigu":["equivoc"],"ambit":["ambiti"],"ampl":["sizabl","capaci"],"amput":["remov"],"analysi":["psychoanalysi"],"analyst":["psychoanalyst"],"ancestor":["ancestor"],"anger":["ire"],"angl":["slant","bias"],"anim":["beast","brute","creatur","fauna"],"announc":["proclam","declar"],"annual":["year"],"answer":["repli","respond"],"anticip":["expect"],"anxieti":["anxious"],"apparatus":["setup","equip"],"appeal":["appealing","charm","solicit"],"appetit":["crave"],"applaud":["clap"],"appl":["fruit"],"appoint":["name","nomin","job","post"],"approach":["near"],"approv":["bless","ok","okay","sanction"],"arch":["archway"],"archiv":["archiv"],"area":["expans"],"argument":["argument","debat"],"aris":["origin","develop"],"arrang":["order","placement"],"arrest":["apprehend"],"arrow":["pointer","indic","projectil"],"articul":["eloqu","enunci"],"artifici":["unreal","unnatur"],"ask":["inquir"],"aspect":["facet"],"assault":["attack"],"assembl":["fabric","construct","assemblag"],"assess":["apprais","judgment","judgement"],"asset":["plus"],"assign":["task"],"associ":["affili"],"assum":["presum"],"assumpt":["premis","premiss"],"astonish":["astound","stagger"],"asylum":["refug","sanctuari","shelter"],"athlet":["jock"],"atmospher":["ambianc","ambienc"],"attach":["affect","fond"],"attack":["assail","assault","onslaught"],"attic":["loft","garret"],"attract":["appeal","attract","pleas"],"auction":["sale"],"audienc":["spectat","listen"],"auditor":["student"],"aunt":["aunti","relat"],"authoris":["empow"],"avail":["obtain"],"avenu":["boulevard"],"averag":["norm"],"award":["prize"],"awar":["mind"],"aw":["dread","terribl"],"babi":["babe","infant"],"back":["rear","spine","backbon"],"background":["grind"],"bacon":["pork"],"bad":["immor","evil","defect","spoil","spoilt"],"bait":["lure","sweeten","hook"],"balanc":["proport","equilibr","equilibrium"],"ball":["globe","orb"],"ballet":["danc"],"ban":["prohibit","proscript"],"band":["band","stripe","instrumentalist","ring","jewelri"],"bang":["clap","erupt","blast","bam"],"banish":["bar","releg","expel"],"banner":["streamer"],"banquet":["feast"],"bar":["barroom","saloon","tavern","pub"],"bargain":["negoti","dicker"],"barrel":["cask"],"base":["pedest","stand"],"basin":["washbasin","washbowl","washstand","lavatori"],"basi":["base","foundat","fundament"],"basket":["handbasket"],"basketbal":["hoop"],"bathroom":["bath","toilet","lavatori"],"bathtub":["bath","tub"],"batteri":["assault"],"battl":["conflict","fight","engag"],"battlefield":["battleground","field"],"beach":["shore"],"beam":["ray"],"beat":["puls","pulsat","heartbeat","pound","thump","vanquish"],"bee":["insect"],"beef":["meat"],"beg":["implor","entreat"],"begin":["start","commenc"],"behav":["comport"],"behavior":["conduct"],"behead":["decapit"],"bell":["doorbel","buzzer"],"belli":["abdomen","stomach"],"bench":["workbench"],"bend":["crouch","stoop","bow","flex","turn","deform","twist"],"beneficiari":["recipi"],"benefit":["welfar"],"bet":["wager","stake"],"betray":["deceiv"],"bibl":["book","scriptur"],"bike":["bicycl","bike","cycl","wheel"],"bill":["beak","circular","handbil","broadsid","broadsheet","flier"],"bin":["contain"],"biscuit":["cooki"],"bishop":["clergyman"],"bite":["sting"],"bitter":["acrimoni","resent"],"black":["achromat","black"],"blackmail":["extort"],"bland":["tasteless","insipid","flavorless"],"blank":["empti"],"blast":["blare","explos"],"blind":["unsight"],"block":["cube","obstruct","hinder","stymi"],"bloodsh":["gore"],"blow":["revers","setback"],"blue":["blueness","color"],"board":["gameboard","plank"],"bodi":["torso","trunk"],"bolt":["thunderbolt"],"bomb":["bombard"],"bond":["allianc","bail","shackl","hamper"],"book":["volum"],"boot":["footwear"],"border":["borderlin","delimit"],"bother":["annoy","irrit"],"bottl":["vessel"],"bottom":["undersid","undersurfac"],"bow":["genuflect"],"bowel":["intestin","gut"],"bowl":["vessel"],"box":["contain"],"bracket":["categori"],"brag":["boast"],"braid":["plait","tress","hairdo"],"brain":["genius","mastermind","encephalon"],"branch":["limb","fork"],"brand":["make"],"brave":["courag","fearless"],"bread":["breadstuff"],"break":["destroy","fractur","paus","intermiss","interrupt","suspens"],"breast":["bosom","tit"],"breath":["respir"],"breed":["rais"],"breez":["zephyr","air","gust"],"bridg":["span"],"brillianc":["brillianc"],"bring":["fetch"],"brink":["threshold","verg"],"broadcast":["air","send"],"broccoli":["veget"],"brother":["brother","monk","comrad"],"bucket":["pail"],"budg":["shift","stir"],"build":["rais","construct","edific"],"bullet":["slug","projectil"],"bundl":["sheaf"],"burial":["entomb","inhum","inter"],"burn":["injuri","bite","sting","combust"],"burst":["bust"],"bus":["autobus","coach"],"bush":["shrub"],"busi":["occup","job","line"],"buttock":["butt","bum","tush"],"buy":["purchas","acquir"],"cage":["coop"],"calcul":["comput","figur","reckon","deliber","plan"],"call":["birdcal","birdsong","song","name","cri","outcri","yell","shout","vocifer","holler","telephon","phone","ring"],"calm":["quiet","tranquil","quieten"],"calori":["kilocalori"],"candid":["campaign","nomine"],"candl":["taper"],"canva":["canvass","fabric"],"cap":["headdress"],"captain":["skipper"],"captiv":["beguil","charm","bewitch","entranc","enchant"],"captur":["catch","seiz","conquer"],"car":["auto","automobil","motorcar"],"carbon":["c"],"card":["postcard","menu","cart"],"care":["attent","aid","tend","mainten","upkeep","caution","precaut","forethought","judici"],"career":["call","vocat"],"carpet":["rug","carpet"],"carriag":["perambul","pram","stroller"],"carri":["bear","transport"],"cart":["handcart","pushcart"],"case":["instanc","exampl","showcas","vitrin","lawsuit","suit","caus","causa"],"cast":["actor"],"cat":["felin"],"catalogu":["catalog"],"catch":["grab"],"cathedr":["church"],"cattl":["cow","bull"],"ceil":["cap"],"celebr":["festiv"],"cell":["cubicl"],"cellar":["basement"],"cemeteri":["graveyard"],"center":["middl","heart","midpoint"],"certain":["sure"],"chair":["professorship","seat"],"challeng":["disput"],"champion":["champ"],"chanc":["luck","fortun","hazard","opportun","probabl"],"chang":["alter","modif"],"channel":["canal"],"chao":["pandemonium","bedlam"],"charact":["graphem"],"charg":["accus","bill"],"chariti":["gift"],"charter":["document"],"cheap":["inexpens"],"cheat":["fool","swindl"],"check":["confirm","verif","tick","mark","verifi","tab"],"cheek":["impud","impertin","bold","nerv","brass","face"],"chees":["food"],"chequ":["check"],"cherri":["fruit"],"chest":["bureau","dresser","thorax","pectus"],"chew":["mastic"],"chicken":["wimp","crybabi"],"chief":["foreman","boss"],"child":["kid"],"childish":["infantil"],"chimney":["flue"],"chimpanze":["primat"],"chip":["microchip","bite","flake","fleck","scrap","crisp"],"choic":["option","altern"],"choke":["gag","suffoc","strangl"],"chorus":["choir"],"cigarett":["butt","fag"],"cinema":["theater"],"circul":["distribut","dissemin","propag","broadcast","diffus","dispers","spread"],"circumst":["context"],"citi":["metropoli"],"claim":["assert","affirm","demand"],"clarifi":["elucid"],"clash":["friction","conflict"],"class":["cours","form","grade"],"classroom":["schoolroom"],"clear":["empti"],"clearanc":["headroom"],"climat":["clime","weather"],"climb":["mount"],"cliqu":["coteri","ingroup","pack","camp"],"clock":["timepiec"],"close":["near","shut","finish","termin","conclud","end","unopen"],"cloth":["apparel","dress"],"club":["cabaret","nightclub","nightspot","bat","societi","guild","gild","lodg","order"],"clue":["cue","evid","hint"],"cluster":["bunch","clump"],"coach":["tutor"],"coalit":["coalesc","conglutin"],"coast":["seashor","seacoast"],"coat":["garment","coat"],"coerc":["pressur","forc","compel"],"coffe":["beverag"],"coffin":["casket"],"coin":["money"],"coincid":["concur","happenst"],"cold":["cold"],"collaps":["crumbl","crumpl","tumbl"],"collar":["har"],"collect":["aggreg","accumul","assemblag"],"color":["hue"],"column":["pillar","support"],"combin":["blend","mix","conflat","commingl","fuse","merg"],"comfort":["comfort","consol","solac","sooth","eas","comfi"],"command":["compel","control","masteri"],"commemor":["rememb"],"comment":["remark"],"commerc":["commerci","mercantil"],"commiss":["deput","deleg","fee"],"commit":["allegi","loyalti","dedic"],"committe":["commiss"],"common":["mutual","averag","ordinari","usual"],"communist":["marxist"],"compani":["companionship","fellowship","societi","troup"],"compens":["recompens","payment"],"compet":["vie","contend","compet"],"competit":["content","rivalri","contest"],"complex":["complic"],"complianc":["conform","abid"],"compromis":["allow"],"concentr":["focus","engross","absorpt","immers"],"concept":["concept","construct","fertil"],"concern":["interest","fear"],"conclus":["end","finish"],"concret":["materi"],"condit":["circumst","precondit","stipul","status","state"],"confer":["meet"],"confin":["detain"],"confront":["face","clash"],"confus":["throw","befuddl","confound"],"conglomer":["empir"],"connect":["link","connected"],"conscienc":["scrupl"],"conscious":["awar"],"consensus":["agreement"],"conserv":["preserv"],"consid":["debat"],"consider":["thought"],"conspiraci":["cabal","plot"],"constant":["steadfast","unwav","unend","incess"],"constitut":["composit","makeup"],"constraint":["restraint"],"construct":["manufactur","fabric"],"consumpt":["ingest"],"contact":["middleman","touch"],"contain":["incorpor","compris"],"contemporari":["coeval"],"contempt":["disdain","scorn","despit"],"content":["capac","content"],"continu":["lengthi","prolong","extens","uninterrupt"],"contract":["agreement"],"contrast":["opposit","dissimilar"],"contribut":["donat"],"control":["domin","oper","handl","restraint"],"conveni":["applianc","contrapt","gadget","gizmo"],"convent":["custom"],"convers":["talk"],"convinc":["convert"],"convuls":["fit","paroxysm"],"cook":["fix","readi","prepar"],"cool":["unenthusiast","unfriend","unrespons"],"cooper":["collabor"],"cope":["manag"],"copper":["cu","metal"],"copi":["imit","simul","replic"],"cord":["corduroy","fabric"],"corner":["recess","nich"],"corps":["cadav","remain"],"correct":["rectif"],"corrupt":["briberi"],"cottag":["bungalow"],"cotton":["fabric"],"count":["number","enumer"],"countri":["state","nation","land"],"coup":["putsch","takeov"],"coupl":["twosom","duo","duet"],"courag":["braveri","brave"],"cours":["path","track","class"],"court":["courtyard","tribun","judicatur"],"courtship":["woo","court","suit"],"cover":["blanket","screen","conceal"],"coverag":["report","reportag"],"cow":["bovin"],"cower":["fawn","cring","grovel"],"crack":["cleft","crevic","fissur"],"crackpot":["crank","nut","nutcas","fruitcak"],"craft":["craftsmanship","workmanship"],"craftsman":["artisan"],"crash":["collaps","wreck"],"cream":["ointment","emolli","balm"],"credibl":["credibl","believ"],"credit":["recognit"],"creed":["credo","belief"],"creep":["crawl"],"crevic":["cranni","crack","fissur"],"crib":["cheat"],"cricket":["insect"],"crimin":["felon","crook","outlaw","malefactor"],"critic":["critiqu"],"crop":["harvest"],"cross":["hybrid","travers","intersect","crossroad"],"crosswalk":["cross","crossov"],"crouch":["squat"],"crown":["diadem"],"crude":["primit","unrefin","unprocess"],"cruel":["brutal","barbar"],"cruelti":["merciless","pitiless","ruthless"],"crusad":["campaign","caus"],"cri":["weep"],"crystal":["quartz"],"cucumb":["cuke"],"cultiv":["domest","natur","naturalis","tame"],"cultur":["civil","civilis","polish","refin"],"cun":["crafti","guil","slyness","wili"],"cup":["cup"],"cupboard":["closet"],"curl":["coil","loop"],"currenc":["money"],"curtain":["drape"],"custodi":["detent","detain","hold"],"custom":["client","patron"],"cut":["cleav","gash","slash","wind","clip"],"cute":["attract"],"cylind":["shape"],"damag":["harm","impair"],"damn":["curs"],"danger":["unsaf"],"dark":["dark"],"dash":["smash","hurl","thrust"],"date":["appoint","engag","escort"],"daughter":["girl","offspr"],"dawn":["dawn","aurora","daybreak"],"dead":["inanim","lethal"],"deal":["agreement","bargain"],"dealer":["trader"],"death":["deceas","expiri"],"debat":["deliber","disput"],"decad":["decennari","decennium"],"decay":["decomposit","rot"],"decis":["determin"],"declar":["statement"],"declin":["worsen"],"decor":["ornament","cosmet"],"decreas":["diminish","fall","lessen"],"dedic":["inscrib"],"defeat":["frustrat"],"defend":["guard","protect","suspect"],"defici":["insuffici","inadequaci"],"deficit":["shortag","shortfal"],"definit":["precis","explicit"],"degre":["grade","level"],"delay":["holdup","detain"],"delet":["eras"],"delic":["fragil","frail","sensit"],"deliv":["bring"],"deliveri":["birth"],"demolish":["destroy"],"demonstr":["march","demo","protest"],"denial":["disaffirm"],"densiti":["dens"],"deni":["contradict"],"depart":["leav"],"depend":["addict"],"deport":["extradit"],"deposit":["sediment"],"depress":["blue","low","slump"],"depriv":["want","needi"],"deputi":["surrog"],"descent":["decliv","declin","fall"],"describ":["depict"],"desert":["defect"],"deserv":["merit"],"design":["conceiv","invent","innov","outlin","couturi"],"desir":["feel"],"desk":["furnitur"],"despis":["scorn","disdain"],"destruct":["demolit","wipeout"],"detail":["particular","item"],"detect":["investig"],"detector":["sensor"],"deter":["dissuad"],"deterior":["disintegr","degener"],"determin":["influenc"],"develop":["invent","growth","grow","matur"],"deviat":["divers","digress","deflect"],"devot":["dedic","commit"],"diagram":["draw"],"dialect":["idiom"],"dialogu":["dialog","convers"],"diamond":["gem"],"dictionari":["lexicon"],"die":["perish"],"diet":["diet"],"differ":["disput","conflict","remaind","unlik","dissimilar"],"difficult":["hard"],"difficulti":["difficult","troubl"],"digit":["figur","finger","discret"],"digress":["sidetrack","wander","stray"],"dilemma":["quandari"],"dilut":["thin","reduc","cut"],"dimens":["magnitud"],"dinner":["supper"],"diplomat":["diplomat","suav"],"direct":["cours","orient","guidanc","counsel"],"director":["conductor"],"dirti":["obscen","indec","soil","unclean"],"disabl":["disabl","handicap","impair"],"disagre":["differ"],"disagr":["dissens","disson","discord"],"disappear":["vanish"],"disappoint":["letdown"],"disast":["calam","catastroph","tragedi"],"disciplin":["correct","punish"],"disclos":["reveal","expos","divulg"],"disco":["discothequ"],"discount":["deduct"],"discourag":["deter"],"discoveri":["breakthrough","find"],"discreet":["prudent","restrain"],"discrimin":["separ"],"disgrac":["shame","ignomini","dishonor"],"dish":["contain"],"disk":["disc"],"dismiss":["disregard","discount","fire","sack"],"disord":["disorderli","mess"],"displac":["bump"],"display":["exhibit","show","expos"],"disposit":["tempera"],"distanc":["aloof"],"distort":["falsifi","misrepres"],"district":["territori"],"disturb":["disrupt","commot","stir"],"ditch":["dump"],"dive":["plung"],"divid":["split","separ"],"dividend":["bonus"],"doctor":["doc","physician","md","phd"],"document":["paper"],"doll":["toy"],"dollar":["buck"],"domin":["control","masteri"],"dorm":["dormitori"],"doubl":["duplic"],"doubt":["question","dubious","doubt","uncertainti","incertitud","dubieti"],"dozen":["twelv"],"draft":["conscript","draught"],"drain":["drainpip"],"dramat":["theatric"],"draw":["attract","pull","lotteri","represent","artwork"],"dream":["ambit","aspir","dream"],"dress":["cloth"],"dribbl":["drip"],"drink":["beverag","drinkabl","potabl","imbib"],"drive":["driveway","ride","journey"],"drop":["bead","pearl","cliff"],"drug":["dose","medic"],"drum":["barrel","tympan"],"duck":["bird"],"due":["owe"],"duke":["nobleman"],"dull":["bore"],"dump":["discard","dispos"],"duti":["tariff"],"dynam":["dynam"],"eagl":["bird"],"earthquak":["quak","seism"],"east":["east","orient","e"],"echo":["reverber"],"economi":["thrifti","frugal"],"ecstasi":["raptur"],"edit":["public"],"educ":["instruct","teach","pedagogi"],"effect":["consequ","outcom","result","impress","effectu","efficaci"],"effort":["attempt","endeavor"],"egg":["egg","food"],"ego":["egot"],"eject":["expel"],"elabor":["expand","expati","enlarg"],"elect":["vote"],"eleg":["refin","tast"],"element":["compon","constitu"],"eleph":["pachyderm"],"embark":["ventur"],"embarrass":["shame"],"embrac":["hug"],"embryo":["conceptus"],"emerg":["exig","pinch","crisi"],"emot":["feel"],"emphasi":["accent"],"empir":["monarchi","empir"],"employ":["hire","engag"],"employe":["worker"],"end":["boundari","goal","conclus","close","end"],"endors":["second","back","support"],"endur":["last","persist","weather","brave"],"energi":["vigor"],"engag":["betroth"],"engin":["locomot","motor","technologist"],"enlarg":["magnifi"],"ensur":["guarante","insur","assur","secur"],"enter":["enrol","inscrib"],"entertain":["amus"],"entri":["entranc","entranceway","entryway","submiss"],"environ":["environ","surround"],"episod":["instal"],"equal":["like","equival","same"],"equip":["outfit"],"era":["epoch"],"error":["mistak","fault"],"escap":["run","flee"],"essenti":["basic","fundament"],"establish":["instal","accept"],"estim":["esteem","respect","estim","approxim"],"etern":["everlast","perpetu","unend"],"ethnic":["cultur"],"europ":["contin"],"evalu":["valuat","assess","apprais","valu"],"even":["level","flush","eve"],"evok":["suggest"],"evolut":["phylogeni","phylogenesi"],"exact":["precis"],"exagger":["overst"],"examin":["test"],"exampl":["illustr","instanc","repres","exemplar","model"],"excav":["hollow","dig"],"exceed":["pass","top","surpass","outstrip","outmatch","outdo"],"excess":["surplus"],"excit":["agit","turmoil","upheav","hullabaloo","excit","fervor"],"exclud":["except","omit"],"excus":["alibi","exculp","forgiv","pardon"],"execut":["administr"],"exempt":["free","immun"],"exercis":["exercis"],"exhibit":["exposit","expo"],"exil":["deport","expatri","expuls"],"exit":["issu","outlet"],"exot":["foreign","alien","unusu"],"expand":["extend","spread"],"expans":["enlarg"],"expect":["anticip","requir","ask"],"expenditur":["outgo","outlay"],"experienc":["knowledg"],"experi":["experiment","test","investig"],"expertis":["expert"],"explain":["explic"],"explicit":["express"],"explod":["deton"],"explos":["deton","blowup"],"expos":["debunk"],"express":["say","locut"],"extend":["widen","broaden"],"extens":["wing","annex"],"extort":["goug"],"extract":["pull"],"extraterrestri":["alien"],"eye":["oculus","optic"],"eyebrow":["brow"],"fabric":["invent"],"facad":["frontag","frontal"],"facil":["adept","adroit","deft","quick","instal","build","place"],"factori":["mill","manufactori"],"faculti":["instructor","teacher"],"fade":["wither"],"failur":["bankruptci","loser","nonstart"],"fair":["imparti","carniv","funfair"],"fairi":["faeri","sprite"],"faith":["religion"],"fall":["autumn","drop"],"falsifi":["manipul","fake","fudg","cook","misrepres"],"fame":["celebr","renown"],"familiar":["know"],"famili":["household","home","menag","folk","kinfolk","kinsfolk","kin"],"fan":["buff","devote","lover"],"fantasi":["illus","phantasi","fanci"],"farewel":["leav","part"],"fascin":["intrigu"],"fashion":["rage","fad","stylish"],"fastidi":["finicki"],"fate":["destini","fortun","luck","lot","circumst"],"fault":["defect","flaw"],"favor":["encourag","approv"],"favourit":["darl","favorit","pet"],"fax":["facsimil"],"fear":["fear","fright","dread"],"feast":["banquet"],"feather":["plume","plumag"],"featur":["characterist"],"feder":["confeder","confederaci"],"feedback":["respons"],"feel":["experi","touch"],"feign":["sham","pretend","dissembl","simul"],"feminin":["woman"],"fenc":["barrier"],"ferri":["ferryboat"],"fibr":["fiber"],"fig":["fruit"],"fight":["fight","combat","struggl"],"figur":["design","pattern","illustr","digit"],"film":["cinema"],"final":["examin"],"financi":["fiscal"],"find":["discov","recov","retriev","regain"],"fine":["smooth"],"finish":["complet","ruin"],"fire":["flame","ardor","fervor","fervenc","fervid","attack","flak","flack","blast"],"firefight":["fireman"],"fireplac":["fire"],"firm":["hous","compani"],"first":["initi"],"firsthand":["direct"],"fisherman":["fisher"],"fix":["repair","mend"],"flag":["emblem"],"flash":["blink","wink","twinkl","photoflash","flashbulb","flare","heartbeat","instant","jiffi"],"flat":["apart"],"flatwar":["silverwar"],"flavor":["savor","smack","tang"],"flaw":["imperfect","blemish","faulti"],"flesh":["pulp"],"flex":["bend"],"flexibl":["bendabl"],"flight":["escap"],"flood":["inund"],"floor":["floor"],"flourish":["thrive","prosper"],"flow":["run"],"flu":["influenza"],"fluctuat":["waver","instabl"],"flush":["blush","redden"],"fli":["insect"],"fog":["daze","haze","confus"],"fold":["creas","crimp","bend","lie"],"folk":["folk"],"follow":["compli","succeed"],"food":["nutrient"],"fool":["clown","jester","moron"],"foot":["ft"],"forbid":["prohibit","interdict"],"forc":["forc","strength","intens","violenc"],"forecast":["prognosi"],"foreign":["alien","noncitizen"],"forest":["woodland","timberland","timber"],"forg":["fake","counterfeit"],"forget":["block"],"fork":["cutleri"],"form":["shape","pattern","variant","strain"],"format":["format"],"formul":["word","phrase","articul"],"fortun":["luck","wealth","prosper"],"foster":["nurtur"],"foundat":["basi"],"fountain":["font"],"fox":["anim"],"fraction":["quotient"],"frame":["ensnar","entrap"],"franchis":["dealership"],"frank":["candid","blunt","forthright"],"fraud":["fraudul","duperi","hoax"],"free":["complimentari","costless","grati"],"freight":["transport"],"frequenc":["frequenc","often"],"fresh":["insol","impertin","impud","sassi"],"friend":["acquaint"],"frighten":["scare"],"frog":["toad"],"front":["battlefront"],"frown":["glower"],"freez":["unthaw"],"fuel":["energi"],"full":["replet"],"fun":["merriment","play"],"function":["affair","occas"],"fund":["financ","underwrit"],"funer":["ceremoni"],"funni":["amus","laughabl"],"fur":["pelt"],"fuss":["bustl","hustl","flurri","ado","stir"],"futur":["hereaft","futur"],"gaff":["slip"],"gain":["profit","benefit"],"gallon":["gal"],"game":["amus","pastim"],"gap":["crack"],"garag":["build"],"garbag":["refus","wast"],"gas":["gasolin","petrol"],"gasp":["pant","puff","heav"],"gate":["door"],"gem":["gemston","stone"],"general":["offic"],"generat":["produc","coeval","contemporari"],"genet":["genet"],"get":["acquir"],"ghostwrit":["ghost"],"giant":["hulk"],"gift":["present"],"give":["pass","hand","reach","collaps","present","render","yield","return","generat"],"glanc":["peek","glimps"],"glare":["glower"],"glass":["mirror","eyeglass","spectacl"],"global":["univers","worldwid"],"gloom":["gloomi","glum"],"glori":["prestig"],"glove":["handwear"],"glue":["adhes"],"go":["move"],"goal":["finish","destin"],"goalkeep":["goali","goaltend"],"god":["deiti","divin"],"gold":["au"],"good":["benefici","salutari","just","upright","virtuous","commod","good"],"gossip":["scuttlebutt"],"govern":["author","regim"],"grace":["kind"],"graduat":["alumnus","alumna","alum","grad"],"grain":["cereal"],"grand":["luxuri","opul","sumptuous"],"grandfath":["gramp","grandad"],"grandmoth":["grandma"],"graphic":["explicit","descript","pictori","lifelik","vivid"],"grass":["lawn","pot","dope","weed","marijuana"],"grate":["thank"],"grave":["tomb"],"graviti":["grave","sobrieti","sober","somber","gravit"],"graze":["pastur"],"great":["larg","outstand"],"green":["green","environmentalist","virid","unrip","unripen"],"greet":["salut"],"gregari":["sociabl"],"grief":["heartach","heartbreak","brokenhearted"],"grimac":["face"],"grind":["mash","crunch","land","earth"],"grip":["grasp"],"groan":["moan"],"ground":["evid","basi"],"grow":["matur"],"growth":["increas","increment"],"grudg":["grievanc"],"guarante":["warrant","warrante"],"guard":["bodyguard","watchman","ward","shield"],"guerrilla":["insurg"],"guest":["invite"],"guidelin":["guidepost"],"guilt":["guilti"],"gun":["weapon"],"gutter":["trough"],"haircut":["hairstyl"],"hall":["hallway"],"hallway":["passag","corridor"],"halt":["freez","interrupt"],"ham":["meat"],"hand":["manus","mitt","paw","deal"],"handicap":["hinder","hamper"],"hang":["suspend"],"happen":["occur"],"harass":["hassl","plagu","molest"],"harbor":["seaport"],"hardship":["advers"],"harm":["noxious"],"harmoni":["concord","harmoni","compat"],"harsh":["coars"],"hat":["headdress"],"hate":["detest","loath"],"haul":["transport"],"haunt":["stalk"],"head":["chief"],"heal":["cure"],"health":["well"],"healthi":["fit"],"heat":["passion"],"heaven":["paradis"],"height":["altitud"],"heir":["inheritor","heritor"],"helicopt":["chopper"],"hell":["netherworld"],"helmet":["headgear"],"help":["aid","assist","helper","support"],"helpless":["incapacit"],"heroin":["drug"],"hesit":["paus"],"hide":["conceal"],"highway":["expressway","freeway"],"hilari":["uproari"],"histori":["account","chronicl","stori"],"hit":["strike"],"hobbi":["pursuit","hobbi","sidelin"],"hold":["bear","carri","contain","reserv","book"],"holiday":["vacat"],"home":["dwell","domicil","abod","habit"],"homosexu":["gay"],"honest":["sincer"],"honor":["honor","laurel"],"hope":["wish"],"horizon":["skylin"],"horror":["repugn","repuls","revuls"],"hors":["anim","knight","chessman"],"hospit":["infirmari","kind"],"host":["invit","emce"],"hostil":["aggress","enmiti","antagon"],"hot":["vehem","passion"],"hotdog":["frankfurt"],"hour":["hr"],"hous":["dwell","legislatur","lodg"],"housewif":["homemak"],"hover":["levit"],"html":["xhtml"],"huge":["immens","vast"],"human":["human"],"hunter":["huntsman"],"hunt":["hunt"],"hurl":["cast","hurtl"],"hurt":["ach"],"husband":["hubbi"],"hut":["hovel","hutch","shack"],"hypnoth":["mesmer"],"hypothesi":["guess","conjectur","surmis","specul"],"hypothes":["specul","theoriz","conjectur"],"idea":["think"],"ideal":["paragon","model"],"identifi":["name"],"ident":["identic","indistinguish","individu"],"ignit":["light"],"ignor":["naiv","unsophist","neglect","disregard"],"ill":["unwel","maladi","sick"],"illustr":["exemplifi"],"imag":["doubl"],"imagin":["ideat","envisag"],"immun":["resist"],"implicit":["inexplicit"],"import":["import","signific"],"impost":["pretend","fake","faker","sham","fraud"],"impound":["confisc","seiz"],"improv":["better","amend","amelior"],"impuls":["capric","whim"],"incap":["incompet"],"incent":["induc","motiv","carrot"],"inch":["in"],"incid":["event"],"includ":["admit"],"incongru":["discrep"],"increas":["increment"],"incred":["unbeliev"],"indic":["suggest"],"indoor":["insid"],"industri":["dilig","industri","manufactur"],"infect":["contagion","transmiss"],"infinit":["limitless"],"inform":["info"],"inhabit":["habit","dweller","denizen"],"inhibit":["suppress"],"inject":["shoot"],"injur":["wind","hurt"],"injuri":["hurt","harm","trauma"],"inn":["hostel","hostelri","lodg"],"innoc":["guiltless"],"innov":["invent"],"inquiri":["inquest"],"insid":["interior"],"insight":["percept","understand"],"insist":["insist"],"inspector":["examin"],"institut":["establish"],"instruct":["teach","pedagogi"],"instructor":["faculti","teacher"],"instrument":["devic"],"insur":["indemn","protect"],"integr":["desegreg"],"intensifi":["escal"],"intent":["volit"],"interact":["synergist"],"interest":["pastim","pursuit"],"interfer":["hindranc","hitch","prevent","encumbr"],"interrupt":["disrupt"],"intervent":["interfer"],"introduc":["present","acquaint","inaugur"],"introduct":["present","intro"],"invas":["encroach","intrus"],"investig":["probe"],"invis":["unseeabl"],"ironi":["sarcasm","satir"],"item":["token"],"ivori":["tusk"],"jail":["imprison","incarcer"],"jam":["preserv"],"jar":["vessel"],"jealous":["covet","envious"],"jet":["squirt","spurt","spirt"],"jewel":["gem"],"job":["task","chore","workplac"],"jockey":["rider"],"joint":["unit","combin"],"joke":["gag","laugh","jest"],"journal":["diari","period"],"joy":["joyous","joy"],"judg":["justic","jurist","magistr"],"judici":["jurid"],"jump":["leap","bind"],"just":["equit"],"justic":["just"],"justifi":["excus","ration"],"keep":["maintain","preserv","observ","celebr"],"kettl":["boiler"],"key":["tonal","legend"],"kidnap":["snatch","abduct"],"killer":["slayer"],"kingdom":["monarchi"],"kit":["outfit","gear"],"kite":["toy"],"knife":["tool"],"knock":["rap"],"knowledg":["cognit","learn"],"koran":["quran","qur'an"],"laboratori":["lab"],"labour":["toil","proletariat"],"lack":["defici","want"],"ladder":["step"],"land":["kingdom","realm","estat"],"landown":["landhold"],"landscap":["sceneri"],"languag":["terminolog","nomenclatur"],"larg":["big"],"last":["conclud","final","termin"],"late":["belat","tardi"],"latest":["newest","current"],"laundri":["wash","washabl"],"law":["jurisprud","polic"],"lawyer":["attorney"],"layout":["plan","design"],"lazi":["indol","otios","sloth"],"lead":["pb","head"],"leader":["command"],"leadership":["lead"],"leaf":["leafag","foliag"],"leaflet":["brochur","folder","pamphlet"],"lean":["tilt","tip","slant","angl","inclin","bend"],"learn":["memor"],"leas":["rent","let"],"leash":["tether"],"leav":["bequeath","will","exit"],"lectur":["instruct","teach"],"leg":["limb"],"legend":["caption","fabl","stori"],"legisl":["legisl","lawmak"],"lemon":["fruit"],"lend":["loan"],"length":["durat"],"letter":["missiv"],"level":["floor","storey","stori","grade","tier","layer","stratum","raze","rase","dismantl"],"liberti":["freedom"],"licenc":["licens","permit"],"licens":["certifi"],"lick":["lap"],"lid":["eyelid"],"lie":["prevar"],"lift":["elev","rais"],"light":["luminos","bright","lumin","illumin"],"lighter":["ignit"],"like":["probabl","plausibl"],"lili":["flower"],"limit":["limit","demarc"],"line":["argument","demarc","wrinkl","furrow","creas","crinkl","seam"],"lineag":["descent"],"linger":["loiter"],"link":["fasten","connect","tie"],"lip":["brim","rim"],"list":["list","tilt","inclin"],"listen":["hear"],"live":["unrecord"],"liver":["organ"],"load":["burden","weight"],"lobbi":["vestibul","foyer"],"locat":["situat"],"lock":["curl","ringlet","whorl"],"log":["logarithm"],"lone":["alon","lone","solitari"],"look":["appear","seem","search","spirit","tone","feel","flavor"],"loop":["iter"],"loot":["booti","pillag","plunder","prize"],"lot":["deal","flock","heap"],"love":["passion","belov","dear","dearest","honey"],"loyalti":["trueness"],"lump":["chunk","gob","clod"],"lunch":["luncheon"],"machineri":["machin"],"magnitud":["size","extent"],"maid":["maidserv","housemaid"],"mail":["send","post"],"main":["chief","primari","princip"],"make":["produc","creat","gain","clear","earn"],"makeup":["cosmet"],"man":["male","homo","human"],"manag":["overse","supervis","direct","director"],"manual":["handbook"],"manufactur":["fabric","produc"],"marbl":["rock"],"march":["march","month","walk"],"margin":["edg"],"marin":["nautic","maritim"],"mark":["grade","score","scratch","scrape","scar"],"market":["commerci","groceri"],"marriag":["union","matrimoni","wedlock"],"marsh":["marshland","fen","fenland"],"mask":["disguis"],"master":["maestro"],"mastermind":["engin","direct","orchestr","organ"],"match":["peer","equal","compeer","catch","fit","correspond","check","agre","lighter"],"materi":["fabric","cloth","textil","stuff"],"mathemat":["math"],"matter":["substanc","count","weigh"],"matur":["ripe"],"maximum":["maxim"],"maze":["labyrinth"],"meadow":["hayfield"],"meal":["repast"],"mean":["intend","signifi","signific","signif"],"measur":["quantifi"],"medal":["decor","medallion","ribbon"],"medicin":["medic","medica"],"medium":["spiritualist"],"meet":["gather","assembl","encount","liaison"],"memorandum":["memo"],"memori":["commemor","remembr","monument","storag"],"mention":["note","observ","remark"],"merchant":["merchandis","businessperson"],"merci":["clemenc","merci","lenienc"],"merit":["deserving","meritori"],"mess":["fix","jam","muddl","pickl"],"messag":["communic"],"metric":["si"],"microphon":["mike"],"mild":["moder"],"mile":["distanc"],"mill":["grinder"],"mind":["head","brain","intellect"],"miner":["minework"],"minim":["underst","downplay"],"minimum":["minim"],"minist":["pastor","rector"],"minut":["min"],"mirror":["reflector"],"miscarriag":["stillbirth"],"miser":["abject","scummi","contempt"],"miseri":["wretched","miser"],"mislead":["misinform"],"misplac":["lose"],"missil":["projectil","weapon"],"mistreat":["maltreat","abus"],"mix":["shuffl","random"],"mixtur":["mix"],"model":["framework","simul"],"modern":["develop"],"modul":["compon"],"mold":["fungus","mould"],"mole":["counterspi"],"momentum":["impuls","forc"],"monarch":["sovereign"],"money":["currenc","wealth"],"monster":["freak"],"monstrous":["atroci","heinous","grotesqu"],"mood":["temper","humor"],"morn":["morn","forenoon"],"morsel":["bite"],"motif":["design"],"motiv":["motiv","need"],"motorcycl":["motorbik","bike"],"motorist":["automobilist"],"mountain":["mount"],"mourn":["bereav"],"mous":["rodent"],"move":["reloc"],"movement":["motion","move","front"],"movi":["film"],"mud":["clay"],"mug":["cup"],"muggi":["sticki","steami"],"multipli":["calcul"],"murder":["slay","execut"],"mushroom":["fungus"],"mutter":["mumbl","murmur"],"mutual":["reciproc"],"mysteri":["secret","enigma"],"nap":["catnap"],"nation":["patriot"],"nationalist":["patriot"],"neck":["cervix"],"necklac":["chain"],"need":["demand","requir","indig","penuri"],"negat":["disconfirm"],"neglect":["disregard"],"neglig":["neglect"],"negoti":["dialogu","talk"],"neighborhood":["vicin"],"neighbour":["neighbor"],"nervous":["neural","skittish"],"net":["internet","net","cyberspac"],"network":["web"],"new":["unfamiliar","unus"],"news":["intellig","tide","word"],"night":["nighttim","dark"],"nois":["random","haphazard","sound"],"nomin":["propos"],"nonremitt":["default","nonpay"],"nonsens":["bunk","hokum"],"norm":["standard"],"north":["n"],"note":["annot","bill","banknot","tone","line","billet"],"notic":["announc","note","perceiv"],"notion":["concept"],"notori":["infam"],"nuanc":["shade","niceti","subtleti","refin"],"nuclear":["atom"],"number":["numer","quantiti"],"nun":["sister"],"nurseri":["greenhous","glasshous"],"obes":["overweight"],"object":["aim","object","target","nonsubject"],"oblig":["duti","respons"],"obscur":["unknown"],"observ":["perceiv","behold"],"obstacl":["block"],"occupi":["fill"],"offend":["wind","hurt","wrongdoer"],"offens":["discourtesi","offenc","misdemeanor","infract","violat","offens","attack","unpleas","disgust"],"offer":["bid","offer"],"offic":["workplac","policeman"],"offici":["functionari"],"offset":["countervail","compens","counterbal"],"offspr":["progeni","issu","young"],"old":["elder"],"omiss":["skip"],"open":["overt"],"oper":["function","perform","surgeri"],"opinion":["judgment","judgement"],"oppon":["adversari","antagonist"],"opposit":["revers","contrari","enemi","foe","resist"],"oral":["mouth"],"orang":["orang"],"order":["decre","edict","orderli"],"organ":["form"],"orgi":["orgi","debaucheri","saturnalia","bacchan","riot"],"orient":["posit","align"],"origin":["descent","extract","background","proven","fresh","unusu","first"],"ostrac":["shun","blackbal"],"outfit":["getup","cloth"],"outlin":["abstract","preci","lineat"],"outlook":["mental","mindset"],"outsid":["outdoor","exterior","surfac"],"overal":["cloth"],"overcharg":["surcharg","fleec"],"overeat":["gorg"],"overview":["summari"],"overwhelm":["overpow"],"pace":["tempo","rate"],"packag":["bundl","packet","parcel"],"packet":["bundl"],"pain":["pain","nuisanc"],"painter":["artist"],"panic":["terror"],"paper":["composit","report","newspap","cellulos"],"parallel":["analogu","analog"],"paralyz":["paralyt"],"paramet":["factor"],"pardon":["amnesti"],"park":["common","green"],"part":["portion","compon"],"particular":["finicki","fussi","peculiar","special"],"partner":["spous","mate"],"parti":["festiv"],"pass":["overtak","pass"],"passag":["passageway"],"passeng":["rider"],"passion":["passion"],"passiv":["inact"],"password":["watchword","word"],"past":["yesteryear"],"pastur":["pastureland"],"pat":["dab"],"patch":["bandag","plot"],"path":["rout","itinerari"],"patienc":["forbear"],"pattern":["model","design"],"paus":["paus"],"pavement":["sidewalk"],"pawn":["hock"],"pay":["purchas"],"payment":["defray"],"peac":["peac","repos","seren"],"peak":["vertex","apex","acm"],"peanut":["goober"],"pedestrian":["walker"],"peel":["skin","rind"],"pen":["playpen"],"penalti":["punish"],"penni":["cent"],"pepper":["spice"],"perceiv":["sens"],"percent":["percentag"],"perfect":["complet"],"perform":["execut"],"perfum":["essenc"],"period":["point","stop"],"perman":["last"],"persist":["persever","last"],"person":["individu"],"pest":["blighter","cuss","pester","gadfli"],"pet":["anim"],"philosophi":["doctrin","knowledg","ethic"],"photocopi":["xerox"],"photograph":["photo"],"pictur":["imag","icon","paint"],"pie":["dish"],"piec":["opus","composit"],"pierc":["stick","punctur"],"pig":["hog","swine","slob","sloven"],"pile":["heap","mound","stack"],"pillow":["cushion"],"pin":["pin"],"pioneer":["innov","trailblaz","groundbreak"],"pipe":["tube"],"pit":["pitfal","trap","caviti","stone"],"piti":["compass"],"place":["seat","spot"],"plain":["simpl"],"plaintiff":["complain"],"plan":["design","arrang","scheme"],"plane":["airplan","aeroplan"],"plant":["flora","factori"],"plastic":["materi"],"plate":["dish"],"play":["act","roleplay","playact","drama"],"player":["particip","actor"],"pleasant":["delight"],"pleas":["delight"],"pleasur":["delight"],"plot":["stori","game"],"pluck":["pick","cull"],"poetri":["poesi","vers"],"point":["detail","item","dot","tip","peak"],"policeman":["cop"],"polish":["refin","shine"],"polit":["courteous"],"pollut":["contamin"],"pool":["puddl"],"pop":["dad","dada","daddi","pa","papa","soda"],"portion":["help","serv"],"portrait":["portray","like"],"posit":["placement","locat","stanc","postur","status","accept","confirm"],"possess":["ownership"],"possibl":["potenti"],"post":["stake","mail"],"postur":["bear","carriag"],"pot":["flowerpot"],"potenti":["potenti"],"potteri":["claywar"],"pound":["lb"],"power":["forc","might","superpow"],"practic":["effici","exercis","drill","recit","pattern"],"prais":["congratul","kudo"],"prayer":["supplic"],"preced":["predat","anteced","anted"],"predict":["call","foretel","prognost","forebod","project"],"prefer":["favor","predilect","predisposit"],"prejudic":["bias","preconcept"],"prematur":["untim"],"prepar":["readi","prepared"],"prescript":["instruct"],"presenc":["bear","comport"],"present":["gift","nowaday","submit"],"presid":["presidentship","chairman","chairwoman","chair"],"pressur":["imper","insist"],"prestig":["prestigi"],"preval":["preponder"],"prevent":["forestal"],"price":["cost","toll"],"print":["pictur","design"],"prioriti":["preced"],"prison":["captiv"],"privaci":["privat","seclus"],"prize":["trophi"],"problem":["question","troubl"],"process":["procedur"],"proclaim":["exclaim","promulg","state","announc"],"produc":["grow","rais","farm","cultiv"],"product":["merchandis","ware","output","yield","generat"],"profess":["occup"],"professor":["prof"],"profit":["gain"],"profound":["deep"],"program":["broadcast","plan"],"progress":["advanc","gain"],"project":["undertak","task","enterpris"],"promot":["upgrad","advanc","public"],"proper":["suitabl"],"properti":["attribut","dimens","belong","hold"],"proport":["dimens"],"propos":["proposit"],"proposit":["statement"],"prospect":["expect","outlook"],"prosper":["boom","thrive","flourish"],"protest":["object","dissent"],"prove":["show","demonstr","establish"],"provid":["suppli","render","furnish"],"provis":["suppli"],"provok":["arous","evok"],"public":["issu"],"publish":["issu","releas"],"pull":["draw"],"punch":["blow","lick","biff"],"punish":["penal"],"pupil":["schoolchild"],"pure":["sinless"],"purpos":["intent","aim","design"],"pursuit":["quest","search"],"push":["press"],"put":["place","set","pose","lie","posit"],"puzzl":["toy"],"pyramid":["polyhedron"],"qualif":["reserv","limit"],"qualifi":["modifi"],"quantiti":["amount"],"quarrel":["disput","argu","row","wrangl","word","dustup"],"quest":["seek"],"question":["inquiri","queri","interrog"],"quiet":["quiescent","silent"],"quotat":["quot","citat","word"],"quot":["cite"],"race":["rush","hasten","speed","hurri"],"racism":["prejudic"],"radiat":["radioact"],"radio":["radiocommun","wireless","medium"],"rage":["furi","mad"],"raid":["foray"],"railcar":["wagon"],"rain":["rainfal"],"rais":["rear","nurtur","parent"],"random":["arbitrari"],"rang":["scope","reach","orbit","compass","stove"],"rank":["status","rate","place","rang","order","grade"],"rape":["ravish","violat","assault","rape"],"rare":["infrequ","uncommon"],"rat":["rodent"],"rate":["pace"],"reach":["touch"],"reader":["review","refere","subscrib"],"readi":["prepar"],"real":["actual","genuin"],"realism":["pragmat"],"realiti":["real"],"realiz":["recogn"],"reason":["ration","sensibl"],"rebel":["insurg","insurrectionist"],"rebellion":["insurrect","revolt","rise","upris"],"reckless":["foolhardi"],"recognit":["acknowledg"],"recogn":["accredit"],"recommend":["commend","testimoni"],"record":["tape"],"recov":["recuper","convalesc"],"recoveri":["convalesc","recuper","retriev","regain"],"recycl":["reprocess","reus"],"red":["red"],"reduc":["trim"],"reduct":["decreas","diminut"],"redund":["redund","superflu"],"refer":["mention","advert","cite","name","citat","acknowledg","credit","quotat"],"reflect":["shine","medit","ponder","contempl","reflexion"],"refriger":["fridg"],"refund":["repay"],"regard":["gaze"],"regist":["registri"],"registr":["enrol"],"regret":["sorrow","rue","rueful","repent"],"rehabilit":["exoner"],"reinforc":["reward"],"reject":["refus","declin","elimin"],"relat":["link","relat","kin"],"relax":["unwind","easi"],"releas":["free","liber","waiver","discharg"],"relev":["relev"],"reliabl":["depend"],"relief":["eas","allevi"],"relinquish":["renounc","foreswear"],"reluct":["hesit","disinclin"],"remain":["persist"],"remedi":["curat","cure","medicin"],"rememb":["retriev","recal"],"remind":["prompt","cue"],"remuner":["compens"],"repeat":["duplic","redupl","doubl","replic"],"repetit":["repeat"],"replac":["substitut","surrog","altern"],"report":["stori","account","studi","evalu","journalist","newsperson"],"repres":["congressman"],"reproduct":["replica","replic","copi"],"reptil":["reptilian"],"request":["petit"],"requir":["necess","essenti","requisit"],"rescu":["deliv"],"research":["investig"],"reserv":["retic","quiet"],"resid":["abod","occup"],"resign":["quit","surrend"],"resist":["baulk","withstand"],"respect":["esteem","valu"],"respons":["repli","reaction","duti","oblig"],"rest":["breath","remaind","balanc","residu","respit","relief"],"restless":["antsi","itchi","fidgeti"],"restor":["renov","refurbish"],"restrain":["encumb","constrain"],"restraint":["limit"],"restrict":["limit","restrain"],"result":["result","outcom","consequ"],"retain":["rememb","keep"],"retire":["pension"],"retreat":["hideaway"],"return":["homecom","restitut","restor","regain"],"reveal":["uncov"],"reveng":["retali"],"revers":["invert","revers","turnabout","turnaround"],"review":["brushup","period","recapitul","recap","summari","critiqu","retrospect"],"reviv":["resurg","revit","resuscit"],"revok":["lift","annul","revers","repeal","overturn","rescind"],"revolut":["rotat","gyrat"],"reward":["bounti","repay"],"rhythm":["beat"],"rib":["bone"],"rifl":["firearm"],"right":["correct","right"],"ring":["hoop","peal","stave","round"],"rise":["aris","increas","climb","rais","hike","upgrad","flower"],"risk":["peril","gambl","chanc","hazard"],"ritual":["rite"],"road":["rout"],"roar":["bellow"],"robot":["automaton"],"rock":["sway","stone"],"role":["charact","part"],"roll":["bun","bread","roster","rotat"],"romant":["amatori","amor"],"rotat":["turn"],"rotten":["decay","rot","crappi","lousi","shitti","stink","stinki"],"rough":["unsmooth"],"round":["circular"],"rout":["path","itinerari"],"rubbish":["trash","scrap"],"ruin":["downfal","ruinat"],"rule":["govern","regul","convent","pattern","dominion","principl","ruler"],"rumor":["hearsay"],"runner":["athlet"],"rush":["hast","hurri","rush"],"sacrific":["loss"],"sail":["canva"],"sailor":["crewman"],"salesperson":["salesclerk"],"salmon":["fish"],"sandal":["footwear"],"sandwich":["bomber","grinder","hero","hoagi","sub"],"satellit":["orbit"],"satisfact":["content"],"satisfi":["quench","slake"],"sausag":["wurst","meat"],"save":["spare"],"say":["state","tell"],"scan":["skim"],"scandal":["outrag"],"scatter":["sprinkl","dot","dust","dispers"],"scene":["fit","tantrum","connipt","set","shoot"],"scholar":["student"],"school":["schoolhous"],"scrambl":["jumbl","beat"],"scrape":["grate","scratch"],"scratch":["scrape"],"scream":["yell","shriek"],"screw":["tighten","fasten"],"sea":["ocean"],"second":["sec"],"section":["segment"],"sector":["sphere","aspect"],"secular":["laic","lie"],"secur":["protect","fasten","fix"],"see":["understand","realiz","meet","encount"],"seek":["search"],"seem":["appear"],"seiz":["clutch","grab","grasp"],"select":["excerpt","extract","surviv"],"self":["ego"],"seller":["market","vender","vendor"],"seminar":["cours"],"senior":["student"],"sens":["sensat","sentienc","signifi","mean"],"sensit":["sensit"],"sentenc":["convict"],"sentiment":["emot"],"separ":["independ","split","disassoci","divis"],"seri":["serial"],"serious":["sober"],"sermon":["preach","discours"],"serv":["attend","assist"],"servic":["help","assist","overhaul"],"session":["meet"],"set":["adjust","correct","regul"],"settlement":["coloni","resolut","outcom"],"sex":["gender","sexual"],"shadow":["shade"],"shake":["agit"],"shame":["piti"],"shape":["form","work","mold","forg"],"share":["parcel","portion"],"sharehold":["stockhold"],"shatter":["break"],"shed":["spill","disgorg"],"shell":["ammunit","eggshel"],"shift":["switch"],"shine":["glitter","glisten","glint","gleam"],"shirt":["garment"],"shiver":["shudder"],"shock":["offend","scandal","outrag","daze","stupor"],"shoe":["footwear"],"shoot":["spud","germin","sprout","inject","shoot"],"shop":["store","workshop"],"shortag":["dearth","famin"],"shoulder":["berm"],"show":["exhibit","present","demonstr","indic","point","reveal","display"],"shrink":["shrivel"],"shi":["timid","diffid"],"sick":["ill","nausea"],"side":["face","posit","slope","inclin"],"sieg":["besieg","beleagu"],"sight":["vision"],"sign":["auguri","foretoken","preindic","mark","signal","signboard","hous"],"silenc":["quiet","secreci","secret"],"silk":["fabric"],"silver":["metal"],"similar":["alik","like"],"simplic":["simpl","uncomplicated"],"sin":["sin","transgress"],"singer":["vocalist"],"singl":["individu","separ","unmarri"],"sip":["drink"],"sister":["sis"],"site":["websit"],"skeleton":["frame"],"sketch":["cartoon"],"skill":["skill"],"skin":["hide","pelt"],"skirt":["garment"],"slab":["block"],"slam":["bang"],"slant":["pitch"],"sleep":["slumber"],"sleev":["arm"],"slide":["playth","chute","slither"],"slime":["sludg","goo","gunk","muck"],"slip":["skid","slide"],"slipperi":["slippi"],"slogan":["motto","catchword"],"slump":["slouch"],"small":["littl"],"smart":["clever","bright"],"smell":["aroma","odor","odour","scent","olfact"],"smile":["smile","grin"],"smoke":["fume"],"snack":["bite","collat"],"snail":["slug"],"snake":["serpent"],"snap":["click","flick","crack","ruptur"],"snarl":["snap"],"sniff":["whiff","inhal"],"snow":["snowfal"],"snuggl":["cuddl","nestl"],"socialist":["socialist"],"sock":["stock","hosieri"],"sodium":["na"],"sofa":["couch"],"soft":["nonalcohol"],"soil":["territori","dirt"],"soul":["psych"],"sourc":["begin","origin","root","inform"],"south":["confederaci","s"],"space":["blank"],"speaker":["talker","utter","loudspeak"],"speech":["address"],"speed":["veloc","amphetamin","upper"],"spell":["write","charm"],"spend":["expend"],"sphere":["ball"],"spider":["arachnid"],"spin":["whirl","reel","gyrat","revolv"],"spinach":["veget"],"spine":["thorn","prickl"],"spirit":["intent","purport"],"spit":["spew"],"spite":["malic","malici","spite","venom"],"split":["burst","schism"],"spoil":["impair","pamper","coddl","mollycoddl","indulg","rot"],"spokesperson":["interpret","repres"],"spoon":["cutleri"],"sport":["athlet"],"spot":["smudg","blot","daub","smear"],"spray":["scatter"],"spread":["past"],"spring":["fountain","springtim"],"squar":["plaza","place"],"squash":["crush","mash"],"squeez":["pinch","compress","constrict","press","compact"],"stab":["knife"],"stabl":["stall"],"stadium":["bowl","arena"],"staff":["personnel","rod"],"stage":["phase"],"stain":["spot"],"staircas":["stairway"],"stake":["stake","bet","wager"],"stall":["booth","cubicl"],"stamp":["stomp"],"stand":["viewpoint","standpoint","bear","endur","stomach","stall"],"standard":["criterion","measur","touchston"],"star":["asterisk","ace","champion","virtuoso","hotshot","superstar"],"start":["begin","commenc","first","outset"],"state":["provinc"],"statement":["affirm","assert"],"station":["post"],"stem":["stalk"],"step":["footstep","pace","stride","gradat","stair","tread","measur"],"stereotyp":["pigeonhol"],"stick":["adher","bond","bind"],"sticki":["gluey","glutin","gummi"],"still":["inact","motionless","static"],"sting":["bite"],"stitch":["sew"],"stock":["inventori","share","livestock"],"stomach":["tummi","tum"],"stone":["rock"],"stop":["stopov","layov","discontinu","halt"],"storag":["reposit","wareh"],"stori":["narrat","fib"],"straight":["squar","honest","fair","decent"],"strain":["tens"],"strang":["unusu"],"strateg":["strateg"],"straw":["chaff","husk","shuck","stalk"],"strawberri":["fruit"],"stream":["watercours"],"strength":["fort","specialti"],"stress":["emphas","underlin","tension","tens"],"strict":["sever","nonindulg"],"strike":["attack","rap","tap","scratch","expung","excis"],"strikebreak":["scab"],"string":["twine"],"stroke":["fondl","caress","apoplexi"],"stroll":["saunter"],"strong":["firm","potent","secur","unattack","hard"],"structur":["construct"],"stubborn":["obstin"],"student":["pupil","learner"],"studi":["disciplin","subject","report"],"stun":["floor"],"style":["dash","elan","flair","panach"],"subject":["topic","theme"],"substanc":["stuff"],"substitut":["replac"],"suburb":["suburbia"],"subway":["metro","underground","tube"],"suffer":["hurt","ach","pain"],"suggest":["propos","advis","proposit"],"suitcas":["bag","luggag"],"suit":["room"],"sulphur":["sulfur","s"],"summer":["summertim"],"sun":["sunlight","sunshin"],"suntan":["tan","sunburn"],"superintend":["super"],"supplementari":["auxiliari","subsidiari"],"suppli":["backlog","stockpil","reserv","reservoir"],"support":["confirm","corrobor","substanti","document","hold","sustain","keep","livelihood","live","susten"],"suppress":["curb","inhibit"],"surround":["encircl","circl","round"],"survey":["sketch","resum"],"surviv":["endur"],"suspicion":["intuit","hunch","misgiv","mistrust","distrust"],"sustain":["prolong"],"swarm":["pour","teem"],"swear":["curs","cuss","blasphem"],"sweat":["perspir"],"sweet":["dessert"],"swing":["playth","vacil"],"switch":["chang","shift"],"swop":["switch","trade","swap","exchang"],"sword":["blade","weapon"],"symbol":["sign"],"sympathet":["appeal","likeabl"],"system":["scheme"],"tablet":["pill","lozeng","medicin"],"tactic":["tactic","maneuv"],"take":["bring","convey","choos","select"],"talent":["gift"],"talk":["talk","lectur","speak"],"talkat":["chatti","gabbi","garrul"],"tap":["spigot","wiretap"],"target":["mark"],"tast":["prefer","penchant","predilect","gustat"],"tasti":["delici"],"tax":["taxat"],"taxi":["cab","hack","taxicab"],"tea":["beverag"],"teach":["instruct"],"team":["squad"],"tear":["teardrop"],"teas":["rag","taunt","mock"],"techniqu":["profici"],"technolog":["engin"],"teenag":["adolesc"],"telephon":["phone"],"televis":["tv"],"tell":["narrat","recount","recit"],"temporari":["imperman"],"tempt":["entic","lure"],"temptat":["entic"],"tenant":["renter"],"tendenc":["inclin","disposit"],"tender":["gentl","sympathet","feel"],"tens":["taut","rigid"],"tension":["taut"],"term":["word","express","condit"],"termin":["endmost"],"terrac":["patio"],"test":["examin","exam","trial","tryout"],"text":["textbook","schoolbook"],"thaw":["unfreez","unthaw","dethaw","melt"],"theater":["dramaturgi","dramat","theatr"],"theft":["larceni","thieveri","steal"],"theme":["motif"],"theorist":["theoretician","theoriz"],"theori":["hypothesi"],"therapist":["healer"],"thesi":["dissert"],"thin":["lean"],"think":["cogit","cerebr","believ","think"],"thinker":["mind"],"thought":["consider"],"threat":["menac"],"threshold":["doorsil","doorstep"],"throat":["pharynx"],"thrust":["lung","hurl","hurtl"],"thumb":["finger"],"tick":["click"],"ticket":["summon"],"tidi":["neat","order","clean"],"tie":["draw","standoff","neckti","tie"],"tight":["constrain","constrict"],"timber":["lumber"],"time":["clock"],"tip":["gratuiti","lead","point"],"tipto":["tippyto"],"tire":["fatigu"],"titl":["championship","claim","head","deed"],"toast":["bread"],"toler":["recogn"],"tool":["implement"],"top":["peak","crown","crest","tip","summit","upsid"],"toppl":["tip"],"tortur":["tortur"],"toss":["flip","pitch","throw"],"tough":["tough","hard","rough"],"tournament":["tourney"],"tower":["structur"],"toy":["playth"],"trace":["footprint"],"track":["lead","trail","evid","racetrack","racecours","raceway"],"tract":["pamphlet"],"traction":["grip"],"trade":["barter","swap","swop","craft","deal"],"tradit":["custom"],"traffic":["pedestrian","vehicl"],"train":["coach","prepar","educ","groom"],"tranc":["spell"],"transfer":["transmit","transport","channel","transferr","convey"],"transform":["transmut","metamorphos"],"transit":["convers","changeov"],"transpar":["sheer"],"transport":["transport","ship"],"trap":["snare"],"tread":["trampl"],"treat":["handl","address","cover"],"treatment":["discuss","discours","handl"],"treati":["pact","accord"],"trench":["ditch"],"trend":["tendenc"],"trial":["tribul"],"triangl":["trilater"],"tribe":["clan"],"tribut":["testimoni"],"trip":["stumbl"],"trivial":["banal","commonplac"],"trolley":["streetcar","tram"],"troubl":["worri","perturb","distract"],"trouser":["pant"],"truck":["motortruck","lorri"],"trust":["confid","combin","cartel"],"truth":["veriti","trueness"],"tri":["judg","adjud","seek","attempt","essay","sampl","tast"],"tumbl":["toppl"],"tumour":["tumor","neoplasm"],"tune":["melodi","air","strain","adjust"],"tunnel":["passageway"],"turn":["bend","crook"],"twilight":["dusk","nightfal"],"twist":["entwin","wrench"],"twitch":["jerk"],"tycoon":["baron","king","magnat","mogul"],"unawar":["unwit"],"uncertainti":["uncertain","precari"],"underlin":["underscor"],"undermin":["sabotag","countermin","counteract"],"understand":["comprehend","sympath","empath","sympathi","compass"],"undertak":["tackl"],"undress":["disrob"],"unfair":["partial","bias"],"uniform":["unvari"],"uniqu":["unequ","unparallel"],"uniti":["integr","whole"],"unlaw":["illegitim","illicit"],"unlik":["unequ","improb"],"unpleas":["disagre"],"upset":["disturb","troubl","overturn"],"urg":["cheer","inspir"],"urin":["piss","pee","piddl","weewe","water"],"use":["consumpt","function","purpos","role","habit","usag","practic","appli","util"],"utter":["emit"],"vacuum":["void","vacanc","empti"],"vagu":["undefin"],"valley":["vale"],"van":["vehicl"],"variant":["variat"],"variat":["fluctuat"],"varieti":["divers"],"vat":["tub"],"veget":["veggi","green","flora","botani"],"vehicl":["convey"],"version":["adapt"],"vertic":["perpendicular"],"vessel":["contain","watercraft"],"viabl":["feasibl","practic","workabl"],"victori":["triumph"],"view":["opinion","posit","perspect","aspect","prospect","scene","vista","panorama"],"vigor":["strong"],"villag":["settlement"],"violat":["infring"],"visibl":["seeabl"],"visual":["ocular","optic"],"volcano":["mountain"],"volum":["loud","intens","public"],"vote":["ballot","vote","suffrag"],"voter":["elector"],"voucher":["coupon"],"wage":["pay","earn","remuner","salari"],"waist":["waistlin"],"waiter":["server"],"wake":["view"],"wander":["stray","tramp","roam","rambl","rove","rang","drift"],"want":["desir"],"war":["warfar"],"warn":["notifi","admonit"],"wash":["launder","bath","cleans"],"wast":["thriftless","wast","squander","blow"],"watch":["chronograph","timepiec","lookout","sentinel","sentri","observ"],"waterfal":["cascad"],"wave":["beckon"],"way":["mean","agenc","path"],"weak":["fail","flaw"],"wealth":["rich"],"weapon":["arm"],"wed":["marriag","nuptial"],"weight":["barbel"],"welcom":["greet","recept"],"welfar":["wellb"],"west":["west","occid","w"],"wheat":["cereal"],"whip":["lash"],"white":["achromat","caucasian"],"width":["breadth"],"wife":["spous"],"wild":["untam"],"wilder":["wild"],"will":["testament","volit"],"win":["win","profit"],"winner":["victor"],"winter":["wintertim"],"wisecrack":["crack","quip"],"witch":["enchantress","sorceress"],"withdraw":["retreat","backdown","retract","detach"],"wit":["spectat","viewer","watcher","looker"],"wonder":["marvel","question"],"wool":["fabric"],"word":["parol","phrase"],"work":["employ","workplac","oeuvr"],"world":["earth","globe","populac","public","realiti","univers","exist","cosmos","macrocosm"],"worm":["anim"],"worth":["valu"],"wind":["lesion"],"wriggl":["writh","worm","squirm"],"wrist":["carpus"],"writer":["author"],"yard":["ground"],"year":["twelvemonth","yr"],"yearn":["hanker","long"],"young":["youth"],"zone":["region"] } }, helpindex : { "0":[{"classes/pvrplatformShell.html":"13"},{"PVRShell_intro.html":"5"},{"files/Shell.html":"2"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformStateMachine.html":"1"}],"01":[{"classes/pvrplatformShellPointerNormalisedLocation.html":"16"},{"classes/pvrplatformShell.html":"2"},{"PVRShell_classes.html":"1"},{"files/Shell.html":"1"}],"1":[{"classes/pvrplatformShell.html":"13"},{"PVRShell_intro.html":"4"},{"files/Shell.html":"2"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformStateMachine.html":"1"}],"10":[{"PVRShell_intro.html":"4"},{"files/Shell.html":"1"}],"100":[{"files/Shell.html":"1"}],"101":[{"files/Shell.html":"1"}],"102":[{"files/Shell.html":"1"}],"103":[{"files/Shell.html":"1"}],"104":[{"files/Shell.html":"1"}],"105":[{"files/Shell.html":"1"}],"106":[{"files/Shell.html":"2"}],"107":[{"files/Shell.html":"1"}],"109":[{"files/Shell.html":"1"}],"11":[{"classes/pvrplatformShell.html":"1"},{"files/Shell.html":"1"}],"110":[{"files/Shell.html":"1"}],"112":[{"files/Shell.html":"1"}],"113":[{"files/Shell.html":"1"}],"114":[{"files/Shell.html":"1"}],"115":[{"files/Shell.html":"1"}],"116":[{"files/Shell.html":"1"}],"117":[{"files/Shell.html":"1"}],"118":[{"files/Shell.html":"1"}],"119":[{"files/Shell.html":"1"}],"12":[{"files/Shell.html":"1"}],"120":[{"files/Shell.html":"1"}],"121":[{"files/Shell.html":"1"}],"122":[{"files/Shell.html":"1"}],"123":[{"files/Shell.html":"1"}],"13":[{"files/Shell.html":"1"}],"14":[{"PVRShell_intro.html":"1"}],"144":[{"files/Shell.html":"1"}],"145":[{"files/Shell.html":"1"}],"16":[{"classes/pvrPointerLocation.html":"2"},{"classes/pvrPointerLocationStore.html":"2"},{"files/Shell.html":"1"}],"17":[{"files/Shell.html":"1"}],"18":[{"files/Shell.html":"1"}],"186":[{"files/Shell.html":"1"}],"187":[{"files/Shell.html":"1"}],"188":[{"files/Shell.html":"1"}],"189":[{"files/Shell.html":"1"}],"19":[{"files/Shell.html":"1"}],"190":[{"files/Shell.html":"1"}],"191":[{"files/Shell.html":"1"}],"192":[{"files/Shell.html":"1"}],"2":[{"classes/pvrplatformShell.html":"8"},{"files/Shell.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformStateMachine.html":"1"}],"20":[{"files/Shell.html":"1"}],"219":[{"files/Shell.html":"1"}],"220":[{"files/Shell.html":"1"}],"221":[{"files/Shell.html":"2"}],"222":[{"files/Shell.html":"1"}],"255":[{"files/Shell.html":"1"}],"256":[{"classes/pvrplatformShell.html":"1"}],"27":[{"files/Shell.html":"1"}],"3":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformStateMachine.html":"1"},{"files/Shell.html":"1"}],"32":[{"classes/pvrplatformShell.html":"35"},{"classes/pvrplatformShellData.html":"6"},{"classes/pvrplatformInternalOS.html":"1"},{"files/Shell.html":"1"}],"33":[{"files/Shell.html":"1"}],"34":[{"files/Shell.html":"1"}],"35":[{"files/Shell.html":"1"}],"36":[{"files/Shell.html":"1"}],"37":[{"files/Shell.html":"1"}],"38":[{"files/Shell.html":"1"}],"39":[{"files/Shell.html":"1"}],"4":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformStateMachine.html":"1"},{"files/Shell.html":"1"}],"40":[{"files/Shell.html":"1"}],"44":[{"files/Shell.html":"1"}],"45":[{"files/Shell.html":"1"}],"46":[{"files/Shell.html":"1"}],"48":[{"files/Shell.html":"1"}],"49":[{"files/Shell.html":"1"}],"5":[{"classes/pvrplatformShellEvent.html":"1"},{"files/Shell.html":"1"}],"50":[{"files/Shell.html":"1"}],"51":[{"files/Shell.html":"1"}],"52":[{"files/Shell.html":"1"}],"53":[{"files/Shell.html":"1"}],"54":[{"files/Shell.html":"1"}],"55":[{"files/Shell.html":"1"}],"56":[{"files/Shell.html":"1"}],"57":[{"files/Shell.html":"1"}],"6":[{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"files/Shell.html":"1"}],"60":[{"classes/pvrplatformShell.html":"1"}],"64":[{"classes/pvrplatformShellData.html":"4"},{"classes/pvrplatformShell.html":"3"}],"65":[{"files/Shell.html":"1"}],"66":[{"files/Shell.html":"1"}],"67":[{"files/Shell.html":"1"}],"68":[{"files/Shell.html":"1"}],"69":[{"files/Shell.html":"1"}],"7":[{"files/Shell.html":"1"}],"70":[{"files/Shell.html":"1"}],"71":[{"files/Shell.html":"1"}],"72":[{"files/Shell.html":"1"}],"73":[{"files/Shell.html":"1"}],"74":[{"files/Shell.html":"1"}],"75":[{"files/Shell.html":"1"}],"76":[{"files/Shell.html":"1"}],"77":[{"files/Shell.html":"1"}],"78":[{"files/Shell.html":"1"}],"79":[{"files/Shell.html":"1"}],"8":[{"files/Shell.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"80":[{"files/Shell.html":"1"}],"81":[{"files/Shell.html":"1"}],"82":[{"files/Shell.html":"1"}],"83":[{"files/Shell.html":"1"}],"84":[{"files/Shell.html":"1"}],"85":[{"files/Shell.html":"1"}],"86":[{"files/Shell.html":"1"}],"87":[{"files/Shell.html":"1"}],"88":[{"files/Shell.html":"1"}],"89":[{"files/Shell.html":"1"}],"9":[{"files/Shell.html":"1"}],"90":[{"files/Shell.html":"1"}],"91":[{"files/Shell.html":"2"}],"93":[{"files/Shell.html":"2"}],"96":[{"files/Shell.html":"1"}],"97":[{"files/Shell.html":"1"}],"98":[{"files/Shell.html":"1"}],"99":[{"files/Shell.html":"1"}],"a":[{"classes/pvrplatformShellPointingDeviceState.html":"18"},{"classes/pvrplatformShellEvent.html":"16"},{"classes/pvrplatformShell.html":"14"},{"PVRShell_intro.html":"10"},{"files/Shell.html":"3"},{"PVRShell_classes.html":"2"},{"classes/pvrplatform.html":"2"},{"classes/pvrplatformShellOS.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/PVRShell.html":"1"},{"files/ShellData.html":"1"},{"files/StateMachine.html":"1"}],"aa":[{"classes/pvrplatformShell.html":"2"}],"aasampl":[{"PVRShell_intro.html":"1"}],"abstract":[{"PVRShell_intro.html":"3"}],"accept":[{"classes/pvrplatformShellOS.html":"1"}],"access":[{"classes/pvrplatformShellEventunion.html":"16"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"files/Shell.html":"1"}],"across":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"action":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"files/Shell.html":"1"}],"actionclos":[{"files/Shell.html":"1"}],"actionon":[{"PVRShell_intro.html":"1"},{"files/Shell.html":"1"}],"actionto":[{"files/Shell.html":"1"}],"actual":[{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"}],"ad":[{"PVRShell_intro.html":"1"}],"adapt":[{"PVRShell_intro.html":"1"}],"add":[{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"addit":[{"PVRShell_intro.html":"1"}],"addreadpath":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"advanc":[{"classes/pvrplatformShell.html":"1"}],"after":[{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformStateMachine.html":"2"}],"alias":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"1"}],"all":[{"files/Shell.html":"16"},{"classes/pvrplatformShell.html":"4"},{"PVRShell_files.html":"2"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"}],"allow":[{"PVRShell_intro.html":"3"},{"classes/pvrplatformShell.html":"2"}],"allowread":[{"classes/pvrplatformShell.html":"2"}],"alpha":[{"classes/pvrplatformShell.html":"1"}],"also":[{"PVRShell_intro.html":"1"}],"alt":[{"files/Shell.html":"1"}],"alway":[{"classes/pvrplatformShell.html":"2"}],"amongst":[{"PVRShell_intro.html":"1"}],"an":[{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"1"}],"and":[{"classes/pvrplatformShell.html":"2"}],"android":[{"PVRShell_intro.html":"5"},{"classes/pvrplatformShell.html":"1"}],"ani":[{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"}],"anoth":[{"classes/pvrPointerLocationStore.html":"4"}],"anti":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"1"}],"api":[{"classes/pvrplatformShell.html":"5"},{"PVRShell_intro.html":"3"},{"classes/pvrplatformShellData.html":"2"}],"apk":[{"classes/pvrplatformShell.html":"1"}],"app":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"appcontrol":[{"files/EntryPoint/NSApplicationMain/AppController.html":"27"},{"files/EntryPoint/UIApplicationMain/AppController.html":"27"},{"PVRShell_files.html":"1"}],"append":[{"classes/pvrplatformShell.html":"1"}],"appic":[{"classes/pvrplatformShell.html":"1"}],"appkit":[{"files/AppKit_dir.html":"27"},{"files/EntryPoint/NSApplicationMain/AppController.html":"16"},{"PVRShell_files.html":"1"}],"appli":[{"classes/pvrplatformShell.html":"1"}],"applic":[{"classes/pvrplatformShell.html":"60"},{"classes/pvrplatformStateMachine.html":"20"},{"files/Shell.html":"19"},{"files/EntryPoint/UIApplicationMain/AppController.html":"17"},{"PVRShell_intro.html":"10"},{"classes/pvrplatformShellOS.html":"4"},{"PVRShell_files.html":"3"},{"classes/pvrplatform.html":"3"},{"PVRShell_classes.html":"2"},{"files/EntryPoint/NSApplicationMain/AppController.html":"2"},{"files/StateMachine.html":"2"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/PVRShell.html":"1"},{"files/ShellData.html":"1"}],"applicationnam":[{"classes/pvrplatformShellOS.html":"2"}],"applycommandlin":[{"classes/pvrplatformStateMachine.html":"1"}],"appnam":[{"classes/pvrplatformShellOS.html":"1"}],"aquisit":[{"classes/pvrplatformShell.html":"1"}],"arbitrari":[{"classes/pvrplatformShell.html":"2"}],"area":[{"classes/pvrplatformShell.html":"2"}],"arg":[{"classes/pvrplatformShell.html":"9"}],"argument":[{"PVRShell_intro.html":"10"},{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformStateMachine.html":"1"}],"arrow":[{"PVRShell_intro.html":"1"}],"artifici":[{"classes/pvrplatformShell.html":"1"}],"as":[{"files/OS/ShellOS.html":"16"},{"PVRShell_files.html":"2"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"}],"asset":[{"PVRShell_intro.html":"3"},{"classes/pvrplatformShell.html":"2"}],"attempt":[{"classes/pvrplatformShell.html":"1"}],"attribut":[{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformShellOS.html":"2"},{"classes/pvrplatformShellData.html":"1"}],"automat":[{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"}],"avail":[{"PVRShell_classes.html":"15"},{"PVRShell_files.html":"15"},{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"1"}],"b":[{"classes/pvrplatformShell.html":"2"},{"files/Shell.html":"1"}],"back":[{"PVRShell_intro.html":"1"}],"backbuff":[{"classes/pvrplatformShell.html":"5"},{"PVRShell_intro.html":"1"}],"backquot":[{"files/Shell.html":"1"}],"backslash":[{"files/Shell.html":"1"}],"backspac":[{"files/Shell.html":"1"}],"base":[{"files/EntryPoint/NSApplicationMain/AppController.html":"16"},{"PVRShell_files.html":"1"},{"classes/pvrplatformShell.html":"1"}],"be":[{"classes/pvrplatformShell.html":"17"},{"classes/pvrplatformShellEventunion.html":"16"},{"PVRShell_intro.html":"5"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"files/Shell.html":"1"}],"befor":[{"classes/pvrplatformStateMachine.html":"2"},{"PVRShell_intro.html":"1"}],"bigger":[{"PVRShell_intro.html":"1"}],"bin":[{"PVRShell_intro.html":"1"}],"bind":[{"PVRShell_intro.html":"1"}],"bit":[{"classes/pvrplatformShell.html":"11"},{"PVRShell_intro.html":"2"}],"bitset":[{"classes/pvrplatformShell.html":"1"}],"blue":[{"classes/pvrplatformShell.html":"1"}],"bool":[{"classes/pvrplatformShell.html":"19"},{"classes/pvrplatformShellData.html":"8"},{"classes/pvrplatformShellOS.html":"5"},{"classes/pvrplatformInternalOS.html":"4"},{"classes/pvrplatformShellPointingDeviceState.html":"2"},{"classes/pvrplatformStateMachine.html":"2"},{"classes/pvrplatformShellPrivatePointerState.html":"1"}],"border":[{"classes/pvrConfigureEvent.html":"1"}],"bottom":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"bpp":[{"classes/pvrplatformShell.html":"2"}],"break":[{"PVRShell_intro.html":"3"}],"buffer":[{"PVRShell_intro.html":"6"}],"build":[{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"}],"bundl":[{"PVRShell_intro.html":"2"}],"button":[{"classes/pvrplatformShell.html":"7"},{"classes/pvrplatformShellPointingDeviceState.html":"3"}],"buttonidx":[{"classes/pvrplatformShell.html":"15"},{"classes/pvrplatformShellEventunion.html":"1"}],"buttonindex":[{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformShellPointingDeviceState.html":"2"},{"classes/pvrplatformShellPrivatePointerState.html":"1"}],"by":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformStateMachine.html":"1"}],"c":[{"PVRShell_intro.html":"3"},{"files/Shell.html":"1"}],"calcul":[{"classes/pvrplatformShell.html":"1"}],"call":[{"classes/pvrplatformShell.html":"25"},{"PVRShell_intro.html":"7"},{"classes/pvrplatformStateMachine.html":"5"}],"callback":[{"classes/pvrplatformStateMachine.html":"16"},{"PVRShell_classes.html":"1"},{"PVRShell_intro.html":"1"},{"classes/pvrplatform.html":"1"},{"files/StateMachine.html":"1"}],"can":[{"classes/pvrplatformShellEventunion.html":"16"},{"PVRShell_intro.html":"3"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"files/Shell.html":"1"}],"capabl":[{"classes/pvrplatformShellOSCapabilities.html":"45"},{"classes/pvrplatformShellOS.html":"6"},{"PVRShell_classes.html":"2"},{"files/OS/ShellOS.html":"2"}],"capslock":[{"files/Shell.html":"1"}],"captur":[{"classes/pvrplatformShell.html":"8"}],"captureframescal":[{"classes/pvrplatformShellData.html":"1"}],"captureframestart":[{"classes/pvrplatformShellData.html":"1"}],"captureframestop":[{"classes/pvrplatformShellData.html":"1"}],"case":[{"PVRShell_intro.html":"3"}],"cbpp":[{"PVRShell_intro.html":"1"}],"channel":[{"classes/pvrplatformShell.html":"6"}],"char":[{"classes/pvrplatformShell.html":"5"},{"classes/pvrplatformInternalOS.html":"2"},{"classes/pvrplatformShellOS.html":"2"},{"classes/pvrplatformSpecialKeyCode.html":"1"}],"check":[{"classes/pvrplatformShell.html":"5"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformStateMachine.html":"1"}],"choos":[{"PVRShell_intro.html":"2"}],"clamp":[{"classes/pvrplatformShell.html":"1"}],"class":[{"PVRShell_classes.html":"50"},{"classes/pvrplatformShellOS.html":"41"},{"classes/pvrplatformShell.html":"40"},{"files/OS/ShellOS.html":"30"},{"files/Shell.html":"28"},{"files/ShellData.html":"25"},{"PVRShell_files.html":"22"},{"classes/pvrplatform.html":"18"},{"files/EntryPoint/NSApplicationMain/AppController.html":"17"},{"files/OS/Linux/InternalOS.html":"12"},{"files/OS/Windows/WindowsOSData.html":"11"},{"files/StateMachine.html":"10"},{"classes/pvr.html":"9"},{"classes/pvrplatformShellEvent.html":"9"},{"PVRShell_intro.html":"4"},{"files/OS/AppKit/ViewMTL.html":"3"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShellData.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/PVRShell.html":"1"}],"clean":[{"classes/pvrplatformShell.html":"2"}],"clear":[{"classes/pvrplatformShellOS.html":"1"}],"clearreadpath":[{"classes/pvrplatformShellOS.html":"1"}],"click":[{"classes/pvrplatformShell.html":"4"}],"clock":[{"classes/pvrplatformShell.html":"1"}],"cmd":[{"classes/pvrplatformShell.html":"1"}],"cmdshow":[{"classes/pvrplatformWindowsOSData.html":"1"}],"code":[{"PVRShell_intro.html":"10"},{"classes/pvrplatformStateMachine.html":"1"},{"files/Shell.html":"1"}],"color":[{"classes/pvrplatformShell.html":"5"}],"colorbpp":[{"PVRShell_intro.html":"1"}],"colorspac":[{"classes/pvrplatformShell.html":"9"}],"colour":[{"PVRShell_intro.html":"1"}],"colourbpp":[{"PVRShell_intro.html":"1"}],"comma":[{"files/Shell.html":"1"}],"command":[{"PVRShell_intro.html":"10"},{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformStateMachine.html":"1"}],"commandlin":[{"classes/pvrplatformStateMachine.html":"2"},{"classes/pvrplatformShellData.html":"1"}],"commandlinepars":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellData.html":"1"},{"classes/pvrplatformStateMachine.html":"1"}],"common":[{"files/OS/Linux/InternalOS.html":"16"},{"PVRShell_files.html":"2"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformSpecialKeyCode.html":"1"}],"config":[{"PVRShell_intro.html":"4"}],"configid":[{"classes/pvrplatformShell.html":"2"}],"configur":[{"classes/pvrConfigureEvent.html":"16"},{"PVRShell_classes.html":"1"},{"classes/pvr.html":"1"},{"classes/pvrplatformShell.html":"1"},{"files/Shell.html":"1"}],"configureev":[{"classes/pvrConfigureEvent.html":"27"},{"classes/pvrplatformShell.html":"5"},{"PVRShell_classes.html":"1"},{"classes/pvr.html":"1"},{"files/Shell.html":"1"}],"connect":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"consid":[{"classes/pvrplatformShell.html":"1"}],"const":[{"classes/pvrplatformShell.html":"21"},{"classes/pvrplatformShellOS.html":"13"},{"classes/pvrPointerLocationStore.html":"4"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformSpecialKeyCode.html":"1"}],"constructor":[{"classes/pvrPointerLocation.html":"3"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellData.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformStateMachine.html":"1"}],"contain":[{"files/Shell.html":"20"},{"files/ShellData.html":"18"},{"classes/pvrplatformShellData.html":"17"},{"classes/pvrplatformShellEvent.html":"17"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"17"},{"classes/pvrplatformShellPointingDeviceState.html":"17"},{"files/OS/Linux/InternalOS.html":"17"},{"files/OS/ShellOS.html":"17"},{"files/OS/Windows/WindowsOSData.html":"17"},{"PVRShell_files.html":"10"},{"PVRShell_classes.html":"4"},{"classes/pvrplatformShell.html":"4"},{"classes/pvrplatform.html":"3"},{"PVRShell_intro.html":"2"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformSpecialKeyCode.html":"1"},{"classes/pvrplatformStateMachine.html":"1"},{"classes/pvrplatformWindowsOSData.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/PVRShell.html":"1"},{"files/StateMachine.html":"1"}],"context":[{"PVRShell_intro.html":"10"},{"classes/pvrplatformShell.html":"6"}],"contextprior":[{"classes/pvrplatformShell.html":"1"}],"contexttyp":[{"classes/pvrplatformShellData.html":"1"}],"control":[{"classes/pvrplatformStateMachine.html":"17"},{"files/StateMachine.html":"17"},{"files/EntryPoint/UIApplicationMain/AppController.html":"16"},{"PVRShell_files.html":"3"},{"PVRShell_classes.html":"1"},{"PVRShell_intro.html":"1"},{"classes/pvrplatform.html":"1"},{"files/Shell.html":"1"}],"convent":[{"classes/pvrplatformShell.html":"1"}],"coordin":[{"classes/pvrPointerLocation.html":"18"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"16"},{"classes/pvrplatformShell.html":"6"},{"PVRShell_classes.html":"2"},{"PVRShell_intro.html":"2"},{"files/Shell.html":"2"},{"classes/pvr.html":"1"}],"copi":[{"classes/pvrPointerLocation.html":"2"}],"creat":[{"classes/pvrplatformShell.html":"5"},{"PVRShell_intro.html":"3"}],"creation":[{"PVRShell_intro.html":"3"}],"critic":[{"classes/pvrplatformShell.html":"1"}],"current":[{"classes/pvrplatformShell.html":"3"},{"classes/pvrplatformShellOS.html":"3"},{"classes/pvrplatformStateMachine.html":"3"},{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"currentframetim":[{"classes/pvrplatformShellData.html":"1"}],"currentst":[{"classes/pvrplatformStateMachine.html":"1"}],"cycl":[{"classes/pvrplatformShell.html":"1"}],"d":[{"files/Shell.html":"1"}],"data":[{"files/ShellData.html":"18"},{"classes/pvrplatformShellData.html":"17"},{"classes/pvrplatformShellEvent.html":"17"},{"classes/pvrplatformShellEventunion.html":"16"},{"classes/pvrplatformWindowsOSData.html":"16"},{"classes/pvrplatformShellOS.html":"6"},{"PVRShell_classes.html":"4"},{"classes/pvrplatform.html":"4"},{"classes/pvrplatformShell.html":"3"},{"files/Shell.html":"3"},{"PVRShell_files.html":"2"},{"files/OS/Windows/WindowsOSData.html":"2"},{"classes/pvrplatformStateMachine.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/PVRShell.html":"1"},{"files/StateMachine.html":"1"}],"dbpp":[{"PVRShell_intro.html":"1"}],"de":[{"PVRShell_intro.html":"1"}],"debug":[{"PVRShell_intro.html":"2"}],"declar":[{"files/OS/ShellOS.html":"17"},{"PVRShell_files.html":"2"},{"classes/pvrplatformShellOS.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvr.html":"1"},{"classes/pvrplatform.html":"1"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/Shell.html":"1"},{"files/ShellData.html":"1"},{"files/StateMachine.html":"1"}],"default":[{"classes/pvrplatformShell.html":"6"},{"classes/pvrplatformShellOS.html":"2"},{"classes/pvrplatformShellData.html":"1"}],"deleg":[{"files/EntryPoint/UIApplicationMain/AppController.html":"16"},{"PVRShell_files.html":"1"}],"delet":[{"files/Shell.html":"1"}],"delta":[{"classes/pvrplatformShell.html":"1"}],"depend":[{"classes/pvrplatformShellEventunion.html":"16"},{"PVRShell_intro.html":"4"},{"classes/pvrplatformShell.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"files/Shell.html":"1"}],"depth":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"2"}],"depthbpp":[{"PVRShell_intro.html":"1"}],"descript":[{"classes/pvrplatformShell.html":"3"},{"classes/pvrplatformInternalOS.html":"2"},{"classes/pvrplatformStateMachine.html":"2"},{"files/EntryPoint/NSApplicationMain/AppController.html":"2"},{"files/Shell.html":"2"},{"files/StateMachine.html":"2"},{"PVRShell_files.html":"1"},{"PVRShell_intro.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShellData.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformWindowsOSData.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/PVRShell.html":"1"},{"files/ShellData.html":"1"}],"desir":[{"classes/pvrplatformShell.html":"5"}],"destructor":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"detail":[{"files/OS/Windows/WindowsOSData.html":"16"},{"PVRShell_files.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformWindowsOSData.html":"1"}],"determin":[{"classes/pvrplatformShell.html":"1"}],"devic":[{"classes/pvrplatformShellPointingDeviceState.html":"18"},{"classes/pvrplatformShell.html":"8"},{"PVRShell_intro.html":"4"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"files/Shell.html":"1"}],"dieafterfram":[{"classes/pvrplatformShellData.html":"1"}],"dieaftertim":[{"classes/pvrplatformShellData.html":"1"}],"differ":[{"classes/pvrplatformShellEventunion.html":"16"},{"classes/pvrplatformShellOSCapabilities.html":"16"},{"PVRShell_classes.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/Shell.html":"1"}],"direct":[{"classes/pvrplatformShellOS.html":"16"},{"PVRShell_intro.html":"2"},{"classes/pvrplatform.html":"2"},{"files/OS/ShellOS.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShell.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"}],"disabl":[{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"}],"display":[{"classes/pvrplatformShell.html":"7"},{"classes/pvrplatformShellOS.html":"3"},{"PVRShell_intro.html":"2"}],"displayattribut":[{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformShellOS.html":"2"},{"classes/pvrplatformShellData.html":"1"}],"distanc":[{"classes/pvrplatformShell.html":"2"}],"do":[{"PVRShell_intro.html":"3"}],"drag":[{"classes/pvrplatformShell.html":"3"},{"classes/pvrplatformShellPointingDeviceState.html":"2"}],"dragstartloc":[{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"dragstartposit":[{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"draw":[{"PVRShell_intro.html":"1"}],"dt":[{"PVRShell_intro.html":"1"}],"durat":[{"classes/pvrplatformShell.html":"1"}],"e":[{"classes/pvrConfigureEvent.html":"16"},{"PVRShell_intro.html":"2"},{"files/Shell.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvr.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"easili":[{"classes/pvrplatformShell.html":"1"}],"effect":[{"classes/pvrplatformShell.html":"19"},{"PVRShell_intro.html":"1"}],"egl":[{"PVRShell_intro.html":"7"}],"either":[{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"1"}],"enabl":[{"PVRShell_intro.html":"1"}],"end":[{"PVRShell_intro.html":"1"},{"files/Shell.html":"1"}],"enddrag":[{"classes/pvrplatformShellPrivatePointerState.html":"1"}],"entri":[{"files/EntryPoint/NSApplicationMain/AppController.html":"16"},{"classes/pvrplatformStateMachine.html":"3"},{"PVRShell_intro.html":"2"},{"PVRShell_files.html":"1"}],"enum":[{"classes/pvrplatformShellEvent.html":"8"},{"classes/pvrplatformStateMachine.html":"8"},{"files/Shell.html":"8"}],"equal":[{"files/Shell.html":"1"}],"error":[{"classes/pvrplatformShell.html":"2"}],"erroriffilenotfound":[{"classes/pvrplatformShell.html":"2"}],"escap":[{"files/Shell.html":"1"}],"etc":[{"PVRShell_intro.html":"4"},{"classes/pvrplatformShell.html":"4"}],"event":[{"classes/pvrplatformShellEventunion.html":"32"},{"classes/pvrplatformShell.html":"20"},{"classes/pvrplatformShellEvent.html":"18"},{"classes/pvrConfigureEvent.html":"16"},{"files/Shell.html":"5"},{"PVRShell_classes.html":"4"},{"PVRShell_intro.html":"3"},{"classes/pvrplatform.html":"2"},{"classes/pvr.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/PVRShell.html":"1"},{"files/ShellData.html":"1"},{"files/StateMachine.html":"1"}],"eventbuttondown":[{"classes/pvrplatformShell.html":"1"}],"eventbuttonup":[{"classes/pvrplatformShell.html":"1"}],"eventclick":[{"classes/pvrplatformShell.html":"1"}],"eventdragfinish":[{"classes/pvrplatformShell.html":"1"}],"eventdragstart":[{"classes/pvrplatformShell.html":"1"}],"eventkeydown":[{"classes/pvrplatformShell.html":"1"}],"eventkeystrok":[{"classes/pvrplatformShell.html":"1"}],"eventkeyup":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"eventmappedinput":[{"PVRShell_intro.html":"3"},{"classes/pvrplatformShell.html":"1"}],"eventqueu":[{"classes/pvrplatformShell.html":"1"}],"everi":[{"PVRShell_intro.html":"3"},{"classes/pvrplatformShell.html":"1"}],"everywher":[{"PVRShell_intro.html":"1"}],"evt":[{"PVRShell_intro.html":"2"}],"exact":[{"classes/pvrplatformShell.html":"1"}],"exampl":[{"PVRShell_intro.html":"12"},{"classes/pvrplatformStateMachine.html":"1"}],"execut":[{"classes/pvrplatformStateMachine.html":"8"},{"classes/pvrplatformShell.html":"1"}],"executedown":[{"classes/pvrplatformStateMachine.html":"1"}],"executedownto":[{"classes/pvrplatformStateMachine.html":"1"}],"executefram":[{"classes/pvrplatformStateMachine.html":"1"}],"executeinitappl":[{"classes/pvrplatformStateMachine.html":"1"}],"executeinitview":[{"classes/pvrplatformStateMachine.html":"1"}],"executeinitwindow":[{"classes/pvrplatformStateMachine.html":"1"}],"executenext":[{"classes/pvrplatformStateMachine.html":"1"}],"executequitappl":[{"classes/pvrplatformStateMachine.html":"1"}],"executereleaseview":[{"classes/pvrplatformStateMachine.html":"1"}],"executereleasewindow":[{"classes/pvrplatformStateMachine.html":"1"}],"executeto":[{"classes/pvrplatformStateMachine.html":"2"}],"executeup":[{"classes/pvrplatformStateMachine.html":"1"}],"executeupto":[{"classes/pvrplatformStateMachine.html":"1"}],"exit":[{"classes/pvrplatformShell.html":"5"},{"classes/pvrplatformShellData.html":"1"},{"classes/pvrplatformStateMachine.html":"1"}],"exitmessag":[{"classes/pvrplatformShellData.html":"1"}],"exitrenderfram":[{"classes/pvrplatformShell.html":"1"}],"exitshel":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"expect":[{"classes/pvrplatformShell.html":"1"}],"extend":[{"classes/pvrplatformShell.html":"1"}],"extens":[{"classes/pvrplatformShell.html":"1"}],"extern":[{"classes/pvrplatformShell.html":"6"}],"f":[{"files/Shell.html":"10"}],"factor":[{"classes/pvrplatformShell.html":"1"}],"fakeframetim":[{"classes/pvrplatformShellData.html":"1"}],"fals":[{"classes/pvrplatformShell.html":"5"}],"ffor":[{"files/Shell.html":"1"}],"fft":[{"PVRShell_intro.html":"1"}],"fifo":[{"classes/pvrplatformShell.html":"1"}],"file":[{"PVRShell_files.html":"29"},{"files/PVRShell.html":"16"},{"classes/pvrplatformShell.html":"7"},{"PVRShell_intro.html":"6"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformShellData.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformSpecialKeyCode.html":"1"},{"classes/pvrplatformStateMachine.html":"1"},{"classes/pvrplatformWindowsOSData.html":"1"},{"files/Shell.html":"1"}],"filenam":[{"classes/pvrplatformShell.html":"8"}],"filesystem":[{"classes/pvrplatformShell.html":"2"}],"find":[{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformShellData.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformSpecialKeyCode.html":"1"},{"classes/pvrplatformStateMachine.html":"1"},{"classes/pvrplatformWindowsOSData.html":"1"}],"finish":[{"classes/pvrplatformShell.html":"1"}],"first":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"2"}],"firstcharact":[{"classes/pvrplatformInternalOS.html":"1"}],"five":[{"PVRShell_intro.html":"1"}],"fix":[{"PVRShell_intro.html":"1"}],"float":[{"classes/pvrplatformShell.html":"3"},{"classes/pvrplatformShellData.html":"2"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"2"},{"PVRShell_intro.html":"1"}],"folder":[{"PVRShell_intro.html":"1"}],"fone":[{"files/Shell.html":"1"}],"for":[{"files/Shell.html":"16"},{"PVRShell_files.html":"2"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"}],"forc":[{"classes/pvrplatformShell.html":"5"},{"PVRShell_intro.html":"2"}],"forceframetim":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellData.html":"1"}],"forcereleaseinitview":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellData.html":"1"}],"forcereleaseinitwindow":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellData.html":"1"}],"format":[{"classes/pvrplatformShell.html":"9"}],"forward":[{"classes/pvrplatformShellOS.html":"16"},{"classes/pvrplatform.html":"2"},{"files/OS/ShellOS.html":"2"},{"PVRShell_classes.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"}],"foundat":[{"PVRShell_intro.html":"1"}],"fps":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformShellData.html":"1"}],"frame":[{"classes/pvrplatformShell.html":"27"},{"PVRShell_intro.html":"8"}],"framebuff":[{"classes/pvrplatformShell.html":"12"}],"frameno":[{"classes/pvrplatformShellData.html":"1"}],"framework":[{"PVRShell_intro.html":"17"}],"fto":[{"files/Shell.html":"1"}],"full":[{"classes/pvrplatformShell.html":"4"},{"PVRShell_intro.html":"2"}],"fullscreen":[{"classes/pvrplatformShell.html":"4"},{"PVRShell_intro.html":"1"}],"function":[{"classes/pvrplatformShellOS.html":"19"},{"files/OS/ShellOS.html":"18"},{"files/OS/AppKit/ViewMTL.html":"17"},{"files/Shell.html":"17"},{"files/EntryPoint/NSApplicationMain/AppController.html":"16"},{"files/EntryPoint/UIApplicationMain/AppController.html":"16"},{"files/PVRShell.html":"16"},{"files/StateMachine.html":"16"},{"classes/pvrplatformShell.html":"7"},{"PVRShell_files.html":"5"},{"PVRShell_intro.html":"5"},{"classes/pvrplatform.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"}],"g":[{"classes/pvrConfigureEvent.html":"16"},{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"2"},{"files/Shell.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvr.html":"1"}],"gainfocus":[{"files/Shell.html":"1"}],"general":[{"classes/pvrplatformShell.html":"1"}],"generat":[{"classes/pvrplatformShell.html":"1"}],"get":[{"classes/pvrplatformShell.html":"35"},{"classes/pvrplatformShellPointingDeviceState.html":"2"},{"classes/pvrplatformStateMachine.html":"1"}],"getaasampl":[{"classes/pvrplatformShell.html":"1"}],"getappl":[{"classes/pvrplatformShellOS.html":"1"}],"getapplicationnam":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"getassetstream":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"getbackbuffercolorspac":[{"classes/pvrplatformShell.html":"2"}],"getcap":[{"classes/pvrplatformShellOS.html":"1"}],"getcaptureframescal":[{"classes/pvrplatformShell.html":"1"}],"getcaptureframestart":[{"classes/pvrplatformShell.html":"1"}],"getcaptureframestop":[{"classes/pvrplatformShell.html":"1"}],"getcolorbitsperpixel":[{"classes/pvrplatformShell.html":"1"}],"getcommandlin":[{"classes/pvrplatformShell.html":"1"}],"getconnect":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"getcontextprior":[{"classes/pvrplatformShell.html":"1"}],"getdefaultreadpath":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"getdepthbitsperpixel":[{"classes/pvrplatformShell.html":"1"}],"getdesiredconfig":[{"classes/pvrplatformShell.html":"1"}],"getdisplay":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"getdisplayattribut":[{"classes/pvrplatformShell.html":"2"}],"getexitmessag":[{"classes/pvrplatformShell.html":"1"}],"getfakeframetim":[{"classes/pvrplatformShell.html":"1"}],"getfp":[{"classes/pvrplatformShell.html":"1"}],"getframenumb":[{"classes/pvrplatformShell.html":"1"}],"getframetim":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"getheight":[{"classes/pvrplatformShell.html":"1"}],"getkeyfromascii":[{"classes/pvrplatformInternalOS.html":"1"}],"getkeyfromevcod":[{"classes/pvrplatformInternalOS.html":"1"}],"getmaxapi":[{"classes/pvrplatformShell.html":"1"}],"getminapi":[{"classes/pvrplatformShell.html":"1"}],"geto":[{"classes/pvrplatformShell.html":"1"}],"getpointerabsoluteposit":[{"classes/pvrplatformShell.html":"1"}],"getpointernormalisedposit":[{"classes/pvrplatformShell.html":"1"}],"getpointerrelativeposit":[{"classes/pvrplatformShell.html":"1"}],"getpointingdevicest":[{"classes/pvrplatformShell.html":"1"}],"getpositioni":[{"classes/pvrplatformShell.html":"1"}],"getpositionx":[{"classes/pvrplatformShell.html":"1"}],"getquitafterfram":[{"classes/pvrplatformShell.html":"1"}],"getquitaftertim":[{"classes/pvrplatformShell.html":"1"}],"getreadpath":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"getscreenshotfilenam":[{"classes/pvrplatformShell.html":"1"}],"getsdkvers":[{"classes/pvrplatformShell.html":"1"}],"getshel":[{"classes/pvrplatformShellOS.html":"1"}],"getshello":[{"classes/pvrplatformInternalOS.html":"2"}],"getspecialkey":[{"classes/pvrplatformInternalOS.html":"1"}],"getstat":[{"classes/pvrplatformStateMachine.html":"1"}],"getstencilbitsperpixel":[{"classes/pvrplatformShell.html":"1"}],"gettim":[{"classes/pvrplatformShell.html":"2"}],"gettimeatinitappl":[{"classes/pvrplatformShell.html":"2"}],"getvsyncmod":[{"classes/pvrplatformShell.html":"1"}],"getwidth":[{"classes/pvrplatformShell.html":"1"}],"getwindow":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"getwriteassetstream":[{"classes/pvrplatformShell.html":"1"}],"getwritepath":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"give":[{"PVRShell_intro.html":"1"}],"go":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"graphic":[{"PVRShell_intro.html":"6"},{"classes/pvrplatformShell.html":"2"}],"green":[{"classes/pvrplatformShell.html":"1"}],"h":[{"files/Shell.html":"28"},{"files/EntryPoint/NSApplicationMain/AppController.html":"27"},{"files/EntryPoint/UIApplicationMain/AppController.html":"27"},{"files/OS/AppKit/ViewMTL.html":"27"},{"files/OS/Linux/InternalOS.html":"27"},{"files/OS/ShellOS.html":"27"},{"files/OS/Windows/WindowsOSData.html":"27"},{"files/PVRShell.html":"27"},{"files/ShellData.html":"27"},{"files/StateMachine.html":"27"},{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"1"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformShellData.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformSpecialKeyCode.html":"1"},{"classes/pvrplatformStateMachine.html":"1"},{"classes/pvrplatformWindowsOSData.html":"1"}],"handl":[{"classes/pvrplatformShell.html":"9"},{"PVRShell_intro.html":"2"},{"classes/pvrplatformShellOS.html":"1"}],"handleosev":[{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"has":[{"classes/pvrplatformShell.html":"1"}],"height":[{"classes/pvrplatformShell.html":"6"},{"PVRShell_intro.html":"2"},{"classes/pvrConfigureEvent.html":"1"}],"henc":[{"PVRShell_intro.html":"1"}],"high":[{"classes/pvrplatformShell.html":"4"}],"home":[{"files/Shell.html":"1"}],"horizont":[{"classes/pvrplatformShell.html":"1"}],"hous":[{"PVRShell_intro.html":"1"}],"id":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"1"}],"identifi":[{"PVRShell_intro.html":"1"}],"if":[{"PVRShell_intro.html":"1"}],"imag":[{"classes/pvrplatformShell.html":"2"}],"implement":[{"files/OS/Linux/InternalOS.html":"17"},{"files/OS/Windows/WindowsOSData.html":"17"},{"classes/pvrplatformShellOS.html":"16"},{"files/EntryPoint/NSApplicationMain/AppController.html":"16"},{"files/EntryPoint/UIApplicationMain/AppController.html":"16"},{"PVRShell_intro.html":"9"},{"PVRShell_files.html":"6"},{"classes/pvrplatformShell.html":"6"},{"classes/pvrplatform.html":"2"},{"files/OS/ShellOS.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformSpecialKeyCode.html":"1"},{"classes/pvrplatformWindowsOSData.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/Shell.html":"1"}],"implkeydown":[{"classes/pvrplatformShell.html":"1"}],"implkeyup":[{"classes/pvrplatformShell.html":"1"}],"implpointingdevicedown":[{"classes/pvrplatformShell.html":"1"}],"implpointingdeviceup":[{"classes/pvrplatformShell.html":"1"}],"implsystemev":[{"classes/pvrplatformShell.html":"1"}],"import":[{"files/Shell.html":"16"},{"PVRShell_files.html":"2"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"}],"includ":[{"files/PVRShell.html":"16"},{"PVRShell_files.html":"2"},{"PVRShell_intro.html":"1"}],"increment":[{"classes/pvrplatformShell.html":"2"}],"index":[{"classes/pvrplatformShell.html":"4"},{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"indic":[{"classes/pvrplatformShellOS.html":"1"}],"influenc":[{"PVRShell_intro.html":"1"}],"info":[{"PVRShell_intro.html":"1"}],"inform":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"inherit":[{"files/Shell.html":"18"},{"classes/pvrplatformShell.html":"17"},{"PVRShell_files.html":"2"},{"classes/pvrplatform.html":"2"},{"PVRShell_classes.html":"1"},{"PVRShell_intro.html":"1"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/PVRShell.html":"1"},{"files/ShellData.html":"1"},{"files/StateMachine.html":"1"}],"init":[{"classes/pvrplatformShell.html":"18"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformStateMachine.html":"1"}],"initappl":[{"PVRShell_intro.html":"3"},{"classes/pvrplatformShell.html":"3"}],"initi":[{"PVRShell_intro.html":"7"},{"classes/pvrplatformShell.html":"3"},{"classes/pvrplatformShellOS.html":"2"}],"initiailis":[{"classes/pvrplatformShellOS.html":"1"}],"initialis":[{"classes/pvrplatformStateMachine.html":"5"},{"PVRShell_intro.html":"2"}],"initializewindow":[{"classes/pvrplatformShellOS.html":"1"}],"initialkey":[{"classes/pvrplatformInternalOS.html":"1"}],"initview":[{"classes/pvrplatformShell.html":"4"},{"PVRShell_intro.html":"2"}],"initwithfram":[{"files/OS/AppKit/ViewMTL.html":"1"}],"inlin":[{"files/Shell.html":"1"},{"files/StateMachine.html":"1"}],"input":[{"classes/pvrplatformShell.html":"6"},{"PVRShell_intro.html":"5"}],"inpvrshel":[{"PVRShell_files.html":"15"}],"insert":[{"files/Shell.html":"1"}],"instanc":[{"classes/pvrplatformShellOS.html":"4"},{"classes/pvrplatformStateMachine.html":"3"},{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"1"}],"instanti":[{"classes/pvrplatformShell.html":"1"}],"instead":[{"classes/pvrplatformShellOS.html":"16"},{"classes/pvrplatform.html":"2"},{"files/OS/ShellOS.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShell.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"}],"int":[{"classes/pvrplatformShell.html":"7"},{"classes/pvrConfigureEvent.html":"5"},{"classes/pvrplatformShellData.html":"4"},{"classes/pvrPointerLocation.html":"2"},{"classes/pvrPointerLocationStore.html":"2"},{"classes/pvrplatformShellPointingDeviceState.html":"2"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformWindowsOSData.html":"1"}],"intend":[{"PVRShell_intro.html":"1"}],"interfac":[{"classes/pvrplatformShell.html":"1"}],"intern":[{"classes/pvrplatformShellData.html":"33"},{"files/ShellData.html":"18"},{"classes/pvrplatformShellOS.html":"16"},{"classes/pvrplatform.html":"4"},{"PVRShell_classes.html":"3"},{"PVRShell_files.html":"2"},{"classes/pvrplatformStateMachine.html":"2"},{"files/OS/ShellOS.html":"2"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"}],"internalo":[{"files/OS/Linux/InternalOS.html":"44"},{"classes/pvrplatformInternalOS.html":"31"},{"PVRShell_files.html":"3"},{"classes/pvrplatformSpecialKeyCode.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrplatform.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"intro":[{"PVRShell_intro.html":"27"}],"io":[{"files/EntryPoint/UIApplicationMain/AppController.html":"16"},{"PVRShell_intro.html":"2"},{"PVRShell_files.html":"1"}],"is":[{"files/OS/ShellOS.html":"16"},{"PVRShell_intro.html":"6"},{"PVRShell_files.html":"2"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"}],"isbuttonpress":[{"classes/pvrplatformShell.html":"1"}],"isdrag":[{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"isforcingframetim":[{"classes/pvrplatformShell.html":"1"}],"isfullscreen":[{"classes/pvrplatformShell.html":"1"}],"isiniti":[{"classes/pvrplatformInternalOS.html":"3"},{"classes/pvrplatformShellOS.html":"1"}],"iskeypress":[{"classes/pvrplatformShell.html":"1"}],"iskeypressedv":[{"classes/pvrplatformShell.html":"1"}],"ispaus":[{"classes/pvrplatformStateMachine.html":"1"}],"ispress":[{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"isscreenlandscap":[{"classes/pvrplatformShell.html":"1"}],"isscreenportrait":[{"classes/pvrplatformShell.html":"1"}],"isscreenrot":[{"classes/pvrplatformShell.html":"1"}],"isshowingfp":[{"classes/pvrplatformShell.html":"1"}],"it":[{"classes/pvrplatformStateMachine.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"item":[{"PVRShell_intro.html":"1"}],"j":[{"files/Shell.html":"1"}],"just":[{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"1"}],"k":[{"files/Shell.html":"1"}],"key":[{"classes/pvrplatformShell.html":"40"},{"files/Shell.html":"10"},{"classes/pvrplatformInternalOS.html":"3"},{"PVRShell_intro.html":"2"},{"classes/pvrplatformShellEventunion.html":"2"},{"classes/pvrplatformSpecialKeyCode.html":"2"}],"keyboard":[{"PVRShell_intro.html":"3"},{"classes/pvrplatformShell.html":"3"}],"keycod":[{"classes/pvrplatformInternalOS.html":"1"}],"keydown":[{"classes/pvrplatformShellEvent.html":"1"}],"keyfor":[{"files/Shell.html":"1"}],"keyon":[{"files/Shell.html":"1"}],"keystat":[{"classes/pvrplatformShell.html":"1"}],"keystrok":[{"classes/pvrplatformShell.html":"1"}],"keyto":[{"files/Shell.html":"1"}],"keyup":[{"classes/pvrplatformShellEvent.html":"1"}],"know":[{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"l":[{"files/Shell.html":"1"}],"landscap":[{"classes/pvrplatformShell.html":"1"}],"larg":[{"classes/pvrplatformShell.html":"1"}],"last":[{"classes/pvrplatformShell.html":"4"},{"classes/pvrplatformShellPointingDeviceState.html":"2"}],"lastframetim":[{"classes/pvrplatformShellData.html":"1"}],"launch":[{"classes/pvrplatformShell.html":"1"}],"leav":[{"PVRShell_intro.html":"5"},{"classes/pvrplatformShell.html":"2"},{"files/Shell.html":"2"}],"less":[{"classes/pvrplatformStateMachine.html":"2"}],"lib":[{"PVRShell_intro.html":"2"}],"librari":[{"PVRShell_intro.html":"3"}],"like":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"line":[{"PVRShell_intro.html":"10"},{"classes/pvrplatformShell.html":"3"},{"classes/pvrplatformStateMachine.html":"1"}],"linear":[{"classes/pvrplatformShell.html":"2"}],"link":[{"PVRShell_intro.html":"1"}],"linux":[{"files/Linux_dir.html":"27"},{"files/OS/Linux/InternalOS.html":"16"},{"PVRShell_files.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformSpecialKeyCode.html":"1"}],"list":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"lmb":[{"classes/pvrplatformShell.html":"5"}],"load":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"2"}],"locat":[{"classes/pvrPointerLocationStore.html":"16"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"16"},{"classes/pvrplatformShell.html":"13"},{"PVRShell_classes.html":"2"},{"classes/pvrplatformShellPointingDeviceState.html":"2"},{"files/Shell.html":"2"},{"classes/pvr.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"log":[{"classes/pvrplatformShell.html":"2"}],"logic":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"look":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"lookup":[{"classes/pvrplatformShell.html":"1"}],"loop":[{"classes/pvrplatformStateMachine.html":"16"},{"PVRShell_classes.html":"1"},{"PVRShell_intro.html":"1"},{"classes/pvrplatform.html":"1"},{"files/StateMachine.html":"1"}],"lose":[{"PVRShell_intro.html":"3"}],"losefocus":[{"files/Shell.html":"1"}],"lot":[{"classes/pvrplatformShellOS.html":"16"},{"classes/pvrplatform.html":"2"},{"files/OS/ShellOS.html":"2"},{"PVRShell_classes.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"}],"low":[{"classes/pvrplatformShell.html":"2"}],"lrgb":[{"classes/pvrplatformShell.html":"1"}],"m":[{"files/Shell.html":"1"}],"machin":[{"classes/pvrplatformStateMachine.html":"6"}],"maco":[{"PVRShell_intro.html":"1"}],"mailbox":[{"classes/pvrplatformShell.html":"1"}],"main":[{"classes/pvrplatformShell.html":"23"},{"classes/pvrplatformStateMachine.html":"19"},{"PVRShell_intro.html":"4"},{"classes/pvrplatform.html":"3"},{"files/Shell.html":"3"},{"PVRShell_classes.html":"2"},{"files/StateMachine.html":"2"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/PVRShell.html":"1"},{"files/ShellData.html":"1"}],"make":[{"classes/pvrplatformShell.html":"1"}],"makefil":[{"PVRShell_intro.html":"1"}],"mani":[{"classes/pvrplatformShell.html":"1"}],"map":[{"PVRShell_intro.html":"1"}],"mapkeytomaininput":[{"classes/pvrplatformShell.html":"1"}],"mappedinput":[{"PVRShell_intro.html":"1"}],"mappedinputev":[{"PVRShell_intro.html":"3"}],"mappointingdevicebuttontosimpleinput":[{"classes/pvrplatformShell.html":"1"}],"maximum":[{"classes/pvrplatformShell.html":"3"}],"maxnumkeycod":[{"files/Shell.html":"1"}],"may":[{"classes/pvrplatformShellOSCapabilities.html":"16"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"files/OS/ShellOS.html":"1"}],"mean":[{"classes/pvrplatformShell.html":"1"}],"medium":[{"classes/pvrplatformShell.html":"2"}],"member":[{"classes/pvrplatformShellEventunion.html":"16"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"files/Shell.html":"1"}],"menukey":[{"files/Shell.html":"1"}],"messag":[{"classes/pvrplatformShellOS.html":"4"},{"classes/pvrplatformShell.html":"3"}],"method":[{"classes/pvrplatformShell.html":"24"},{"classes/pvrplatformInternalOS.html":"16"},{"classes/pvrplatformStateMachine.html":"16"},{"classes/pvrPointerLocation.html":"8"},{"classes/pvrPointerLocationStore.html":"8"},{"classes/pvrplatformShellData.html":"8"},{"classes/pvrplatformShellOS.html":"8"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"8"},{"classes/pvrplatformShellPointingDeviceState.html":"8"},{"classes/pvrplatformShellPrivatePointerState.html":"8"},{"classes/pvrplatformWindowsOSData.html":"8"},{"PVRShell_intro.html":"1"}],"microsoft":[{"files/OS/Windows/WindowsOSData.html":"16"},{"PVRShell_files.html":"2"},{"classes/pvrplatformWindowsOSData.html":"1"}],"might":[{"classes/pvrplatformShell.html":"1"}],"millisecond":[{"classes/pvrplatformShell.html":"4"}],"mincontexttyp":[{"classes/pvrplatformShellData.html":"1"}],"minim":[{"PVRShell_intro.html":"1"}],"minimum":[{"classes/pvrplatformShell.html":"3"}],"minus":[{"files/Shell.html":"1"}],"miss":[{"classes/pvrplatformShell.html":"1"}],"mmb":[{"classes/pvrplatformShell.html":"5"}],"mode":[{"classes/pvrplatformShell.html":"4"},{"PVRShell_intro.html":"1"}],"model":[{"PVRShell_intro.html":"1"}],"modifi":[{"PVRShell_intro.html":"1"}],"modul":[{"PVRShell_intro.html":"17"}],"more":[{"PVRShell_intro.html":"1"}],"mous":[{"classes/pvrplatformShellPointingDeviceState.html":"18"},{"classes/pvrPointerLocation.html":"16"},{"classes/pvrplatformShell.html":"9"},{"PVRShell_classes.html":"2"},{"files/Shell.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvr.html":"1"}],"movabl":[{"classes/pvrplatformShellOSCapabilities.html":"1"}],"movement":[{"classes/pvrplatformShell.html":"1"}],"must":[{"classes/pvrplatformShell.html":"1"}],"myapplic":[{"PVRShell_intro.html":"4"}],"n":[{"PVRShell_intro.html":"28"},{"files/Shell.html":"1"}],"name":[{"files/Shell.html":"119"},{"classes/pvrplatformShell.html":"12"},{"classes/pvrplatformShellEvent.html":"9"},{"classes/pvrplatformStateMachine.html":"9"},{"classes/pvrplatformShellOS.html":"8"},{"classes/pvrplatformInternalOS.html":"3"},{"files/StateMachine.html":"3"},{"classes/pvr.html":"2"},{"classes/pvrPointerLocationStore.html":"2"},{"classes/pvrplatform.html":"2"},{"classes/pvrplatformShellData.html":"2"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"2"},{"classes/pvrplatformShellPointingDeviceState.html":"2"},{"classes/pvrplatformWindowsOSData.html":"2"},{"files/EntryPoint/NSApplicationMain/AppController.html":"2"},{"files/OS/AppKit/ViewMTL.html":"2"},{"files/OS/Linux/InternalOS.html":"2"},{"files/OS/ShellOS.html":"2"},{"files/OS/Windows/WindowsOSData.html":"2"},{"files/ShellData.html":"2"},{"PVRShell_classes.html":"1"},{"PVRShell_files.html":"1"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformSpecialKeyCode.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/PVRShell.html":"1"}],"namespac":[{"classes/pvr.html":"8"},{"classes/pvrplatform.html":"8"},{"files/EntryPoint/NSApplicationMain/AppController.html":"8"},{"files/EntryPoint/UIApplicationMain/AppController.html":"8"},{"files/OS/AppKit/ViewMTL.html":"8"},{"files/OS/Linux/InternalOS.html":"8"},{"files/OS/ShellOS.html":"8"},{"files/OS/Windows/WindowsOSData.html":"8"},{"files/PVRShell.html":"8"},{"files/Shell.html":"8"},{"files/ShellData.html":"8"},{"files/StateMachine.html":"8"}],"nativ":[{"PVRShell_intro.html":"2"}],"natur":[{"classes/pvrplatformStateMachine.html":"1"}],"necessari":[{"classes/pvrplatformShellData.html":"16"},{"files/EntryPoint/NSApplicationMain/AppController.html":"16"},{"PVRShell_classes.html":"1"},{"PVRShell_files.html":"1"},{"classes/pvrplatform.html":"1"},{"files/ShellData.html":"1"}],"new":[{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformShellOS.html":"2"}],"newdemo":[{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"1"},{"files/Shell.html":"1"}],"newstat":[{"classes/pvrplatformStateMachine.html":"6"},{"files/StateMachine.html":"1"}],"next":[{"classes/pvrplatformShell.html":"1"}],"no":[{"PVRShell_intro.html":"1"}],"non":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"none":[{"files/Shell.html":"1"}],"normal":[{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"}],"normalis":[{"classes/pvrplatformShellPointerNormalisedLocation.html":"16"},{"classes/pvrplatformShell.html":"2"},{"PVRShell_classes.html":"1"},{"files/Shell.html":"1"}],"not":[{"classes/pvrplatformShell.html":"9"}],"noth":[{"classes/pvrplatformStateMachine.html":"2"}],"nsapplicationmain":[{"files/NSApplicationMain_dir.html":"27"}],"nsrect":[{"files/OS/AppKit/ViewMTL.html":"1"}],"num":[{"files/Shell.html":"7"}],"numadd":[{"files/Shell.html":"1"}],"number":[{"classes/pvrplatformShell.html":"17"},{"PVRShell_intro.html":"1"}],"numdiv":[{"files/Shell.html":"1"}],"numfor":[{"files/Shell.html":"1"}],"numlock":[{"files/Shell.html":"1"}],"nummul":[{"files/Shell.html":"1"}],"numon":[{"files/Shell.html":"1"}],"numperiod":[{"files/Shell.html":"1"}],"numsub":[{"files/Shell.html":"1"}],"numto":[{"files/Shell.html":"1"}],"o":[{"files/Shell.html":"1"}],"object":[{"classes/pvrplatformShell.html":"6"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformStateMachine.html":"1"}],"obtain":[{"classes/pvrplatformShell.html":"1"}],"of":[{"PVRShell_files.html":"17"},{"files/OS/ShellOS.html":"16"},{"PVRShell_classes.html":"15"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"}],"on":[{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"}],"onconfigureev":[{"classes/pvrplatformShell.html":"1"}],"one":[{"PVRShell_intro.html":"1"}],"onkeydown":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"onkeyup":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"onpointingdevicedown":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"onpointingdeviceup":[{"classes/pvrplatformShell.html":"1"}],"onsystemev":[{"classes/pvrplatformShell.html":"1"}],"opengl":[{"PVRShell_intro.html":"1"}],"oper":[{"classes/pvrPointerLocationStore.html":"8"},{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"}],"option":[{"PVRShell_intro.html":"3"},{"classes/pvrplatformShell.html":"2"}],"or":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"order":[{"classes/pvrplatformShell.html":"1"}],"orient":[{"PVRShell_intro.html":"1"}],"os":[{"files/OS_dir.html":"27"},{"classes/pvrplatformWindowsOSData.html":"16"},{"classes/pvrplatformShellOS.html":"4"},{"PVRShell_classes.html":"1"},{"classes/pvrplatform.html":"1"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellData.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"}],"osappl":[{"classes/pvrplatformShellOS.html":"3"},{"classes/pvrplatformStateMachine.html":"1"}],"osconnect":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"osdata":[{"classes/pvrplatformShellOS.html":"3"},{"classes/pvrplatformStateMachine.html":"3"}],"osdisplay":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"osimplement":[{"classes/pvrplatformShellOS.html":"1"}],"oswindow":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"other":[{"PVRShell_intro.html":"1"}],"otherwis":[{"classes/pvrplatformShell.html":"1"}],"output":[{"PVRShell_intro.html":"5"},{"classes/pvrplatformShell.html":"2"}],"outputinfo":[{"classes/pvrplatformShellData.html":"1"}],"overid":[{"classes/pvrplatformShellOS.html":"1"}],"overrid":[{"classes/pvrplatformShell.html":"10"},{"PVRShell_intro.html":"1"}],"overview":[{"PVRShell_intro.html":"23"},{"files/EntryPoint/NSApplicationMain/AppController.html":"8"},{"files/EntryPoint/UIApplicationMain/AppController.html":"8"},{"files/OS/Linux/InternalOS.html":"8"},{"files/OS/ShellOS.html":"8"},{"files/OS/Windows/WindowsOSData.html":"8"},{"files/PVRShell.html":"8"},{"files/Shell.html":"8"},{"files/ShellData.html":"8"},{"files/StateMachine.html":"8"}],"own":[{"classes/pvrplatformShell.html":"1"}],"p":[{"files/Shell.html":"1"}],"packag":[{"PVRShell_intro.html":"1"}],"pagedown":[{"files/Shell.html":"1"}],"pageup":[{"files/Shell.html":"1"}],"paramet":[{"classes/pvrplatformShell.html":"43"},{"classes/pvrplatformStateMachine.html":"8"},{"classes/pvrplatformShellOS.html":"7"},{"classes/pvrPointerLocationStore.html":"4"},{"classes/pvrPointerLocation.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"parsedcommandlin":[{"classes/pvrplatformShell.html":"1"}],"pass":[{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformStateMachine.html":"2"}],"path":[{"classes/pvrplatformShell.html":"10"},{"classes/pvrplatformShellOS.html":"10"},{"classes/pvrplatformStateMachine.html":"1"}],"paus":[{"classes/pvrplatformStateMachine.html":"5"},{"files/Shell.html":"1"}],"pausedemo":[{"PVRShell_intro.html":"1"}],"per":[{"classes/pvrplatformShell.html":"6"},{"PVRShell_intro.html":"3"}],"period":[{"classes/pvrplatformShell.html":"1"},{"files/Shell.html":"1"}],"pixel":[{"classes/pvrplatformShell.html":"6"},{"PVRShell_intro.html":"3"}],"platform":[{"classes/pvrplatformShellOS.html":"53"},{"classes/pvrplatformShellOSCapabilities.html":"44"},{"classes/pvrplatform.html":"40"},{"classes/pvrplatformShell.html":"40"},{"files/OS/Linux/InternalOS.html":"39"},{"classes/pvrplatformStateMachine.html":"30"},{"classes/pvrplatformInternalOS.html":"29"},{"classes/pvrplatformSpecialKeyCode.html":"29"},{"classes/pvrplatformShellEvent.html":"28"},{"classes/pvrplatformShellData.html":"27"},{"classes/pvrplatformShellEventunion.html":"27"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"27"},{"classes/pvrplatformShellPointingDeviceState.html":"27"},{"classes/pvrplatformShellPrivatePointerState.html":"27"},{"classes/pvrplatformWindowsOSData.html":"27"},{"files/OS/ShellOS.html":"25"},{"PVRShell_classes.html":"15"},{"files/Shell.html":"9"},{"PVRShell_intro.html":"7"},{"PVRShell_files.html":"6"},{"files/OS/Windows/WindowsOSData.html":"6"},{"files/OS/AppKit/ViewMTL.html":"5"},{"files/StateMachine.html":"5"},{"files/ShellData.html":"4"},{"files/EntryPoint/NSApplicationMain/AppController.html":"3"},{"files/EntryPoint/UIApplicationMain/AppController.html":"3"},{"files/PVRShell.html":"3"},{"classes/pvr.html":"1"}],"point":[{"classes/pvrplatformShellPointingDeviceState.html":"18"},{"files/EntryPoint/NSApplicationMain/AppController.html":"16"},{"classes/pvrplatformShell.html":"4"},{"classes/pvrplatformStateMachine.html":"3"},{"PVRShell_intro.html":"2"},{"PVRShell_classes.html":"1"},{"PVRShell_files.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"files/Shell.html":"1"}],"pointer":[{"classes/pvrPointerLocation.html":"16"},{"classes/pvrPointerLocationStore.html":"16"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"16"},{"classes/pvrplatformShell.html":"4"},{"PVRShell_classes.html":"3"},{"files/Shell.html":"3"},{"classes/pvr.html":"2"},{"classes/pvrplatformShellPointingDeviceState.html":"2"},{"classes/pvrplatformStateMachine.html":"1"}],"pointerloc":[{"classes/pvrPointerLocation.html":"30"},{"classes/pvrplatformShell.html":"6"},{"classes/pvrplatformShellPointingDeviceState.html":"5"},{"classes/pvrplatformShellPrivatePointerState.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvr.html":"1"},{"files/Shell.html":"1"}],"pointerlocationstor":[{"classes/pvrPointerLocationStore.html":"37"},{"PVRShell_classes.html":"1"},{"classes/pvr.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"files/Shell.html":"1"}],"pointernormalisedloc":[{"classes/pvrplatformShellPointerNormalisedLocation.html":"28"},{"classes/pvrplatformShell.html":"2"},{"PVRShell_classes.html":"1"},{"files/Shell.html":"1"}],"pointerst":[{"classes/pvrplatformShell.html":"1"}],"pointingdevicedown":[{"classes/pvrplatformShellEvent.html":"1"}],"pointingdevicemov":[{"classes/pvrplatformShellEvent.html":"1"}],"pointingdevicest":[{"classes/pvrplatformShellPointingDeviceState.html":"28"},{"classes/pvrplatformShell.html":"2"},{"PVRShell_classes.html":"1"},{"files/Shell.html":"1"}],"pointingdeviceup":[{"classes/pvrplatformShellEvent.html":"1"}],"pop":[{"classes/pvrplatformShellOS.html":"1"}],"popupmessag":[{"classes/pvrplatformShellOS.html":"1"}],"portrait":[{"classes/pvrplatformShell.html":"1"}],"posi":[{"PVRShell_intro.html":"1"}],"posit":[{"classes/pvrplatformShell.html":"4"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"posx":[{"PVRShell_intro.html":"1"}],"potenti":[{"classes/pvrplatformShell.html":"1"}],"power":[{"classes/pvrplatformShellData.html":"16"},{"PVRShell_classes.html":"1"},{"PVRShell_intro.html":"1"},{"classes/pvrplatform.html":"1"},{"files/Shell.html":"1"},{"files/ShellData.html":"1"}],"powersav":[{"PVRShell_intro.html":"1"}],"powervr":[{"files/StateMachine.html":"18"},{"classes/pvrplatformShell.html":"17"},{"classes/pvrplatformStateMachine.html":"17"},{"files/ShellData.html":"17"},{"PVRShell_intro.html":"16"},{"PVRShell_files.html":"4"},{"classes/pvrplatform.html":"3"},{"PVRShell_classes.html":"2"},{"files/Shell.html":"2"},{"classes/pvrplatformShellData.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/PVRShell.html":"1"}],"preexit":[{"classes/pvrplatformStateMachine.html":"1"}],"prefer":[{"PVRShell_intro.html":"1"}],"press":[{"classes/pvrplatformShell.html":"6"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"}],"print":[{"classes/pvrplatformShell.html":"2"}],"printf":[{"classes/pvrplatformShell.html":"6"}],"printscreen":[{"files/Shell.html":"1"}],"prioriti":[{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"2"}],"privat":[{"classes/pvrplatformInternalOS.html":"16"},{"classes/pvrplatformShell.html":"16"},{"classes/pvrplatformStateMachine.html":"16"},{"classes/pvrplatformShellOS.html":"8"}],"privatepointerst":[{"classes/pvrplatformShellPrivatePointerState.html":"27"},{"classes/pvrplatformShell.html":"2"},{"PVRShell_classes.html":"1"},{"files/Shell.html":"1"}],"processshellev":[{"classes/pvrplatformShell.html":"1"}],"project":[{"PVRShell_intro.html":"2"}],"properti":[{"classes/pvrplatformShellOS.html":"24"},{"classes/pvrConfigureEvent.html":"8"},{"classes/pvrPointerLocationStore.html":"8"},{"classes/pvrplatformInternalOS.html":"8"},{"classes/pvrplatformShell.html":"8"},{"classes/pvrplatformShellData.html":"8"},{"classes/pvrplatformShellEvent.html":"8"},{"classes/pvrplatformShellEventunion.html":"8"},{"classes/pvrplatformShellOSCapabilities.html":"8"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"8"},{"classes/pvrplatformShellPointingDeviceState.html":"8"},{"classes/pvrplatformSpecialKeyCode.html":"8"},{"classes/pvrplatformStateMachine.html":"8"},{"classes/pvrplatformWindowsOSData.html":"8"}],"protect":[{"classes/pvrplatformShell.html":"8"},{"classes/pvrplatformShellOS.html":"8"},{"classes/pvrplatformShellPointingDeviceState.html":"8"}],"provid":[{"classes/pvrplatformStateMachine.html":"16"},{"PVRShell_intro.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrplatform.html":"1"},{"classes/pvrplatformShell.html":"1"},{"files/StateMachine.html":"1"}],"providedd":[{"classes/pvrplatformShell.html":"1"}],"ps":[{"PVRShell_intro.html":"1"}],"ptr":[{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformShellOS.html":"2"},{"classes/pvrplatformInternalOS.html":"1"},{"files/Shell.html":"1"}],"public":[{"classes/pvrPointerLocationStore.html":"16"},{"classes/pvrplatformShellData.html":"16"},{"classes/pvrplatformShellEvent.html":"16"},{"classes/pvrplatformShellOS.html":"16"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"16"},{"classes/pvrplatformStateMachine.html":"16"},{"classes/pvrplatformWindowsOSData.html":"16"},{"classes/pvrConfigureEvent.html":"8"},{"classes/pvrPointerLocation.html":"8"},{"classes/pvrplatformInternalOS.html":"8"},{"classes/pvrplatformShell.html":"8"},{"classes/pvrplatformShellEventunion.html":"8"},{"classes/pvrplatformShellOSCapabilities.html":"8"},{"classes/pvrplatformShellPointingDeviceState.html":"8"},{"classes/pvrplatformShellPrivatePointerState.html":"8"},{"classes/pvrplatformSpecialKeyCode.html":"8"}],"pure":[{"PVRShell_intro.html":"1"}],"pvr":[{"classes/pvrplatformShell.html":"49"},{"classes/pvrplatformShellOS.html":"44"},{"classes/pvrplatform.html":"43"},{"classes/pvrplatformShellData.html":"43"},{"files/Shell.html":"32"},{"classes/pvr.html":"31"},{"classes/pvrplatformShellEvent.html":"29"},{"classes/pvrplatformShellEventunion.html":"29"},{"classes/pvrConfigureEvent.html":"28"},{"classes/pvrPointerLocation.html":"28"},{"classes/pvrPointerLocationStore.html":"28"},{"classes/pvrplatformInternalOS.html":"28"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"28"},{"classes/pvrplatformShellPointingDeviceState.html":"28"},{"classes/pvrplatformShellPrivatePointerState.html":"28"},{"classes/pvrplatformSpecialKeyCode.html":"28"},{"classes/pvrplatformShellOSCapabilities.html":"27"},{"classes/pvrplatformStateMachine.html":"27"},{"classes/pvrplatformWindowsOSData.html":"27"},{"files/OS/Linux/InternalOS.html":"25"},{"PVRShell_classes.html":"19"},{"PVRShell_intro.html":"14"},{"files/OS/ShellOS.html":"10"},{"files/OS/Windows/WindowsOSData.html":"8"},{"files/OS/AppKit/ViewMTL.html":"7"},{"files/ShellData.html":"7"},{"files/StateMachine.html":"7"},{"files/EntryPoint/NSApplicationMain/AppController.html":"5"},{"files/EntryPoint/UIApplicationMain/AppController.html":"5"},{"files/PVRShell.html":"5"},{"PVRShell_files.html":"4"}],"pvrcore":[{"PVRShell_intro.html":"1"}],"pvrshell":[{"PVRShell_intro.html":"65"},{"PVRShell_classes.html":"43"},{"files/PVRShell.html":"43"},{"PVRShell_files.html":"33"},{"files/OS/Windows/WindowsOSData.html":"17"},{"classes/pvrplatformShellOS.html":"16"},{"files/EntryPoint/NSApplicationMain/AppController.html":"16"},{"classes/pvrplatform.html":"2"},{"files/OS/ShellOS.html":"2"},{"classes/pvrplatformWindowsOSData.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"}],"pvrshellgettim":[{"PVRShell_intro.html":"1"}],"q":[{"files/Shell.html":"1"}],"qaf":[{"PVRShell_intro.html":"1"}],"qat":[{"PVRShell_intro.html":"1"}],"queri":[{"classes/pvrplatformShell.html":"6"},{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"queue":[{"classes/pvrplatformShell.html":"1"}],"quit":[{"classes/pvrplatformShell.html":"6"},{"PVRShell_intro.html":"3"},{"files/Shell.html":"1"}],"quitafterfram":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"quitaftertim":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"quitappl":[{"PVRShell_intro.html":"2"},{"classes/pvrplatformStateMachine.html":"2"},{"classes/pvrplatformShell.html":"1"}],"quot":[{"files/Shell.html":"1"}],"r":[{"classes/pvrplatformShell.html":"2"},{"files/Shell.html":"1"}],"rang":[{"PVRShell_intro.html":"2"}],"raw":[{"classes/pvrplatformShell.html":"2"}],"rc":[{"PVRShell_intro.html":"1"}],"reach":[{"classes/pvrplatformStateMachine.html":"3"}],"read":[{"classes/pvrplatformShellOS.html":"6"},{"classes/pvrplatformShell.html":"5"}],"readapifromcommandlin":[{"classes/pvrplatformStateMachine.html":"1"}],"readpath":[{"classes/pvrplatformShellOS.html":"3"},{"classes/pvrplatformShell.html":"2"}],"real":[{"classes/pvrplatformShell.html":"2"}],"recommend":[{"PVRShell_intro.html":"1"}],"record":[{"classes/pvrplatformShell.html":"1"}],"recreat":[{"PVRShell_intro.html":"1"}],"red":[{"classes/pvrplatformShell.html":"1"}],"refer":[{"files/EntryPoint/NSApplicationMain/AppController.html":"27"},{"files/EntryPoint/UIApplicationMain/AppController.html":"27"},{"files/OS/AppKit/ViewMTL.html":"27"},{"files/OS/Linux/InternalOS.html":"27"},{"files/OS/ShellOS.html":"27"},{"files/OS/Windows/WindowsOSData.html":"27"},{"files/PVRShell.html":"27"},{"files/Shell.html":"27"},{"files/ShellData.html":"27"},{"files/StateMachine.html":"27"},{"PVRShell_intro.html":"1"}],"relat":[{"classes/pvrplatformShell.html":"1"}],"releas":[{"classes/pvrplatformShell.html":"4"},{"PVRShell_intro.html":"3"},{"classes/pvrplatformShellOS.html":"1"}],"releaseview":[{"PVRShell_intro.html":"3"},{"classes/pvrplatformShell.html":"3"},{"classes/pvrplatformStateMachine.html":"1"}],"releasewindow":[{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformStateMachine.html":"1"}],"render":[{"PVRShell_intro.html":"1"}],"renderfram":[{"classes/pvrplatformShell.html":"6"},{"PVRShell_intro.html":"4"},{"classes/pvrplatformStateMachine.html":"1"}],"replic":[{"PVRShell_intro.html":"1"}],"report":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"repres":[{"classes/pvrplatformShell.html":"3"}],"request":[{"classes/pvrplatformShell.html":"7"},{"classes/pvrplatformStateMachine.html":"1"}],"requir":[{"files/OS/Windows/WindowsOSData.html":"16"},{"PVRShell_files.html":"2"},{"PVRShell_intro.html":"2"},{"classes/pvrplatformWindowsOSData.html":"1"}],"resiz":[{"classes/pvrConfigureEvent.html":"16"},{"PVRShell_classes.html":"1"},{"classes/pvr.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"files/Shell.html":"1"}],"resolut":[{"classes/pvrplatformShell.html":"3"}],"resourc":[{"PVRShell_intro.html":"3"},{"classes/pvrplatformShell.html":"1"}],"result":[{"classes/pvrplatformStateMachine.html":"15"},{"classes/pvrplatformShell.html":"12"},{"PVRShell_intro.html":"1"}],"resum":[{"classes/pvrplatformStateMachine.html":"2"}],"retriev":[{"classes/pvrplatformShellOS.html":"11"}],"return":[{"classes/pvrplatformShell.html":"14"},{"PVRShell_intro.html":"2"},{"classes/pvrplatformInternalOS.html":"2"},{"classes/pvrplatformStateMachine.html":"2"},{"files/Shell.html":"2"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShellData.html":"1"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformWindowsOSData.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/StateMachine.html":"1"}],"rgb":[{"classes/pvrplatformShell.html":"2"}],"rhs":[{"classes/pvrPointerLocationStore.html":"8"}],"right":[{"files/Shell.html":"2"},{"PVRShell_intro.html":"1"}],"rmb":[{"classes/pvrplatformShell.html":"5"}],"rotat":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"1"}],"rotatekey":[{"PVRShell_intro.html":"1"}],"rule":[{"classes/pvrplatformShell.html":"2"}],"run":[{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"}],"s":[{"classes/pvrplatformStateMachine.html":"1"},{"files/Shell.html":"1"}],"sampl":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"1"}],"save":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"2"}],"scale":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"screen":[{"classes/pvrplatformShellPointingDeviceState.html":"16"},{"classes/pvrplatformShell.html":"10"},{"PVRShell_intro.html":"2"},{"PVRShell_classes.html":"1"},{"files/Shell.html":"1"}],"screenshot":[{"classes/pvrplatformShell.html":"7"},{"PVRShell_intro.html":"2"}],"screenshotscal":[{"PVRShell_intro.html":"1"}],"scrolllock":[{"files/Shell.html":"1"}],"sdk":[{"PVRShell_intro.html":"18"},{"classes/pvrplatformShell.html":"2"}],"search":[{"PVRShell_intro.html":"1"}],"second":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"1"}],"see":[{"files/Shell.html":"16"},{"PVRShell_files.html":"2"},{"classes/pvrplatformShell.html":"2"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"}],"semicolon":[{"files/Shell.html":"1"}],"set":[{"classes/pvrplatformShell.html":"33"},{"PVRShell_intro.html":"8"},{"classes/pvrplatformShellOS.html":"6"}],"setaasampl":[{"classes/pvrplatformShell.html":"1"}],"setapityperequir":[{"PVRShell_intro.html":"1"}],"setapplicationnam":[{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformShellOS.html":"1"}],"setbackbuffercolorspac":[{"classes/pvrplatformShell.html":"1"}],"setbutton":[{"classes/pvrplatformShellPrivatePointerState.html":"1"}],"setcapturefram":[{"classes/pvrplatformShell.html":"1"}],"setcaptureframescal":[{"classes/pvrplatformShell.html":"1"}],"setcolorbitsperpixel":[{"classes/pvrplatformShell.html":"1"}],"setcontextprior":[{"classes/pvrplatformShell.html":"1"}],"setdepthbitsperpixel":[{"classes/pvrplatformShell.html":"1"}],"setdesiredconfig":[{"classes/pvrplatformShell.html":"2"}],"setdimens":[{"classes/pvrplatformShell.html":"1"}],"setexitmessag":[{"classes/pvrplatformShell.html":"1"}],"setfakeframetim":[{"classes/pvrplatformShell.html":"1"}],"setforceframetim":[{"classes/pvrplatformShell.html":"1"}],"setfullscreen":[{"classes/pvrplatformShell.html":"1"}],"setisiniti":[{"classes/pvrplatformInternalOS.html":"1"}],"setkeypressedv":[{"classes/pvrplatformShell.html":"1"}],"setpointerloc":[{"classes/pvrplatformShellPrivatePointerState.html":"1"}],"setposit":[{"classes/pvrplatformShell.html":"1"}],"setpreferredswapchainlength":[{"classes/pvrplatformShell.html":"1"}],"setquitafterfram":[{"classes/pvrplatformShell.html":"1"}],"setquitaftertim":[{"classes/pvrplatformShell.html":"1"}],"setshowfp":[{"classes/pvrplatformShell.html":"1"}],"setstencilbitsperpixel":[{"classes/pvrplatformShell.html":"1"}],"settitl":[{"classes/pvrplatformShell.html":"1"}],"setup":[{"PVRShell_intro.html":"1"}],"setvsyncmod":[{"classes/pvrplatformShell.html":"1"}],"setwritepath":[{"classes/pvrplatformShellOS.html":"1"}],"shell":[{"classes/pvrplatformShell.html":"84"},{"files/Shell.html":"53"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"29"},{"classes/pvrplatformShellPointingDeviceState.html":"29"},{"classes/pvrplatformShellPrivatePointerState.html":"29"},{"classes/pvrplatformShellOS.html":"22"},{"files/ShellData.html":"20"},{"files/StateMachine.html":"20"},{"files/EntryPoint/UIApplicationMain/AppController.html":"19"},{"classes/pvrplatformShellData.html":"17"},{"classes/pvrplatformStateMachine.html":"17"},{"PVRShell_intro.html":"10"},{"classes/pvrplatform.html":"10"},{"PVRShell_classes.html":"9"},{"PVRShell_files.html":"8"},{"files/OS/ShellOS.html":"5"},{"files/OS/AppKit/ViewMTL.html":"4"},{"files/OS/Linux/InternalOS.html":"4"},{"files/OS/Windows/WindowsOSData.html":"4"},{"files/EntryPoint/NSApplicationMain/AppController.html":"3"},{"files/PVRShell.html":"3"},{"classes/pvrConfigureEvent.html":"2"},{"classes/pvrPointerLocation.html":"2"},{"classes/pvrPointerLocationStore.html":"2"},{"classes/pvrplatformInternalOS.html":"2"},{"classes/pvrplatformShellEvent.html":"2"},{"classes/pvrplatformShellEventunion.html":"2"}],"shelldata":[{"classes/pvrplatformShellData.html":"29"},{"files/ShellData.html":"28"},{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformShellOS.html":"2"},{"PVRShell_classes.html":"1"},{"PVRShell_files.html":"1"},{"classes/pvrplatform.html":"1"}],"shellev":[{"classes/pvrplatformShellEvent.html":"28"},{"classes/pvrplatformShellEventunion.html":"27"},{"files/Shell.html":"3"},{"PVRShell_classes.html":"2"},{"classes/pvrplatform.html":"2"},{"classes/pvrplatformShell.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/PVRShell.html":"1"},{"files/ShellData.html":"1"},{"files/StateMachine.html":"1"}],"shelleventtyp":[{"classes/pvrplatformShellEvent.html":"2"}],"shellinitappl":[{"classes/pvrplatformShell.html":"1"}],"shellinitview":[{"classes/pvrplatformShell.html":"1"}],"shello":[{"files/OS/ShellOS.html":"46"},{"classes/pvrplatformShellOS.html":"32"},{"classes/pvrplatformShellOSCapabilities.html":"29"},{"classes/pvrplatformInternalOS.html":"6"},{"PVRShell_files.html":"3"},{"PVRShell_classes.html":"2"},{"classes/pvrplatform.html":"2"},{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformShellData.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"}],"shellquitappl":[{"classes/pvrplatformShell.html":"1"}],"shellreleaseview":[{"classes/pvrplatformShell.html":"1"}],"shellrenderfram":[{"classes/pvrplatformShell.html":"1"}],"shift":[{"files/Shell.html":"1"}],"should":[{"classes/pvrplatformShell.html":"1"}],"shouldtakescreenshot":[{"classes/pvrplatformShell.html":"1"}],"showexitdialogu":[{"PVRShell_intro.html":"1"}],"showfp":[{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformShellData.html":"1"}],"showoutputinfo":[{"classes/pvrplatformShell.html":"1"}],"showpreviouspag":[{"PVRShell_intro.html":"1"}],"signifi":[{"classes/pvrplatformShell.html":"7"}],"simpl":[{"PVRShell_intro.html":"1"}],"simplifi":[{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"1"}],"simplifiedinput":[{"classes/pvrplatformShell.html":"3"},{"PVRShell_intro.html":"1"},{"files/Shell.html":"1"}],"sinc":[{"classes/pvrplatformShell.html":"1"}],"singl":[{"PVRShell_intro.html":"1"}],"size":[{"PVRShell_intro.html":"4"},{"classes/pvrplatformShell.html":"1"}],"skip":[{"classes/pvrplatformShell.html":"1"}],"slash":[{"files/Shell.html":"1"}],"small":[{"classes/pvrplatformShell.html":"1"}],"so":[{"PVRShell_intro.html":"2"}],"softwar":[{"PVRShell_intro.html":"1"}],"some":[{"classes/pvrplatformShell.html":"1"}],"sourc":[{"PVRShell_intro.html":"1"},{"classes/pvrPointerLocation.html":"1"}],"space":[{"files/Shell.html":"1"}],"specialkeycod":[{"classes/pvrplatformSpecialKeyCode.html":"27"},{"PVRShell_classes.html":"1"},{"classes/pvrplatform.html":"1"},{"files/OS/Linux/InternalOS.html":"1"}],"specif":[{"classes/pvrplatformWindowsOSData.html":"16"},{"files/OS/Linux/InternalOS.html":"16"},{"files/OS/ShellOS.html":"16"},{"classes/pvrplatformShellOS.html":"13"},{"classes/pvrplatformShell.html":"5"},{"PVRShell_files.html":"4"},{"PVRShell_intro.html":"2"},{"classes/pvrplatformStateMachine.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrplatform.html":"1"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformSpecialKeyCode.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"}],"specifi":[{"PVRShell_intro.html":"3"},{"classes/pvrplatformShellOS.html":"2"},{"classes/pvrplatformShell.html":"1"}],"squarebracketleft":[{"files/Shell.html":"1"}],"squarebracketright":[{"files/Shell.html":"1"}],"srgb":[{"classes/pvrplatformShell.html":"3"}],"st":[{"classes/pvrPointerLocation.html":"2"}],"start":[{"classes/pvrplatformShell.html":"7"},{"classes/pvrplatformShellPointingDeviceState.html":"2"},{"PVRShell_intro.html":"1"}],"startdrag":[{"classes/pvrplatformShellPrivatePointerState.html":"1"}],"starttim":[{"classes/pvrplatformShellData.html":"1"}],"state":[{"classes/pvrplatformStateMachine.html":"27"},{"classes/pvrplatformShellPointingDeviceState.html":"16"},{"classes/pvrplatformShell.html":"2"},{"PVRShell_classes.html":"1"},{"files/Shell.html":"1"},{"files/StateMachine.html":"1"}],"stateappinitialis":[{"classes/pvrplatformStateMachine.html":"1"}],"stateinitialis":[{"classes/pvrplatformStateMachine.html":"1"}],"statemachin":[{"classes/pvrplatformStateMachine.html":"49"},{"files/StateMachine.html":"46"},{"PVRShell_files.html":"3"},{"PVRShell_classes.html":"2"},{"classes/pvrplatform.html":"2"},{"classes/pvrplatformShell.html":"1"}],"statereadi":[{"classes/pvrplatformStateMachine.html":"1"}],"stateuninitialis":[{"classes/pvrplatformStateMachine.html":"1"}],"statewindowinitialis":[{"classes/pvrplatformStateMachine.html":"1"}],"static":[{"classes/pvrplatformShellOS.html":"2"},{"classes/pvrplatformShell.html":"1"}],"std":[{"classes/pvrplatformShell.html":"17"},{"classes/pvrplatformShellOS.html":"14"},{"files/Shell.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformShellData.html":"1"},{"files/StateMachine.html":"1"}],"stencil":[{"classes/pvrplatformShell.html":"3"}],"step":[{"PVRShell_intro.html":"4"},{"classes/pvrplatformStateMachine.html":"2"}],"stop":[{"classes/pvrplatformShell.html":"3"}],"storag":[{"classes/pvrPointerLocationStore.html":"16"},{"PVRShell_classes.html":"1"},{"PVRShell_intro.html":"1"},{"classes/pvr.html":"1"},{"files/Shell.html":"1"}],"store":[{"classes/pvrplatformShellEventunion.html":"16"},{"classes/pvrplatformShell.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"files/Shell.html":"1"}],"str":[{"classes/pvrplatformSpecialKeyCode.html":"1"}],"stream":[{"classes/pvrplatformShell.html":"6"}],"string":[{"classes/pvrplatformShell.html":"12"},{"classes/pvrplatformShellOS.html":"10"},{"files/Shell.html":"2"},{"files/StateMachine.html":"2"},{"classes/pvrplatformShellData.html":"1"}],"struct":[{"PVRShell_classes.html":"10"},{"files/Shell.html":"6"},{"classes/pvrplatform.html":"4"},{"classes/pvrplatformShell.html":"3"},{"classes/pvr.html":"2"},{"classes/pvrplatformShellOS.html":"2"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/ShellData.html":"1"}],"structur":[{"classes/pvrPointerLocationStore.html":"16"},{"PVRShell_classes.html":"1"},{"classes/pvr.html":"1"},{"files/Shell.html":"1"}],"style":[{"classes/pvrplatformShell.html":"6"}],"success":[{"classes/pvrplatformShell.html":"1"}],"support":[{"classes/pvrplatformShell.html":"6"}],"sw":[{"PVRShell_intro.html":"1"}],"swap":[{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"2"}],"swapchainlength":[{"classes/pvrplatformShell.html":"2"}],"swipe":[{"PVRShell_intro.html":"1"}],"switch":[{"PVRShell_intro.html":"1"}],"sync":[{"classes/pvrplatformShell.html":"1"}],"syncchron":[{"classes/pvrplatformShell.html":"1"}],"synchron":[{"classes/pvrplatformShell.html":"1"}],"system":[{"classes/pvrplatformShellEvent.html":"16"},{"PVRShell_intro.html":"4"},{"classes/pvrplatform.html":"2"},{"files/Shell.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShell.html":"1"},{"classes/pvrplatformStateMachine.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/PVRShell.html":"1"},{"files/ShellData.html":"1"},{"files/StateMachine.html":"1"}],"systemev":[{"classes/pvrplatformShell.html":"5"},{"files/Shell.html":"4"},{"classes/pvrplatformShellEventunion.html":"2"},{"classes/pvrplatformShellEvent.html":"1"}],"systemkeyon":[{"files/Shell.html":"1"}],"systemkeyto":[{"files/Shell.html":"1"}],"t":[{"classes/pvrplatformShell.html":"43"},{"classes/pvrplatformShellData.html":"10"},{"classes/pvrPointerLocation.html":"2"},{"classes/pvrPointerLocationStore.html":"2"},{"classes/pvrplatformShellPointingDeviceState.html":"2"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"files/Shell.html":"1"}],"tab":[{"files/Shell.html":"1"}],"tabl":[{"PVRShell_intro.html":"1"}],"take":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"teardown":[{"PVRShell_intro.html":"3"},{"classes/pvrplatformStateMachine.html":"1"}],"termin":[{"files/EntryPoint/NSApplicationMain/AppController.html":"1"}],"textur":[{"PVRShell_intro.html":"3"}],"tga":[{"classes/pvrplatformShell.html":"1"}],"th":[{"classes/pvrplatformShell.html":"1"}],"that":[{"classes/pvrplatformStateMachine.html":"2"},{"classes/pvrplatformShell.html":"1"}],"the":[{"classes/pvrplatformShell.html":"98"},{"PVRShell_intro.html":"36"},{"classes/pvrplatformShellOS.html":"36"},{"files/EntryPoint/NSApplicationMain/AppController.html":"34"},{"files/OS/ShellOS.html":"22"},{"files/Shell.html":"21"},{"files/OS/Windows/WindowsOSData.html":"20"},{"files/EntryPoint/UIApplicationMain/AppController.html":"18"},{"files/ShellData.html":"18"},{"classes/pvrPointerLocationStore.html":"17"},{"classes/pvrplatformStateMachine.html":"16"},{"PVRShell_files.html":"11"},{"classes/pvrplatform.html":"8"},{"PVRShell_classes.html":"5"},{"classes/pvrplatformShellPointingDeviceState.html":"5"},{"files/OS/AppKit/ViewMTL.html":"4"},{"files/OS/Linux/InternalOS.html":"4"},{"files/PVRShell.html":"2"},{"files/StateMachine.html":"2"},{"classes/pvr.html":"1"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrplatformShellData.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformWindowsOSData.html":"1"}],"then":[{"classes/pvrplatformShell.html":"4"}],"this":[{"classes/pvrplatformShell.html":"12"}],"time":[{"classes/pvrplatformShell.html":"16"},{"PVRShell_intro.html":"2"},{"classes/pvrplatformShellData.html":"1"}],"timeatinitappl":[{"classes/pvrplatformShellData.html":"1"}],"timer":[{"classes/pvrplatformShellData.html":"1"}],"titl":[{"classes/pvrplatformShellOS.html":"3"},{"classes/pvrplatformShell.html":"1"}],"to":[{"classes/pvrplatformShell.html":"3"},{"classes/pvrplatformShellPointingDeviceState.html":"1"}],"top":[{"classes/pvrplatformShell.html":"2"}],"total":[{"classes/pvrplatformShell.html":"2"}],"touch":[{"classes/pvrplatformShellPointingDeviceState.html":"16"},{"classes/pvrplatformShell.html":"6"},{"PVRShell_classes.html":"1"},{"PVRShell_intro.html":"1"},{"files/Shell.html":"1"}],"touchscreen":[{"classes/pvrplatformShell.html":"5"},{"PVRShell_intro.html":"1"}],"touchscreend":[{"classes/pvrplatformShell.html":"1"}],"track":[{"classes/pvrplatformShellData.html":"16"},{"PVRShell_classes.html":"1"},{"classes/pvrplatform.html":"1"},{"files/ShellData.html":"1"}],"trappointerondrag":[{"classes/pvrplatformShellData.html":"1"}],"tri":[{"classes/pvrplatformShell.html":"2"}],"true":[{"classes/pvrplatformShell.html":"5"}],"truncateifexist":[{"classes/pvrplatformShell.html":"2"}],"type":[{"classes/pvrplatformShellEventunion.html":"17"},{"classes/pvrplatformShell.html":"8"},{"classes/pvrplatformShellOS.html":"5"},{"classes/pvrplatformShellEvent.html":"4"},{"classes/pvrplatformInternalOS.html":"3"},{"classes/pvrplatformStateMachine.html":"3"},{"files/Shell.html":"3"},{"PVRShell_classes.html":"2"},{"classes/pvrPointerLocationStore.html":"2"},{"classes/pvrplatformShellData.html":"2"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"2"},{"classes/pvrplatformShellPointingDeviceState.html":"2"},{"classes/pvrplatformWindowsOSData.html":"2"},{"files/StateMachine.html":"2"},{"classes/pvr.html":"1"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrplatform.html":"1"},{"classes/pvrplatformShellOSCapabilities.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformSpecialKeyCode.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/ShellData.html":"1"}],"u":[{"files/Shell.html":"1"}],"uiapplic":[{"files/EntryPoint/UIApplicationMain/AppController.html":"16"},{"PVRShell_files.html":"1"}],"uiapplicationmain":[{"files/UIApplicationMain_dir.html":"27"}],"uikit":[{"files/EntryPoint/UIApplicationMain/AppController.html":"16"},{"PVRShell_files.html":"1"}],"uint":[{"classes/pvrplatformShell.html":"41"},{"classes/pvrplatformShellData.html":"6"},{"classes/pvrplatformInternalOS.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"}],"undefin":[{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"}],"under":[{"classes/pvrplatformShell.html":"3"}],"unifi":[{"classes/pvrplatformShell.html":"2"},{"PVRShell_intro.html":"1"}],"union":[{"classes/pvrplatformShellEventunion.html":"43"},{"classes/pvrplatformShellEvent.html":"4"},{"PVRShell_classes.html":"3"},{"files/Shell.html":"3"}],"uniqu":[{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformShellOS.html":"2"},{"classes/pvrplatformInternalOS.html":"1"},{"files/Shell.html":"1"}],"unknown":[{"files/Shell.html":"1"}],"unnam":[{"classes/pvrplatformShellEventunion.html":"16"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"files/Shell.html":"1"}],"unset":[{"classes/pvrplatformShell.html":"1"}],"unsign":[{"classes/pvrplatformShellPointerNormalisedLocation.html":"16"},{"classes/pvrplatformInternalOS.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrplatformShell.html":"1"},{"files/Shell.html":"1"}],"updat":[{"classes/pvrplatformShellOS.html":"1"}],"updatepointerposit":[{"classes/pvrplatformShell.html":"1"}],"updatepointingdeviceloc":[{"classes/pvrplatformShellOS.html":"1"}],"upon":[{"PVRShell_intro.html":"1"}],"upscal":[{"classes/pvrplatformShell.html":"3"}],"use":[{"classes/pvrplatformShellOS.html":"33"},{"classes/pvrplatformShell.html":"25"},{"files/PVRShell.html":"16"},{"PVRShell_intro.html":"15"},{"classes/pvrplatform.html":"4"},{"files/OS/ShellOS.html":"4"},{"PVRShell_classes.html":"2"},{"PVRShell_files.html":"2"},{"files/OS/AppKit/ViewMTL.html":"2"},{"files/OS/Linux/InternalOS.html":"2"},{"files/OS/Windows/WindowsOSData.html":"2"}],"user":[{"classes/pvrplatformShell.html":"19"},{"files/Shell.html":"18"},{"PVRShell_files.html":"2"},{"classes/pvrplatform.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformStateMachine.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/PVRShell.html":"1"},{"files/ShellData.html":"1"},{"files/StateMachine.html":"1"}],"usual":[{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"v":[{"files/Shell.html":"1"}],"val":[{"classes/pvrplatformShell.html":"1"}],"valu":[{"files/Shell.html":"116"},{"classes/pvrplatformShell.html":"22"},{"classes/pvrplatformShellEvent.html":"7"},{"classes/pvrplatformStateMachine.html":"6"},{"PVRShell_intro.html":"2"},{"classes/pvrplatformShellOS.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"}],"variabl":[{"classes/pvrplatformShell.html":"3"}],"vector":[{"classes/pvrplatformShellOS.html":"2"},{"classes/pvrplatformShell.html":"1"}],"version":[{"files/OS/Windows/WindowsOSData.html":"16"},{"PVRShell_files.html":"2"},{"PVRShell_intro.html":"2"},{"classes/pvrplatformShell.html":"2"},{"classes/pvrplatformWindowsOSData.html":"1"}],"vertic":[{"classes/pvrplatformShell.html":"4"}],"viewmtl":[{"files/OS/AppKit/ViewMTL.html":"28"},{"PVRShell_files.html":"1"}],"viewport":[{"PVRShell_intro.html":"4"}],"virtual":[{"PVRShell_intro.html":"1"}],"void":[{"classes/pvrplatformShell.html":"49"},{"classes/pvrplatformShellOS.html":"8"},{"classes/pvrplatformStateMachine.html":"7"},{"classes/pvrplatformShellPrivatePointerState.html":"4"},{"PVRShell_intro.html":"3"},{"classes/pvrPointerLocation.html":"3"},{"classes/pvrplatformInternalOS.html":"3"},{"classes/pvrPointerLocationStore.html":"2"},{"files/EntryPoint/NSApplicationMain/AppController.html":"2"},{"classes/pvrplatformShellData.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformWindowsOSData.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"}],"vsync":[{"PVRShell_intro.html":"5"}],"vsyncmod":[{"classes/pvrplatformShell.html":"2"}],"w":[{"classes/pvrplatformShell.html":"2"},{"files/Shell.html":"1"}],"wearedon":[{"classes/pvrplatformShellData.html":"1"}],"whether":[{"classes/pvrplatformShell.html":"3"},{"classes/pvrplatformShellOS.html":"1"}],"which":[{"classes/pvrplatformShell.html":"6"},{"PVRShell_intro.html":"2"}],"width":[{"classes/pvrplatformShell.html":"6"},{"PVRShell_intro.html":"2"},{"classes/pvrConfigureEvent.html":"2"}],"will":[{"classes/pvrplatformShell.html":"32"},{"files/Shell.html":"18"},{"PVRShell_intro.html":"7"},{"PVRShell_files.html":"2"},{"classes/pvrplatform.html":"2"},{"classes/pvrplatformShellOS.html":"2"},{"PVRShell_classes.html":"1"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocation.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShellEvent.html":"1"},{"classes/pvrplatformShellEventunion.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"classes/pvrplatformShellPointingDeviceState.html":"1"},{"classes/pvrplatformShellPrivatePointerState.html":"1"},{"classes/pvrplatformStateMachine.html":"1"},{"files/EntryPoint/NSApplicationMain/AppController.html":"1"},{"files/EntryPoint/UIApplicationMain/AppController.html":"1"},{"files/OS/AppKit/ViewMTL.html":"1"},{"files/OS/Linux/InternalOS.html":"1"},{"files/OS/ShellOS.html":"1"},{"files/OS/Windows/WindowsOSData.html":"1"},{"files/PVRShell.html":"1"},{"files/ShellData.html":"1"},{"files/StateMachine.html":"1"}],"window":[{"files/Windows_dir.html":"27"},{"classes/pvrplatformShell.html":"19"},{"classes/pvrplatformWindowsOSData.html":"17"},{"files/OS/Windows/WindowsOSData.html":"17"},{"classes/pvrConfigureEvent.html":"16"},{"PVRShell_intro.html":"5"},{"classes/pvrplatformShellOS.html":"4"},{"PVRShell_classes.html":"2"},{"PVRShell_files.html":"2"},{"classes/pvr.html":"1"},{"classes/pvrplatform.html":"1"},{"files/Shell.html":"1"}],"windowskey":[{"files/Shell.html":"1"}],"windowsosdata":[{"classes/pvrplatformWindowsOSData.html":"29"},{"files/OS/Windows/WindowsOSData.html":"28"},{"PVRShell_classes.html":"1"},{"PVRShell_files.html":"1"},{"classes/pvrplatform.html":"1"}],"wish":[{"files/PVRShell.html":"16"},{"PVRShell_files.html":"2"}],"within":[{"classes/pvrplatformShellOS.html":"2"}],"would":[{"PVRShell_intro.html":"1"}],"write":[{"classes/pvrplatformShell.html":"5"},{"classes/pvrplatformShellOS.html":"4"},{"PVRShell_intro.html":"3"}],"writepath":[{"classes/pvrplatformShellOS.html":"3"}],"x":[{"classes/pvrplatformShell.html":"5"},{"classes/pvrPointerLocation.html":"3"},{"PVRShell_intro.html":"1"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"files/Shell.html":"1"}],"y":[{"classes/pvrplatformShell.html":"4"},{"classes/pvrPointerLocation.html":"3"},{"PVRShell_intro.html":"1"},{"classes/pvrConfigureEvent.html":"1"},{"classes/pvrPointerLocationStore.html":"1"},{"classes/pvrplatformShellPointerNormalisedLocation.html":"1"},{"files/Shell.html":"1"}],"you":[{"files/PVRShell.html":"16"},{"PVRShell_files.html":"2"},{"PVRShell_intro.html":"1"},{"classes/pvrplatformShell.html":"1"}],"your":[{"classes/pvrplatformShell.html":"15"},{"PVRShell_intro.html":"4"},{"files/Shell.html":"1"}],"z":[{"files/Shell.html":"1"}] }, topicsummaries : { "PVRShell_classes.html":{"searchtitle":"PVRShell Classes","shortdesc":"All of the available classes in PVRShell"},"PVRShell_files.html":{"searchtitle":"PVRShell Files","shortdesc":"All of the available classes inPVRShell"},"PVRShell_intro.html":{"searchtitle":"PVRShell Intro","shortdesc":"An overview of the PowerVR SDK Framework module PVRShell"},"classes/pvr.html":{"searchtitle":"pvr","shortdesc":""},"classes/pvrConfigureEvent.html":{"searchtitle":"pvr::ConfigureEvent","shortdesc":"A window configuration event (e.g. resize)"},"classes/pvrPointerLocation.html":{"searchtitle":"pvr::PointerLocation","shortdesc":"Mouse pointer coordinates."},"classes/pvrPointerLocationStore.html":{"searchtitle":"pvr::PointerLocationStore","shortdesc":"A storage structure for the pointer location"},"classes/pvrplatform.html":{"searchtitle":"pvr::platform","shortdesc":""},"classes/pvrplatformInternalOS.html":{"searchtitle":"pvr::platform::InternalOS","shortdesc":""},"classes/pvrplatformShell.html":{"searchtitle":"pvr::platform::Shell","shortdesc":"The PowerVR Shell (pvr::Shell) is the main class that the user will inherit his application from."},"classes/pvrplatformShellData.html":{"searchtitle":"pvr::platform::ShellData","shortdesc":"Internal. Contains and tracks internal data necessary to power the pvr::Shell."},"classes/pvrplatformShellEvent.html":{"searchtitle":"pvr::platform::ShellEvent","shortdesc":"Contains all data of a system event."},"classes/pvrplatformShellEventunion.html":{"searchtitle":"pvr::platform::ShellEvent::union","shortdesc":"Unnamed union storing the event data. Depending on event type, different members can/should be accessed"},"classes/pvrplatformShellOS.html":{"searchtitle":"pvr::platform::ShellOS","shortdesc":"Internal class Implements a lot of the functionality and forwards to the platform from PVRShell. Don't use directly, instead use the pvr::Shell class."},"classes/pvrplatformShellOSCapabilities.html":{"searchtitle":"pvr::platform::ShellOS::Capabilities","shortdesc":"Capabilities that may be different between platforms."},"classes/pvrplatformShellPointerNormalisedLocation.html":{"searchtitle":"pvr::platform::Shell::PointerNormalisedLocation","shortdesc":"Contains a pointer location in unsigned normalised coordinates (0..1)."},"classes/pvrplatformShellPointingDeviceState.html":{"searchtitle":"pvr::platform::Shell::PointingDeviceState","shortdesc":"Contains the state of a pointing device (mouse, touch screen)."},"classes/pvrplatformShellPrivatePointerState.html":{"searchtitle":"pvr::platform::Shell::PrivatePointerState","shortdesc":""},"classes/pvrplatformSpecialKeyCode.html":{"searchtitle":"pvr::platform::SpecialKeyCode","shortdesc":""},"classes/pvrplatformStateMachine.html":{"searchtitle":"pvr::platform::StateMachine","shortdesc":"The StateMachine controlling the PowerVR Shell. Provides the application main loop and callbacks."},"classes/pvrplatformWindowsOSData.html":{"searchtitle":"pvr::platform::WindowsOSData","shortdesc":"OS specific data for windows"},"files/AppKit_dir.html":{"searchtitle":"AppKit","shortdesc":""},"files/EntryPoint/NSApplicationMain/AppController.html":{"searchtitle":"AppController.h Reference","shortdesc":"Class necessary for the entry point of the AppKit based implementation of PVRShell."},"files/EntryPoint/UIApplicationMain/AppController.html":{"searchtitle":"AppController.h Reference","shortdesc":"UIApplication delegate functioning as the application controller for UIKit implementation of Shell(iOS)"},"files/Linux_dir.html":{"searchtitle":"Linux","shortdesc":""},"files/NSApplicationMain_dir.html":{"searchtitle":"NSApplicationMain","shortdesc":""},"files/OS/AppKit/ViewMTL.html":{"searchtitle":"ViewMTL.h Reference","shortdesc":""},"files/OS/Linux/InternalOS.html":{"searchtitle":"InternalOS.h Reference","shortdesc":"Contains a common implementation for pvr::platform::InternalOS specifically for Linux platforms."},"files/OS/ShellOS.html":{"searchtitle":"ShellOS.h Reference","shortdesc":"Contains the declaration of the ShellOS class. Most of the functionality is platform-specific, and as such is"},"files/OS/Windows/WindowsOSData.html":{"searchtitle":"WindowsOSData.h Reference","shortdesc":"Contains implementation details required by the Microsoft Windows version of PVRShell."},"files/OS_dir.html":{"searchtitle":"OS","shortdesc":""},"files/PVRShell.html":{"searchtitle":"PVRShell.h Reference","shortdesc":"Include this file if you wish to use the PVRShell functionality."},"files/Shell.html":{"searchtitle":"Shell.h Reference","shortdesc":"Contains the all-important pvr::Shell class that the user will be inheriting from for his application. See"},"files/ShellData.html":{"searchtitle":"ShellData.h Reference","shortdesc":"Class containing internal data of the PowerVR Shell."},"files/StateMachine.html":{"searchtitle":"StateMachine.h Reference","shortdesc":"The StateMachine controlling the PowerVR Shell."},"files/UIApplicationMain_dir.html":{"searchtitle":"UIApplicationMain","shortdesc":""},"files/Windows_dir.html":{"searchtitle":"Windows","shortdesc":""} } }; (function () { ditasearch.init(); })();
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. /** * @fileoverview Constants used throughout ChromeVox. */ goog.provide('constants'); /** * Possible directions to perform tree traversals. * @enum {string} */ constants.Dir = { /** Search from left to right. */ FORWARD: 'forward', /** Search from right to left. */ BACKWARD: 'backward' }; /** * Represents a point. * @typedef {{x: (number), y: (number)}} */ constants.Point; /** * If a node contains more characters than this, it should not be visited during * object navigation. * * This number was taken from group_util.js and is an approximate average of * paragraph length. It's purpose is to prevent overloading tts. * @type {number} * @const */ constants.OBJECT_MAX_CHARCOUNT = 1500;
const HtmlWebpackPlugin = require('html-webpack-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin') const path = require('path') const webpack = require('webpack') const inlinejs = require('./inlinejs.json') const config = require('./app.json') const WebpackBar = require('webpackbar'); const { WebpackConfig, templateContent } = require('@saber2pr/webpack-configer') const version = () => `var version="${new Date().toLocaleString()}"` const publicPath = (resourcePath, context) => path.relative(path.dirname(resourcePath), context) + '/' const cdnhost = `//cdn.jsdelivr.net/gh/${config.userId}` module.exports = WebpackConfig({ entry: { index: './src/index.tsx', }, resolve: { extensions: ['.js', '.jsx', '.ts', '.tsx'], }, output: { filename: '[name][hash].min.js', path: path.join(__dirname, 'build'), publicPath: process.env.NODE_ENV === 'production' ? `${cdnhost}/${config.repo}@master/build/` : '/', }, module: { rules: [ { test: /\.(ts|tsx)$/, use: ['ts-loader'], }, { test: /\.(woff|svg|eot|ttf|png)$/, use: ['url-loader'], }, { test: /\.css$/, use: [ { loader: MiniCssExtractPlugin.loader, options: { publicPath }, }, 'css-loader', ], }, { test: /\.less$/, use: [ { loader: MiniCssExtractPlugin.loader, options: { publicPath }, }, 'css-loader', 'less-loader', ], }, ], }, plugins: [ new HtmlWebpackPlugin({ templateContent: templateContent(config.title, { injectHead: ` <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> <meta name="keywords" content="react,antd,typescript,javascript,css,html,前端学习,前端进阶,个人博客"> <meta name="description" content="长期更新前端技术文章,分享前端技术经验"> <link rel="manifest" href="./manifest.json" /> <script async src="//cdn.jsdelivr.net/gh/saber2pr/click-mask@master/click-mask.min.js"></script> <script async src="//cdn.jsdelivr.net/gh/saber2pr/test@master/tools/debug.min.js"></script> <script async src="http://pv.sohu.com/cityjson?ie=utf-8"></script> ${Object.keys(inlinejs).map( key => `<script type="text/javascript" id="${key}">${inlinejs[key]}</script>` )} `, injectBody: `<div id="root"></div><script>LOADING.init(` + `"努力加载中qwq,请稍等..."` + ', 1000);</script>', }), }), new webpack.BannerPlugin({ banner: `${version()};`, raw: true, test: /\.js/, }), new MiniCssExtractPlugin({ filename: '[name][hash].css', chunkFilename: 'style.[id][hash].css', }), new WebpackBar() ], watchOptions: { aggregateTimeout: 1000, ignored: /node_modules|lib/, }, optimization: { splitChunks: { chunks: 'all', minSize: 200000, maxSize: 250000, minChunks: 1, maxAsyncRequests: 5, maxInitialRequests: 3, automaticNameDelimiter: '~', name: true, cacheGroups: { vendor: { test: /[\\/]node_modules[\\/]/, priority: -10, }, default: { minChunks: 2, priority: -20, reuseExistingChunk: true, }, }, }, }, })
window._ = require('lodash'); /** * We'll load jQuery and the Bootstrap jQuery plugin which provides support * for JavaScript based Bootstrap features such as modals and tabs. This * code may be modified to fit the specific needs of your application. */ window.$ = window.jQuery = require('jquery'); //require('bootstrap-sass'); /** * Vue is a modern JavaScript library for building interactive web interfaces * using reactive data binding and reusable components. Vue's API is clean * and simple, leaving you to focus on building your next great project. */ window.Vue = require('vue'); /** * We'll load the axios HTTP library which allows us to easily issue requests * to our Laravel back-end. This library automatically handles sending the * CSRF token as a header based on the value of the "XSRF" token cookie. */ window.axios = require('axios'); window.axios.defaults.headers.common = { 'X-Requested-With': 'XMLHttpRequest', /*'Authorization': window.Laravel.apiToken*/ }; /** * Echo exposes an expressive API for subscribing to channels and listening * for events that are broadcast by Laravel. Echo and event broadcasting * allows your team to easily build robust real-time web applications. */ // import Echo from "laravel-echo" // window.Echo = new Echo({ // broadcaster: 'pusher', // key: 'your-pusher-key' // });
module.exports = class { constructor(router) { this.app = require('express')(); this.helpers = require('./helpers'); this.config = require('./config'); this.router = router; this.port = this.helpers.normalizePort(); this.app.set('port', this.port); this.config.forEach(config => this.app.use(config)); this.app.use('/', this.router.self); this.app.use((req, res) => { res.sendStatus(404); }); } get self() { return this.app; } };