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9xB,OAAQ+xB,IAAK,CAElC,IAAI98B,EAAO68B,EAAKC,GAAGC,UAAUzW,QAAQ,iBAAkB,IAAIA,QAAQ,WAAY,KAE/EtmB,EAAOA,EAAKsmB,QAAQ,KAAM,MAE1BsW,EAAItyB,KAAK,IAAMtK,EAAO,IAC1B,CACA28B,EAAIryB,KAAKsyB,EAAI1d,KAAKud,GACtB,CACA,IAAIO,EAAaL,EAAIzd,KAAK,MAEtB+d,EAAW,UAAYT,EAAW,KAAM,IAAI38B,MAAO8U,qBAAuB,OAC1EuoB,EAAOx+B,SAASk6B,cAAc,KAClCsE,EAAKp4B,MAAMq4B,QAAU,OACrBD,EAAKE,aAAa,SAAU,UAC5BF,EAAKE,aAAa,OAAQ,+BAAiC5J,mBAAmBwJ,IAC9EE,EAAKE,aAAa,WAAYH,GAC9Bv+B,SAASkV,KAAK4mB,YAAY0C,GAC1BA,EAAKn6B,QACLrE,SAASkV,KAAKypB,YAAYH,EAC5B,CAKII,CADgBj9B,EAAMC,OAAO6C,QAAQ7C,OACP,GAC9B,G,uCCpBJ5B,SAASC,iBAAiB,cAfC,WACzB,IAAI4+B,EAAwB7+B,SAASqH,cAAc,oBACnD,GAAKw3B,EAAL,CAEA,IAAIC,EAAWD,EAAsBp6B,QAAQyP,KAKzC6qB,EAJWF,EAAsBp6B,QAAQu6B,SAG1B,WAAaC,MAAMC,MAAMJ,EAAW,EADpC,WAAaj8B,EAAMK,KAAK,CAACC,IAAK27B,EAAUz7B,KAAM,OAAQ,EAIrE87B,EAAUz8B,OAAOm8B,EAAsBp6B,QAAQ06B,SACnD/8B,WAAW28B,EAASI,EAViB,CAWvC,G","sources":["webpack://app/./app/javascript/components/ sync ^\\.\\/.*$","webpack://app/./app/javascript/app/application.js","webpack://app/./app/javascript/app/time_since.js","webpack://app/./app/javascript/app/stripe_buyer_setup_intent.js","webpack://app/./app/javascript/app/stripe_seller_add_bank_account.js","webpack://app/./app/javascript/app/stripe_seller_add_card.js","webpack://app/./app/javascript/components/buyer/PurchaseOrderEdit.jsx","webpack://app/./app/javascript/components/buyer/PurchaseOrderItemEdit.jsx","webpack://app/./app/javascript/components/buyer/PurchaseOrderItemNew.jsx","webpack://app/./app/javascript/components/catalog/AddToCart.jsx","webpack://app/./app/javascript/components/catalog/Cart.jsx","webpack://app/./app/javascript/components/catalog/CartItem.jsx","webpack://app/./app/javascript/components/catalog/DeliveryDatePicker.jsx","webpack://app/./app/javascript/components/catalog/OrderCatalog.jsx","webpack://app/./app/javascript/components/catalog/Product.jsx","webpack://app/./app/javascript/components/catalog/ProductCatalog.jsx","webpack://app/./app/javascript/components/catalog/ProductGallery.jsx","webpack://app/./app/javascript/components/catalog/ProductUnitDeposit.jsx","webpack://app/./app/javascript/components/catalog/ProductUnitPrice.jsx","webpack://app/./app/javascript/components/catalog/PublicCatalog.jsx","webpack://app/./app/javascript/components/catalog/QuantityInput.jsx","webpack://app/./app/javascript/components/catalog/SearchBar.jsx","webpack://app/./app/javascript/components/seller/Forecast.jsx","webpack://app/./app/javascript/components/seller/OrderInfo.jsx","webpack://app/./app/javascript/components/seller/ProductUnitSelect.jsx","webpack://app/./app/javascript/components/seller/QuantitySelect.jsx","webpack://app/./app/javascript/services/BuyerOrderService.js","webpack://app/./app/javascript/services/InventoryForecastService.js","webpack://app/./app/javascript/services/OrderItemMoveService.js","webpack://app/./app/javascript/components/seller/SalesOrderEdit.jsx","webpack://app/./app/javascript/components/seller/SalesOrderItemEdit.jsx","webpack://app/./app/javascript/components/seller/SalesOrderItemNew.jsx","webpack://app/./app/javascript/controllers/application.js","webpack://app/./app/javascript/controllers/product_unit_activity_popover_controller.js","webpack://app/./app/javascript/controllers/simple_popover_controller.js","webpack://app/./app/javascript/controllers/cloner_controller.js","webpack://app/./app/javascript/controllers/index.js","webpack://app/./app/javascript/packs/app.js","webpack://app/./app/javascript/services/CatalogFetcher.js","webpack://app/./app/javascript/services/Connection.js","webpack://app/./app/javascript/services/PurchaseOrderItemService.js","webpack://app/./app/javascript/services/PurchaseOrderService.js","webpack://app/./app/javascript/services/SalesOrderItemService.js","webpack://app/./app/javascript/services/Utils.js","webpack://app/./app/javascript/src/ahoy.js","webpack://app/./app/javascript/src/bootstrap_init.js","webpack://app/./app/javascript/src/chosen_init.js","webpack://app/./app/javascript/src/datatables_init.js","webpack://app/./app/javascript/src/date_range_picker.js","webpack://app/./app/javascript/src/deposits.js","webpack://app/./app/javascript/src/flatpickr.js","webpack://app/./app/javascript/src/mapbox.js","webpack://app/./app/javascript/src/market_sheet.js","webpack://app/./app/javascript/src/selectall.js","webpack://app/./app/javascript/src/sorting.js","webpack://app/./app/javascript/src/table_to_csv.js","webpack://app/./app/javascript/src/timeout_poll.js"],"sourcesContent":["var map = {\n\t\"./buyer/PurchaseOrderEdit\": 11813,\n\t\"./buyer/PurchaseOrderEdit.jsx\": 11813,\n\t\"./buyer/PurchaseOrderItemEdit\": 39241,\n\t\"./buyer/PurchaseOrderItemEdit.jsx\": 39241,\n\t\"./buyer/PurchaseOrderItemNew\": 42197,\n\t\"./buyer/PurchaseOrderItemNew.jsx\": 42197,\n\t\"./catalog/AddToCart\": 6991,\n\t\"./catalog/AddToCart.jsx\": 6991,\n\t\"./catalog/Cart\": 1758,\n\t\"./catalog/Cart.jsx\": 1758,\n\t\"./catalog/CartItem\": 3770,\n\t\"./catalog/CartItem.jsx\": 3770,\n\t\"./catalog/DeliveryDatePicker\": 45229,\n\t\"./catalog/DeliveryDatePicker.jsx\": 45229,\n\t\"./catalog/OrderCatalog\": 9149,\n\t\"./catalog/OrderCatalog.jsx\": 9149,\n\t\"./catalog/Product\": 93057,\n\t\"./catalog/Product.jsx\": 93057,\n\t\"./catalog/ProductCatalog\": 12737,\n\t\"./catalog/ProductCatalog.jsx\": 12737,\n\t\"./catalog/ProductGallery\": 76056,\n\t\"./catalog/ProductGallery.jsx\": 76056,\n\t\"./catalog/ProductUnitDeposit\": 82949,\n\t\"./catalog/ProductUnitDeposit.jsx\": 82949,\n\t\"./catalog/ProductUnitPrice\": 21076,\n\t\"./catalog/ProductUnitPrice.jsx\": 21076,\n\t\"./catalog/PublicCatalog\": 33631,\n\t\"./catalog/PublicCatalog.jsx\": 33631,\n\t\"./catalog/QuantityInput\": 51495,\n\t\"./catalog/QuantityInput.jsx\": 51495,\n\t\"./catalog/SearchBar\": 50276,\n\t\"./catalog/SearchBar.jsx\": 50276,\n\t\"./seller/Forecast\": 41259,\n\t\"./seller/Forecast.jsx\": 41259,\n\t\"./seller/OrderInfo\": 11257,\n\t\"./seller/OrderInfo.jsx\": 11257,\n\t\"./seller/ProductUnitSelect\": 33046,\n\t\"./seller/ProductUnitSelect.jsx\": 33046,\n\t\"./seller/QuantitySelect\": 20841,\n\t\"./seller/QuantitySelect.jsx\": 20841,\n\t\"./seller/SalesOrderEdit\": 85363,\n\t\"./seller/SalesOrderEdit.jsx\": 85363,\n\t\"./seller/SalesOrderItemEdit\": 31627,\n\t\"./seller/SalesOrderItemEdit.jsx\": 31627,\n\t\"./seller/SalesOrderItemNew\": 65914,\n\t\"./seller/SalesOrderItemNew.jsx\": 65914\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 982;","import { timeSince } from './time_since.js';\n\ndocument.addEventListener(\"turbo:before-cache\", function() {\n $(\".toast\").remove()\n $('.dropdown .dropdown-menu.show').dropdown('hide')\n})\n\ndocument.addEventListener('turbo:load', () => {\n $('#featured-selections').on('click', 'a.list-group-item-action', function () {\n $(this).find('.text-muted.small').append('')\n })\n});\n\ndocument.addEventListener('turbo:load', () => {\n $(document).on('click', '.modal-close-and-reload', function () {\n $('.modal').modal('dispose')\n window.location.reload();\n })\n});\n\ndocument.addEventListener('turbo:load', () => {\n $('[data-toggle=\"time-ago\"]').each(\n function() {\n var date = new Date($(this).data('date'))\n var formatted = timeSince(date)\n $(this).html(formatted)\n }\n )\n})\n\ndocument.addEventListener(\"turbo:load\", function(){\n $('body').on('click', '.input-fill-button', function () {\n $($(this).data('target')).val($(this).data('value'))\n });\n});\n\n\ndocument.addEventListener(\"turbo:load\", function(){\n $('#sales-order-dropdown').on('shown.bs.dropdown', function () {\n $(this).find('#sales_order_go').trigger(\"focus\")\n });\n});\n\ndocument.addEventListener(\"turbo:load\", function(){\n $('.toggle-button').on('click', function () {\n $(this).toggleClass('active')\n });\n});\n\ndocument.addEventListener(\"turbo:load\", function(){\n $(document).on('change', '#sales-group-by', function(event) {\n if (event.target.value == 'producer tag') {\n $(this).closest('.group-by-container').find('.collapse.producer-tags').collapse('show');\n $(this).closest('.group-by-container').find('.collapse.buyer-tags').collapse('hide');\n } else if (event.target.value == 'buyer tag') {\n $(this).closest('.group-by-container').find('.collapse.buyer-tags').collapse('show');\n $(this).closest('.group-by-container').find('.collapse.producer-tags').collapse('hide');\n } else {\n $(this).closest('.group-by-container').find('.collapse').collapse('hide');\n }\n })\n});\n\ndocument.addEventListener(\"turbo:load\", function(){\n let shiftPressedTimes = 0;\n let shiftTimer = null;\n document.addEventListener('keydown', function(event) {\n // Check if Shift is pressed\n if (event.key === 'Shift') {\n shiftPressedTimes++;\n // Reset after 1 second if Shift wasn't pressed twice within the timeframe\n if (shiftTimer) {\n clearTimeout(shiftTimer);\n }\n shiftTimer = setTimeout(function() {\n shiftPressedTimes = 0;\n }, 1000);\n\n // If Shift is pressed twice\n if (shiftPressedTimes === 2) {\n // Listen for 'b' key\n document.addEventListener('keydown', function(event) {\n if (event.key.toLowerCase() === 'b') {\n $('#buyers-dropdown .dropdown-toggle').dropdown('toggle');\n $('#buyers-go').trigger(\"focus\")\n shiftPressedTimes = 0; // Reset Shift press counter\n return event.preventDefault();\n }\n else if (event.key.toLowerCase() === 's') {\n $('#sellers-dropdown .dropdown-toggle').dropdown('toggle');\n $('#sellers-go').trigger(\"focus\")\n shiftPressedTimes = 0; // Reset Shift press counter\n return event.preventDefault();\n }\n else if (event.key.toLowerCase() === 'o') {\n $('#sales-order-dropdown .dropdown-toggle').dropdown('toggle');\n $('#sales_order_go').trigger(\"focus\")\n shiftPressedTimes = 0; // Reset Shift press counter\n return event.preventDefault();\n }\n else if (event.key.toLowerCase() === 'p') {\n $('#purchase-order-dropdown .dropdown-toggle').dropdown('toggle');\n $('#purchase_order_go').trigger(\"focus\")\n shiftPressedTimes = 0; // Reset Shift press counter\n return event.preventDefault();\n }\n else if (event.key.toLowerCase() === 'f') {\n $('#products-dropdown .dropdown-toggle').dropdown('toggle');\n $('#forecasts-go').trigger(\"focus\")\n shiftPressedTimes = 0; // Reset Shift press counter\n return event.preventDefault();\n }\n }, { once: true });\n }\n } else {\n shiftPressedTimes = 0;\n }\n });\n})\n\ndocument.addEventListener(\"turbo:load\", function(){\n $('#purchase-order-dropdown').on('shown.bs.dropdown', function () {\n $(this).find('#purchase_order_go').trigger(\"focus\")\n });\n});\n\ndocument.addEventListener(\"turbo:load\", function(){\n $('#products-dropdown').on('shown.bs.dropdown', function () {\n $(this).find('#products-go').trigger(\"focus\")\n });\n});\n\ndocument.addEventListener(\"turbo:load\", function(){\n $('#buyers-dropdown').on('shown.bs.dropdown', function () {\n $(this).find('#buyers-go').trigger(\"focus\")\n });\n});\n\ndocument.addEventListener(\"turbo:load\", function(){\n $('#sellers-dropdown').on('shown.bs.dropdown', function () {\n $(this).find('#sellers-go').trigger(\"focus\")\n });\n});\n\ndocument.addEventListener(\"turbo:load\", function(){\n $('.inventory-location-dropdown').on('shown.bs.dropdown', function () {\n $(this).find('.form-control:first').trigger(\"focus\")\n });\n});\n\n\n$(document).on('keyup', \".recalculate-laid-in\", function() {\n const form = $(this).closest('form')\n const price = Number(form.find('#product_unit_price').val())\n const freight = Number(form.find('#product_unit_freight_cost').val())\n const pad_pct = Number(form.find('#product_unit_pad_pct').val())\n\n let laid_in_cost = ((price + freight) * ( 100 + pad_pct ) / 100).toFixed(2)\n if ( isNaN(laid_in_cost) ) { laid_in_cost = '------' }\n form.find('#product_unit_laid_in_cost').val(laid_in_cost)\n});\n\n$(document).on('change', \"select.submit-on-change, input.submit-on-change\", function( event ) {\n Rails.fire(this.form, \"submit\")\n});\n\n$(document).on('show.bs.popover', '.popover-product-unit', function () {\n var popover = $(this)\n var product_unit_id = popover.data().id\n var as_of_date = popover.data().date\n Rails.ajax({\n url: \"/admin/product_units/\" + product_unit_id + \"/buyer_order_items/?on=\" + as_of_date ,\n dataType: \"script\",\n type: \"get\"\n })\n})\n\ndocument.addEventListener('turbo:load', () => {\n var options = {\n delay: { show: 300, hide: 50 },\n trigger: 'manual',\n html: true\n };\n var $popover = $('.popover-product-unit').popover(options);\n\n $popover.on('mouseenter', function () { // This is entering the triggering element\n var self = this;\n\n clearTimeout(self.timeout);\n self.hoverState = 'in';\n\n self.timeout = setTimeout(function () {\n if (self.hoverState == 'in') {\n $(self).popover(\"show\");\n\n $(\".popover, .popover *\").on('mouseover', function () { // This is moving over the popover\n clearTimeout(self.timeout);\n });\n\n $(\".popover\").on('mouseleave', function () { // This is leaving the popover\n self.timeout = setTimeout(function () {\n if (self.hoverState == 'out') {\n $(self).popover('hide');\n }\n }, options.delay.hide);\n });\n }\n }, options.delay.show);\n }).on('mouseleave', function (event) { // This is leaving the triggering element\n var self = this;\n\n clearTimeout(self.timeout);\n self.hoverState = 'out';\n\n self.timeout = setTimeout(function () {\n if (self.hoverState == 'out') {\n $(self).popover('hide');\n }\n }, options.delay.hide);\n });\n})\n\n\n$(document).on('show.bs.popover', '.order-popover', function () {\n var popover = $(this)\n var id = popover.data().id\n Rails.ajax({\n url: \"/admin/sales_orders/\" + popover.data().id,\n dataType: \"script\",\n type: \"get\"\n })\n})\n\ndocument.addEventListener('turbo:load', () => {\n var options = {\n delay: { show: 300, hide: 50 },\n trigger: 'manual',\n html: true\n };\n var $popover = $('.order-popover').popover(options);\n\n $popover.on('mouseenter', function () { // This is entering the triggering element\n var self = this;\n\n clearTimeout(self.timeout);\n self.hoverState = 'in';\n\n self.timeout = setTimeout(function () {\n if (self.hoverState == 'in') {\n $(self).popover(\"show\");\n\n $(\".popover, .popover *\").on('mouseover', function () { // This is moving over the popover\n clearTimeout(self.timeout);\n });\n\n $(\".popover\").on('mouseleave', function () { // This is leaving the popover\n self.timeout = setTimeout(function () {\n if (self.hoverState == 'out') {\n $(self).popover('hide');\n }\n }, options.delay.hide);\n });\n }\n }, options.delay.show);\n }).on('mouseleave', function (event) { // This is leaving the triggering element\n var self = this;\n\n clearTimeout(self.timeout);\n self.hoverState = 'out';\n\n self.timeout = setTimeout(function () {\n if (self.hoverState == 'out') {\n $(self).popover('hide');\n }\n }, options.delay.hide);\n });\n})\n\n\n$(document).on('click', '.popover-order-items tr', function () {\n var target = $(this).data('target')\n window.open(target, '_blank')\n})\n\n\n$(document).on('show.bs.dropdown', '.alternatives-dropdown', function () {\n var dropdownMenu = $(this)\n var item_id = dropdownMenu.data().id\n Rails.ajax({\n url: \"/admin/checkout_items/\" + item_id + \"/alternatives\",\n dataType: \"script\",\n type: \"get\"\n })\n})\n$(document).on('hide.bs.dropdown', '.alternatives-dropdown', function () {\n var spinner = \"\"\n $(this).find('.alternatives').html(spinner)\n})\n\n\ndocument.addEventListener('turbo:load', () => {\n new ClipboardJS('.clipboard-button');\n\n $('html').on('show.bs.dropdown', '.available-on-dropdown', function() {\n var form = $(this).find('form')[0]\n Rails.fire(form, \"submit\")\n })\n\n\n $('form').on('click', '.availability-toggler', function () {\n var input = $(this).find(\"input\")\n var icon = $(this).find(\"span\")\n if (input.val() == \"true\") {\n input.val(\"false\")\n icon.removeClass(\"fa-toggle-on\")\n icon.addClass(\"fa-toggle-off text-muted\")\n } else {\n input.val(\"true\")\n icon.removeClass(\"fa-toggle-off text-muted\")\n icon.addClass(\"fa-toggle-on\")\n }\n });\n\n $(\".send-form-on-change\").change(function(){\n var form = $(this).closest('form')[0];\n Rails.fire(form, \"submit\")\n });\n\n $(\"select[name='product_unit[packing_volume_id]']\").change(function(){\n var form = $(this).closest('form')[0];\n Rails.fire(form, \"submit\")\n });\n\n $(\".toggler\").click(function () {\n var checkAll = $(this).text() == 'show details'\n if (checkAll) {\n $(this).text('hide details');\n } else {\n $(this).text('show details');\n }\n });\n\n $(\".unit-edit-button-enabler\").click(function () {\n $(this).siblings(\".unit-edit-enabler\").removeClass('d-none')\n });\n\n $(\".unit-edit-enabler\").click(function () {\n var input = $(this).closest(\"form\").find('input[name=\"product_unit[unit]\"]')\n input.prop('disabled', false);\n $(this).remove()\n });\n\n\n\n $(document).on('change', \"#route_run_vehicle_id\", function(event) {\n if (event.target.value == \"0\") {\n window.open(event.target.dataset.url, '_blank');\n }\n })\n\n $('#order-receiving').on('click', '.additive-button', function(){\n var add = Number($(this).data('plus'))\n var quantityInput = $(this).closest('.receiving-item').find('.quantity');\n var currentQty = Number(quantityInput.val());\n\n quantityInput.val(Math.max(currentQty + add, 0))\n });\n\n $(\"#per_page\").change(function(){\n $(this).closest('form').submit();\n });\n\n $('.checkbox-input-toggler input[type=\"checkbox\"]').click(function() {\n // checkbox click events are weird and rather than fighting it, i'm hacking it\n var checked = $(this).is(\":checked\")\n $(this).prop(\"checked\", checked ? false : true)\n })\n\n $('.checkbox-input-toggler').click(function() {\n var checked = $(this).find('input').is(\":checked\")\n $(this).find('input').prop(\"checked\", checked ? false : true)\n $(this).toggleClass(\"btn-outline-success\")\n $(this).toggleClass(\"btn-outline-secondary\")\n $(this).find('.fa').toggleClass(\"fa-lg\")\n })\n\n $('form').on('click', '.copy-all-estimates', function() {\n $('input[data-estimate]').each(\n function() {\n var current_value = $(this).val()\n var estimate_value = $(this).data().estimate;\n if (!current_value && estimate_value == 0) { return }\n $(this).val(estimate_value) }\n )\n return event.preventDefault();\n });\n\n $('form').on('click', '.copy-blanks-estimates', function() {\n $('input[data-estimate]').each(\n function() {\n var current_value = $(this).val()\n if (current_value) { return }\n var estimate_value = $(this).data().estimate\n if (!current_value && estimate_value == 0) { return }\n $(this).val(estimate_value)\n }\n )\n return event.preventDefault();\n });\n\n var updatePaymentTotal = function() {\n var newTotal = 0\n $('tbody input.apply-payment-destination').each(\n function() { newTotal += Number($(this).val())}\n )\n newTotal = Number(newTotal.toFixed(2))\n var expectedTotal = Number($('#payment_value').data('value') || $('#payment_value').val())\n $('#calculated_payment_total').val(newTotal.toFixed(2))\n if (newTotal === expectedTotal) {\n $('#calculated_payment_total').addClass('is-valid')\n $('#calculated_payment_total').removeClass('is-invalid')\n } else {\n $('#calculated_payment_total').addClass('is-invalid')\n $('#calculated_payment_total').removeClass('is-valid')\n }\n }\n window.updatePaymentTotal = updatePaymentTotal\n\n var updateRemainingBalance = function() {\n var expectedTotal = Number($('#payment_value').val())\n var totalApplied = Number($('#calculated_payment_total').val())\n var newValue = expectedTotal ? (expectedTotal - totalApplied).toFixed(2) : 0\n $('#payment_new_credit').val(newValue)\n }\n\n $('form').on('click', '.apply-payment', function() {\n var sumApplied = 0\n $(this).closest('tr').find('input.apply-payment-destination').val('')\n $('tbody input.apply-payment-destination').each(\n function() { sumApplied += Number($(this).val())}\n )\n var remaining = Number($(this).data('remaining'))\n var expectedTotal = Number($('#payment_value').val())\n var totalRemaining = expectedTotal - sumApplied\n\n var toSet = expectedTotal ? Math.min(totalRemaining, remaining) : remaining\n\n $(this).closest('tr').find('input.apply-payment-destination').val(toSet.toFixed(2))\n\n updatePaymentTotal();\n updateRemainingBalance();\n return event.preventDefault();\n });\n\n $('form tbody').on('change', 'input', function() {\n updatePaymentTotal();\n updateRemainingBalance();\n })\n\n if ( $('#card-element').data('pk') ) {\n const pk = $('#card-element').data('pk')\n const stripe = Stripe(pk);\n\n const cardOptions = {\n iconStyle: 'solid',\n style: {\n base: {\n fontSize: '17.5px',\n fontWeight: 400,\n fontFamily: 'Helvetica Neue',\n color: '#495057',\n backgroundColor: '#fff'\n }\n }\n }\n\n var elements = stripe.elements();\n var cardElement = elements.create('card', cardOptions);\n cardElement.mount('#card-element');\n\n var cardButton = document.getElementById('card-button');\n var clientSecret = cardButton.dataset.secret;\n\n cardButton.addEventListener('click', function(ev) {\n var radioButton = document.querySelector('input[name=\"payment_method\"]:checked');\n var payload = {};\n if (radioButton.value == 'new_card') {\n var cardholderName = document.getElementById('cardholder-name');\n payload = {\n payment_method: {\n card: cardElement,\n billing_details: { name: cardholderName.value }\n },\n setup_future_usage: 'off_session'\n }\n } else {\n payload = { payment_method: radioButton.value }\n }\n\n $('#stripe-error-message').slideUp();\n $('#stripe-error-message .alert').text('')\n $(cardButton).text('Submitting...');\n $(cardButton).prop('disabled', true);\n stripe.confirmCardPayment(\n clientSecret,\n payload\n ).then(function(result) {\n if (result.error) {\n $('#stripe-error-message .alert').text(result.error.message)\n $('#stripe-error-message').slideDown();\n $(cardButton).text('Submit Payment');\n $(cardButton).prop('disabled', false);\n } else {\n $('#stripe').slideUp(400, () => {\n const confirmation = `\n

Thank you for your payment!

\n

You should soon receive a confirmation email with your order details.

\n
\n Back to Dashboard\n
\n `\n $('#stripe').html(confirmation);\n $('#stripe').slideDown();\n });\n }\n });\n return event.preventDefault();\n });\n }\n});\n","export const timeSince = function(date) {\n var seconds = Math.floor((new Date() - date) / 1000);\n\n if (seconds < 0) {\n interval = Math.floor(seconds / 86400);\n return \"in \" + -interval + \" days\";\n }\n\n var interval = Math.floor(seconds / 31536000);\n\n if (interval > 1) {\n return interval + \" years\";\n }\n interval = Math.floor(seconds / 2592000);\n if (interval > 1) {\n return interval + \" months\";\n }\n interval = Math.floor(seconds / 86400);\n if (interval > 1) {\n return interval + \" days\";\n }\n interval = Math.floor(seconds / 3600);\n if (interval > 1) {\n return interval + \" hours\";\n }\n interval = Math.floor(seconds / 60);\n if (interval > 1) {\n return interval + \" minutes\";\n }\n return Math.floor(seconds) + \" seconds\";\n}","document.addEventListener('stripe:add-setup-intent', () => {\n const setupIntentElement = document.getElementById('buyer-setup-intent')\n if ( setupIntentElement ) {\n const published_key = setupIntentElement.dataset.pk\n const stripe = Stripe(published_key);\n\n const elements = stripe.elements({clientSecret: setupIntentElement.dataset.clientSecret})\n\n const options = { fields: { billingDetails: { billingName: 'auto'}}}\n const paymentElement = elements.create('payment', options)\n\n paymentElement.mount(setupIntentElement);\n\n const form = document.getElementById('setup-intent-form');\n\n form.addEventListener('submit', async (event) => {\n event.preventDefault();\n\n const {error} = await stripe.confirmSetup({\n //`Elements` instance that was used to create the Payment Element\n elements,\n confirmParams: {\n return_url: setupIntentElement.dataset.returnTo\n }\n });\n\n if (error) {\n // This point will only be reached if there is an immediate error when\n // confirming the payment. Show error to your customer (for example, payment\n // details incomplete)\n const messageContainer = document.querySelector('#error-message');\n messageContainer.textContent = error.message;\n } else {\n // Your customer will be redirected to your `return_url`. For some payment\n // methods like iDEAL, your customer will be redirected to an intermediate\n // site first to authorize the payment, then redirected to the `return_url`.\n }\n });\n\n }\n})\n","document.addEventListener('turbo:load', () => {\n if ( $('#seller-add-bank-account').data('pk') ) {\n const published_key = $('#seller-add-bank-account').data('pk')\n const stripe = Stripe(published_key);\n\n const bankAccountButton = document.getElementById('bank-account-button');\n bankAccountButton.addEventListener('click', function(ev) {\n const routing_number = document.getElementById('routing_number').value\n const account_number = document.getElementById('account_number').value\n const account_holder_name = document.getElementById('account_holder_name').value\n const account_holder_type = document.querySelector('input[name=\"account_holder_type\"]:checked').value\n\n\n stripe.createToken('bank_account', {\n country: 'US',\n currency: 'usd',\n routing_number: routing_number,\n account_number: account_number,\n account_holder_name: account_holder_name,\n account_holder_type: account_holder_type\n })\n .then(function(result) {\n if (result.token) {\n const tokenInput = document.getElementById('stripe_bank_account_token_id')\n\n tokenInput.value = result.token.id\n\n const form = document.getElementById('stripe-bank-account-form').submit()\n } else {\n $('#add-bank-account-errors .alert').text(result.error.message)\n $('#add-bank-account-errors').slideDown();\n }\n });\n })\n }\n})\n","document.addEventListener('stripe:setup-add-card', () => {\n if ( $('#seller-add-card-element').data('pk') ) {\n const published_key = $('#seller-add-card-element').data('pk')\n const stripe = Stripe(published_key);\n\n const cardOptions = {\n iconStyle: 'solid',\n hidePostalCode: true,\n style: {\n base: {\n fontSize: '17.5px',\n fontWeight: 400,\n fontFamily: 'Helvetica Neue',\n color: '#495057',\n backgroundColor: '#fff',\n borderRadius: '0.25rem'\n }\n }\n }\n\n var elements = stripe.elements();\n var cardElement = elements.create('card', cardOptions);\n cardElement.mount('#seller-add-card-element');\n\n var cardButton = document.getElementById('seller-add-card-button');\n var clientSecret = cardButton.dataset.secret;\n\n cardButton.addEventListener('click', function(ev) {\n const cardholderName = document.getElementById('cardholder-name');\n const payload = {\n payment_method: {\n card: cardElement,\n billing_details: { name: cardholderName.value }\n }\n }\n $('#stripe-error-message').slideUp();\n $('#stripe-error-message .alert').text('')\n $(cardButton).text('Submitting...');\n $(cardButton).prop('disabled', true);\n\n stripe.confirmCardSetup(\n clientSecret,\n payload\n ).then(function(result) {\n if (result.error) {\n $('#stripe-error-message .alert').text(result.error.message)\n $('#stripe-error-message').slideDown();\n $(cardButton).text('Add Card');\n $(cardButton).prop('disabled', false);\n } else {\n $('#add-new-card').slideUp(400, () => {\n const confirmation = `\n

Card Added

\n `\n $('#add-new-card').html(confirmation);\n $('#add-new-card').slideDown();\n });\n }\n });\n return event.preventDefault();\n });\n }\n})\n","import React from \"react\"\nimport { PurchaseOrderItemEdit } from \"./PurchaseOrderItemEdit\"\nimport { PurchaseOrderItemNew } from \"./PurchaseOrderItemNew\"\nimport { PurchaseOrderService } from \"../../services/PurchaseOrderService\"\nimport { asCurrency } from \"../../services/Utils\"\nimport { ToastContainer } from 'react-toastify'\nimport _ from \"lodash\"\n\nexport class PurchaseOrderEdit extends React.Component {\n constructor(props) {\n super(props)\n\n this.onItemCreate = this.onItemCreate.bind(this)\n this.onItemDestroy = this.onItemDestroy.bind(this)\n this.onItemUpdate = this.onItemUpdate.bind(this)\n this.onNewItemSubtotalUpdate = this.onNewItemSubtotalUpdate.bind(this)\n this.onChangePurchaseOrder = this.onChangePurchaseOrder.bind(this)\n this.save = _.debounce(this.save, 1000)\n this.toggleName = this.toggleName.bind(this)\n\n this.state = {\n purchase_order: props.purchase_order,\n newItemSubtotal: 0\n }\n }\n\n save() {\n const purchase_order = this.state.purchase_order\n\n const scrubbed_purchase_order = {\n id: purchase_order.id,\n name: purchase_order.name,\n note_from_buyer: purchase_order.note_from_buyer\n }\n\n PurchaseOrderService.update(scrubbed_purchase_order).then((purchase_order) => {\n },\n (error) => { toast(error.message, { className: \"bg-danger text-white\" }) }\n )\n }\n\n toggleName() {\n this.setState({ showName: !this.state.showName })\n }\n\n calculateTotalDeposit() {\n const purchase_order = this.state.purchase_order\n const purchase_order_items = purchase_order.buyer_order_items\n const deposit_subtotals = purchase_order_items.map((purchase_order_item) => Number(purchase_order_item.deposit_subtotal))\n\n return deposit_subtotals.reduce((a,b) => a + b, 0)\n }\n\n onChangePurchaseOrder(event) {\n let purchase_order = this.state.purchase_order\n purchase_order[event.target.name] = event.target.value\n this.setState({ purchase_order: purchase_order }, this.save)\n }\n\n onItemCreate(buyer_order_item) {\n let purchase_order = this.state.purchase_order\n const existing = _.find(purchase_order.buyer_order_items, { id: buyer_order_item.id })\n if (existing) {\n const new_buyer_order_items = _.without(purchase_order.buyer_order_items, existing)\n purchase_order.buyer_order_items = new_buyer_order_items\n }\n purchase_order.buyer_order_items.push(buyer_order_item)\n this.setState({ purchase_order: purchase_order, newItemSubtotal: 0 })\n }\n\n onItemDestroy(buyer_order_item) {\n let purchase_order = this.state.purchase_order\n let item_to_remove = _.find(purchase_order.buyer_order_items, { id: buyer_order_item.id })\n const new_buyer_order_items = _.without(purchase_order.buyer_order_items, item_to_remove)\n purchase_order.buyer_order_items = new_buyer_order_items\n this.setState({ purchase_order: purchase_order })\n }\n\n onItemUpdate(new_buyer_order_item) {\n let purchase_order = this.state.purchase_order\n let indexToReplace = _.findIndex(purchase_order.buyer_order_items, { id: new_buyer_order_item.id })\n purchase_order.buyer_order_items[indexToReplace] = new_buyer_order_item\n this.setState({ purchase_order: purchase_order })\n }\n\n onNewItemSubtotalUpdate(newItemSubtotal) {\n this.setState({ newItemSubtotal: newItemSubtotal })\n }\n\n calculateTotal() {\n const purchase_order = this.state.purchase_order\n const buyer_order_items = purchase_order.buyer_order_items\n const subtotals = buyer_order_items.map((buyer_order_item) => Number(buyer_order_item.total))\n const buyer_order_items_total = subtotals.reduce((a,b) => a + b, 0)\n\n return \"\" + (buyer_order_items_total - Number(purchase_order.discount))\n }\n\n renderItemRows() {\n const items = this.state.purchase_order.buyer_order_items\n\n if (items.length === 0) {\n return (\n
\n
\n

There are no items in this order

\n
\n
\n )\n }\n const sortedItems = _.sortBy(items, (item) => { return item.product_unit.product_name })\n return (\n sortedItems.map((order_item) => {\n return (\n \n )\n })\n )\n }\n\n renderDiscountRow() {\n const purchase_order = this.state.purchase_order\n if (!purchase_order.discount || purchase_order.discount == 0) { return }\n return (\n
\n
\n Discount\n
\n
\n { asCurrency(purchase_order.discount) }\n
\n
\n )\n }\n\n renderSubtotalRow() {\n const items = this.state.purchase_order.buyer_order_items\n const subtotal = _.sumBy(items, (item) => Number(item.subtotal) )\n return (\n
\n
Subtotal
\n
{ asCurrency(subtotal) }
\n
\n )\n }\n\n renderDepositRow() {\n const total = this.calculateTotalDeposit()\n if ( total == 0 ) { return }\n return (\n
\n
Deposit
\n
\n \n { asCurrency(total) }\n
\n
\n )\n }\n\n renderTotalRow() {\n const purchase_order = this.state.purchase_order\n const total = this.calculateTotal()\n return (\n
\n
\n Total\n
\n
\n { asCurrency(total) }\n
\n
\n )\n }\n\n renderName() {\n let purchaseOrderName\n let buttonText = \"Set\"\n if (this.state.showName) {\n buttonText = \"Done\"\n purchaseOrderName = (\n \n )\n } else if (this.state.purchase_order.name) {\n buttonText = \"Change\"\n purchaseOrderName = (\n { this.state.purchase_order.name }\n )\n }\n return (\n
\n
\n Purchase Order ID for Invoice: \n
\n
\n { purchaseOrderName }\n
\n
\n \n { buttonText }\n \n
\n
\n )\n }\n\n renderSubmitButton() {\n const purchase_order = this.state.purchase_order\n if (purchase_order.status !== \"draft\" || purchase_order.buyer_order_items.length == 0) { return }\n return (\n
\n \n Review and Checkout...\n \n
\n )\n }\n\n render() {\n const purchase_order = this.state.purchase_order\n return (\n
\n \n
\n
\n \n
\n
Qty
\n
Item
\n
\n
Unit Price
\n
Subtotal
\n
\n
\n
\n { this.renderItemRows() }\n { this.renderSubtotalRow() }\n { this.renderDepositRow() }\n { this.renderDiscountRow() }\n { this.renderTotalRow() }\n
\n { this.renderSubmitButton() }\n \n
\n )\n }\n}\nexport default PurchaseOrderEdit","import React from \"react\"\nimport { asCurrency } from \"../../services/Utils\"\nimport { PurchaseOrderItemService } from \"../../services/PurchaseOrderItemService\"\nimport { QuantityInput } from \"../catalog/QuantityInput\"\nimport { QuantitySelect } from \"../seller/QuantitySelect\"\nimport classNames from \"classnames\"\nimport { debounce } from \"lodash\"\nimport { toast } from \"react-toastify\"\n\nexport class PurchaseOrderItemEdit extends React.Component {\n constructor(props) {\n super(props)\n\n this.onChangeQuantity = this.onChangeQuantity.bind(this)\n this.onDelete = this.onDelete.bind(this)\n this.changePurchaseOrderItem = this.changePurchaseOrderItem.bind(this)\n this.save = debounce(this.save, 1000)\n\n this.state = {\n purchase_order_item: props.purchase_order_item,\n status: 'waiting'\n }\n }\n\n onDelete() {\n const purchase_order_item = this.props.purchase_order_item\n PurchaseOrderItemService.destroy(purchase_order_item.id).then(\n () => { this.props.deletedPurchaseOrderItem(purchase_order_item) },\n (error) => {\n this.setState({ status: 'failed' })\n toast(error.message, { className: \"bg-danger text-white\" })\n }\n )\n }\n\n onChangeQuantity(newQuantity) {\n let purchase_order_item = this.state.purchase_order_item\n purchase_order_item.quantity = newQuantity\n this.setState({ purchase_order_item: purchase_order_item, status: 'sending' }, this.save)\n }\n\n save() {\n const purchase_order_item = this.state.purchase_order_item\n PurchaseOrderItemService.update(purchase_order_item).then((new_purchase_order_item) => {\n this.setState({ purchase_order_item: new_purchase_order_item, status: 'success' },\n () => { setTimeout(() => { this.setState({status: 'waiting'}) }, 1000) }\n )\n this.props.updatedPurchaseOrderItem(new_purchase_order_item)\n },\n (error) => {\n this.setState({ status: 'failed' })\n toast(error.message, { className: \"bg-danger text-white\" })\n }\n )\n }\n\n toggleAdvanced() {\n this.setState({ showAdvanced: !this.state.showAdvanced })\n }\n\n changePurchaseOrderItem(event) {\n let purchase_order_item = this.state.purchase_order_item\n purchase_order_item[event.target.name] = event.target.value\n this.setState({ purchase_order_item: purchase_order_item, status: 'sending' }, this.save)\n }\n\n renderDeleteButton() {\n return (\n \n \n \n )\n }\n\n renderCatchWeightDescription() {\n const purchase_order_item = this.state.purchase_order_item\n if (!purchase_order_item.actual_unit_price) { return }\n const catch_weight = purchase_order_item.actual_quantity\n const unit = purchase_order_item.product_unit.catch_weight_unit\n const item_unit = (unit == 'pound' ? 'lbs' : unit)\n const denominatorUnit = (unit == 'pound' ? 'lb' : unit)\n const rate = asCurrency(purchase_order_item.actual_unit_price)\n\n const warningClass = classNames({\n \"text-danger\": !purchase_order_item.actual_quantity\n })\n\n return (\n
\n \n { `Actual: ${catch_weight || 'TBD'} ${item_unit} × ${rate} / ${denominatorUnit}` }\n \n
\n )\n }\n\n renderNote() {\n if (!this.state.purchase_order_item.note_from_seller || this.state.showAdvanced) { return }\n return (\n
\n \n { this.state.purchase_order_item.note_from_seller }\n
\n )\n }\n\n renderDepositDescription() {\n if ( this.state.purchase_order_item.deposit_average == 0 ) { return }\n\n let message\n if ( this.state.purchase_order_item.deposit_average > 0 ) {\n message = 'This item has a refundable deposit'\n } else {\n message = 'Refundable deposit'\n }\n\n return (\n
\n \n { message }\n
\n )\n }\n\n renderDeposit() {\n if ( this.state.purchase_order_item.deposit_average == 0 ) { return }\n return (\n
\n \n { asCurrency(this.state.purchase_order_item.deposit_average) }\n
\n )\n }\n\n renderDepositSubtotal() {\n if ( this.state.purchase_order_item.deposit_subtotal == 0 ) { return }\n return (\n
\n \n { asCurrency(this.state.purchase_order_item.deposit_subtotal) }\n
\n )\n }\n\n renderSubtotal() {\n const purchase_order_item = this.state.purchase_order_item\n return (\n
\n { asCurrency(purchase_order_item.subtotal) }\n
\n )\n }\n\n renderQuantity() {\n const purchase_order_item = this.props.purchase_order_item\n return (\n
\n \n
\n )\n }\n\n renderCatchWeightInput() {\n if (!this.props.showCatchWeight) { return }\n if (!this.props.purchase_order_item.actual_unit_price) { return }\n return (\n
\n \n
\n )\n }\n\n renderUnavailable() {\n const product_unit = this.props.purchase_order_item.product_unit\n if (product_unit.is_published) { return }\n\n if (product_unit.unavailable_until_description) {\n return (\n
\n \n { product_unit.unavailable_until_description }\n
\n )\n } else {\n return (\n
\n \n This product is not currently available\n
\n )\n }\n }\n\n render() {\n const purchase_order_item = this.props.purchase_order_item\n const product_unit = purchase_order_item.product_unit\n\n const status = this.state.status\n const rowClass = classNames({\n \"order-row\": true,\n \"py-2\": true,\n \"d-flex\": true,\n \"alert-dark\": !purchase_order_item.product_unit.is_published,\n \"save-failed\": status === \"failed\",\n \"save-pending\": status === \"sending\",\n \"save-successful\": status === \"success\"\n })\n\n let minimum\n if (product_unit.quantity_minimum > 1) {\n minimum = {`${product_unit.quantity_minimum} minimum`}\n }\n let maximum\n if (product_unit.quantity_maximum) {\n maximum = {`${product_unit.quantity_maximum} maximum`}\n }\n return (\n
\n
\n { this.renderDeleteButton() }\n
\n
\n
\n
\n { this.renderQuantity() }\n
\n { this.renderCatchWeightInput() }\n
\n
\n
\n
\n \n
\n
\n
{ product_unit.producer_name }
\n
{ product_unit.product_name }
\n
{ product_unit.unit } {minimum} {maximum}
\n { this.renderCatchWeightDescription() }\n { this.renderNote() }\n { this.renderDepositDescription() }\n { this.renderUnavailable() }\n
\n
\n
\n
\n
\n { asCurrency(purchase_order_item.effective_unit_price) }\n { this.renderDeposit() }\n
\n
\n { this.renderSubtotal() }\n { this.renderDepositSubtotal() }\n
\n
\n
\n
\n )\n }\n}\nexport default PurchaseOrderItemEdit","import React from \"react\"\nimport { asCurrency } from \"../../services/Utils\"\nimport { PurchaseOrderItemService } from \"../../services/PurchaseOrderItemService\"\nimport { QuantitySelect } from \"../seller/QuantitySelect\"\nimport { ProductUnitSelect } from \"../seller/ProductUnitSelect\"\nimport { CatalogFetcher } from \"../../services/CatalogFetcher\"\nimport { toast } from \"react-toastify\"\n\nexport class PurchaseOrderItemNew extends React.Component {\n constructor(props) {\n super(props)\n\n this.quantitySelect = React.createRef()\n this.addButton = React.createRef()\n this.onCreate = this.onCreate.bind(this)\n this.onChangeQuantity = this.onChangeQuantity.bind(this)\n this.onProductUnitSelected = this.onProductUnitSelected.bind(this)\n this.notifyParentOfSubtotalChange = this.notifyParentOfSubtotalChange.bind(this)\n this.state = {\n purchase_order_item: { quantity: 1, buyer_order_id: this.props.purchase_order.id }\n }\n }\n\n onCreate() {\n let purchase_order_item = this.state.purchase_order_item\n purchase_order_item.src = 'sales_order_edit'\n PurchaseOrderItemService.create(purchase_order_item).then((new_purchase_order_item) => {\n this.props.createdPurchaseOrderItem(new_purchase_order_item)\n this.setState({\n purchase_order_item: { quantity: 1, buyer_order_id: this.props.purchase_order.id },\n product_unit: null\n }, () => { this.quantitySelect.current.refocus() })\n },\n (error) => { toast(error.message, { className: \"bg-danger text-white\" }) }\n )\n }\n\n notifyParentOfSubtotalChange() {\n this.props.onSubtotalUpdate(this.calculateSubtotal())\n }\n\n onChangeQuantity(newValue) {\n let purchase_order_item = this.state.purchase_order_item\n purchase_order_item.quantity = newValue\n this.setState({ purchase_order_item: purchase_order_item }, this.notifyParentOfSubtotalChange)\n }\n\n onProductUnitSelected(product_unit) {\n if (!product_unit) { return }\n\n let purchase_order_item = this.state.purchase_order_item\n purchase_order_item.product_unit_id = (product_unit || {}).id\n if (product_unit.quantity_minimum > purchase_order_item.quantity) {\n purchase_order_item.quantity = product_unit.quantity_minimum\n }\n this.setState({ product_unit: product_unit, purchase_order_item: purchase_order_item },\n () => { this.notifyParentOfSubtotalChange; this.addButton.current.focus(); })\n }\n\n renderQuantity() {\n const product_unit = this.state.product_unit || {}\n return (\n
\n \n
\n )\n }\n\n renderUnitPrice() {\n const product_unit = this.state.product_unit\n if (!product_unit) { return }\n return (\n { asCurrency(product_unit.price) }\n )\n }\n\n calculateSubtotal() {\n const product_unit = this.state.product_unit\n if (!product_unit) { return 0 }\n return (this.state.purchase_order_item.quantity * product_unit.price)\n }\n\n renderSubtotal() {\n const product_unit = this.state.product_unit\n if (!product_unit) { return }\n return (\n { asCurrency(\"\" + this.calculateSubtotal()) }\n )\n }\n\n render() {\n const product_unit = this.state.product_unit\n let rowClass = \"order-row no-gutters d-flex py-2 align-items-end\"\n let buttonClass\n if (!product_unit) {\n buttonClass = \"btn-primary disabled\"\n } else {\n rowClass += \" bg-warning\"\n buttonClass = \"btn-primary\"\n }\n\n return (\n
\n
\n \n
\n
\n { this.renderQuantity() }\n
\n
\n
\n \n
\n
\n
\n \n { product_unit ? 'Add Item To Order' : 'Search to Add Item'}\n \n \n
\n
\n )\n }\n}\nexport default PurchaseOrderItemNew","import React from \"react\"\nimport { QuantityInput } from \"./QuantityInput\"\n\nexport class AddToCart extends React.Component {\n constructor(props) {\n super(props)\n this.state = { quantity: props.product_unit.quantity_minimum }\n\n this.addToCartBackorder = this.addToCartBackorder.bind(this)\n this.addToCart = this.addToCart.bind(this)\n }\n\n renderQuantityInput() {\n if (!this.props.showPricing || !this.props.cartEnabled) { return }\n const product_unit = this.props.product_unit\n return (\n
\n \n
\n )\n }\n\n onChangeQuantity(dontCare, newValue) {\n this.setState({ quantity: newValue })\n }\n\n addToCart() {\n const buyer_order_item_params = {\n product_unit_id: this.props.product_unit.product_unit_id,\n quantity: this.state.quantity\n }\n this.props.addItem(buyer_order_item_params, this.props.product_unit.name, this.props.src)\n }\n\n addToCartBackorder(unavailable_type) {\n const buyer_order_item_params = {\n backorder: true,\n unavailable_type: unavailable_type,\n product_unit_id: this.props.product_unit.product_unit_id,\n quantity: this.state.quantity\n }\n this.props.addItem(buyer_order_item_params, this.props.product_unit.name, this.props.src)\n }\n\n renderAddToCart(unavailable_type) {\n if (!this.props.cartEnabled || !this.props.showPricing) {\n return (\n
\n \n Sign In to Purchase\n \n
\n )\n }\n const colorClass = this.props.colorClass || `btn-${ this.colorClass() }`\n var text = 'Add'\n if ( unavailable_type == 'temporary' ) { text = 'Backorder' }\n if ( unavailable_type == 'preorder' ) { text = 'Preorder' }\n\n var addToCartFunction = unavailable_type ? this.addToCartBackorder : this.addToCart\n return (\n
\n \n
\n )\n }\n\n colorClass() {\n switch (this.props.product_unit.unavailable_type) {\n case 'temporary':\n return 'warning'\n case 'indefinite':\n return 'danger'\n case 'preorder':\n return 'success'\n default:\n return 'success'\n }\n }\n\n renderAvailability() {\n const product_unit = this.props.product_unit\n if (!product_unit.unavailable_until_description) { return }\n\n const colorClass = this.colorClass()\n\n return (\n
\n
\n \n { product_unit.unavailable_until_description }\n
\n
\n )\n }\n\n renderQtyAndButton() {\n const product_unit = this.props.product_unit\n if (product_unit.unavailable_type == 'indefinite') { return }\n return (\n
\n { this.renderQuantityInput() }\n { this.renderAddToCart(product_unit.unavailable_type) }\n
\n )\n }\n\n render() {\n return (\n
\n { this.renderAvailability() }\n { this.renderQtyAndButton() }\n
\n )\n }\n}\n","import React from \"react\"\nimport { CartItem } from \"./CartItem\"\nimport _ from \"lodash\"\nimport { asCurrency } from \"../../services/Utils\"\n\nexport class Cart extends React.Component {\n constructor(props) {\n super(props)\n\n this.state = {\n visible: false\n }\n }\n\n toggle() {\n this.setState({\n visible: !this.state.visible\n })\n }\n\n seeOrder() {\n let path;\n if (this.props.seller_browsing) {\n path = \"/admin/sales_orders/\" + this.props.buyer_order.id + \"/edit\"\n } else {\n path = \"/admin/purchase_orders/\" + this.props.buyer_order.id + \"/checkout\"\n }\n window.location = path\n }\n\n removeItem(order_item_id) {\n if (confirm(\"Are you sure you want to remove this product from your cart?\")) {\n this.props.removeOrderItem(order_item_id)\n }\n }\n\n updateOrderItemQuantity(buyer_order_item_id, quantity) {\n this.props.updateOrderItemQuantity(buyer_order_item_id, quantity)\n }\n\n renderProducts() {\n const buyer_order_items = this.props.buyer_order.buyer_order_items\n\n if (buyer_order_items.length > 0) {\n return _.map(buyer_order_items, (buyer_order_item) => {\n return (\n \n )\n })\n } else {\n return (\n
\n No items in this order\n
\n )\n }\n }\n\n render() {\n if (!this.props.buyer_order ) { return
}\n\n const buyer_order = this.props.buyer_order\n const orderTotal = _.sumBy(buyer_order.buyer_order_items, (x) => { return Number(x.subtotal) } )\n const itemCount = _.sumBy(this.props.buyer_order.buyer_order_items, (item) => { return Number(item.quantity) } )\n\n const body = (\n
\n
\n
\n
\n {buyer_order.name || \"Order #\" + buyer_order.id}\n
\n
\n \n \n \n
\n
\n
\n
\n \n \n Checkout\n \n
\n
\n { asCurrency(orderTotal) }\n
\n
\n
\n
\n { this.renderProducts() }\n
\n
\n )\n\n return (\n
\n \n \n
{ itemCount }
\n \n { this.state.visible ? body : null }\n
\n )\n }\n}\n","import React from \"react\"\nimport { QuantityInput } from \"./QuantityInput\"\nimport { asCurrency } from \"../../services/Utils\"\n\nexport class CartItem extends React.Component {\n constructor(props) {\n super(props)\n\n this.toggle = this.toggle.bind(this)\n\n this.state = {\n edit: false\n }\n }\n\n editQuantity(unit, quantity) {\n this.setState({ quantity: quantity })\n }\n\n toggle() {\n this.setState({\n edit: !this.state.edit,\n quantity: this.props.buyer_order_item.quantity\n })\n }\n\n confirmEdit() {\n if (this.state.quantity != this.props.buyer_order_item.quantity) {\n this.props.editQuantity(\n this.props.buyer_order_item.id,\n this.state.quantity\n )\n }\n\n this.toggle()\n }\n\n renderNotAvailable() {\n if (this.props.buyer_order_item.backorder) { return }\n if (this.props.buyer_order_item.product_unit.is_published) { return }\n\n return (\n
This product is not currently available
\n )\n }\n\n renderBackordered() {\n const unavailable_type = this.props.buyer_order_item.unavailable_type\n if (!unavailable_type) { return }\n\n var text;\n if ( unavailable_type == 'temporary' ) { text = 'Backorder' }\n if ( unavailable_type == 'preorder' ) { text = 'Preorder' }\n\n return (\n
\n \n \n { text }: Deliver when available\n \n
\n )\n }\n\n renderOriginalSubtotal() {\n if (!this.props.buyer_order_item.original_subtotal) { return }\n\n return (\n
\n {asCurrency(this.props.buyer_order_item.original_subtotal)}\n
\n )\n }\n\n renderDepositSubtotal() {\n if (this.props.buyer_order_item.deposit_subtotal == 0) { return }\n\n return (\n
\n \n {asCurrency(this.props.buyer_order_item.deposit_subtotal)}\n
\n )\n }\n\n render() {\n const buyer_order_item = this.props.buyer_order_item\n return (\n
\n
\n
\n { this.props.showProducer ? (\n
\n {buyer_order_item.product_unit.producer_name}\n
\n ) : \"\"\n }\n
\n \n {buyer_order_item.product_unit.product_name}\n \n
\n { this.renderBackordered() }\n { this.renderNotAvailable() }\n
\n
\n {this.state.edit ? (\n
\n
\n \n
\n \n \n \n\n {\n this.props.remove(buyer_order_item.id)\n }}\n >\n \n Remove\n \n \n \n \n
\n ) : (\n
\n
\n \n \n ×\n { buyer_order_item.product_unit.unit }\n \n
\n
\n {asCurrency(buyer_order_item.subtotal)}\n { this.renderOriginalSubtotal() }\n { this.renderDepositSubtotal() }\n
\n
\n )}\n
\n
\n
\n )\n }\n}\n","import React from \"react\"\nimport { isTomorrow, isToday } from \"../../services/Utils\"\n\nexport class DeliveryDatePicker extends React.Component {\n constructor(props) {\n super(props)\n\n this.chooseDate = this.chooseDate.bind(this)\n this.toggleDatePicker = this.toggleDatePicker.bind(this)\n\n this.state = {\n showDatePicker: true\n }\n }\n\n chooseDate(event) {\n this.props.onChange(event)\n }\n\n toggleDatePicker() {\n this.setState({showDatePicker: !this.state.showDatePicker})\n }\n\n formatDate(date_string) {\n if (!date_string) { return 'Please schedule for me' }\n if (isTomorrow(date_string)) { return 'Tomorrow' }\n\n let date = new Date(date_string + 'T12:00:00Z')\n return date.toLocaleDateString('en-US', { weekday: 'long', month: 'short', day: 'numeric' })\n }\n\n renderButtons() {\n return (\n Object.keys(this.props.available_days).map((date) => {\n const on = this.props.available_days[date]\n return (\n
\n { on ? this.renderActiveButton(date) : this.renderDisabledButton(date) }\n
\n )\n })\n )\n }\n\n monthName(string_date) {\n const months = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']\n const index = new Number(string_date.slice(5, 7)) - 1\n return months[index]\n }\n\n renderDisabledButton(date) {\n const colorClass = isToday(date) ? 'btn-outline-info border-info' : 'border bg-light'\n return (\n \n )\n }\n\n renderActiveButton(date) {\n const active = this.props.requested_on == date ? ' active' : ''\n const colorClass = isTomorrow(date) ? 'btn-outline-warning' : 'btn-outline-primary'\n\n return (\n \n )\n }\n\n renderDropdown() {\n if (!this.state.showDatePicker) { return this.formatDate(this.props.requested_on) }\n\n const active = !this.props.requested_on ? ' active' : ''\n return (\n
\n
\n
\n
Su
\n
M
\n
Tu
\n
W
\n
Th
\n
F
\n
Sa
\n
\n
\n { this.renderButtons() }\n
\n
\n \n
\n
\n
\n )\n }\n\n render() {\n return (\n
\n
\n
\n \n
\n
\n { this.renderDropdown() }\n
\n )\n }\n}\n","import React from \"react\"\nimport { ProductCatalog } from \"./ProductCatalog\"\nimport { CatalogFetcher } from \"../../services/CatalogFetcher\"\nimport { Cart } from \"./Cart\"\nimport { PurchaseOrderService } from \"../../services/PurchaseOrderService\"\nimport { PurchaseOrderItemService } from \"../../services/PurchaseOrderItemService\"\nimport { toast } from \"react-toastify\"\n\nexport class OrderCatalog extends React.Component {\n constructor(props) {\n super(props)\n this.createOrUpdateItem = this.createOrUpdateItem.bind(this);\n this.createOrderAndItem = this.createOrderAndItem.bind(this)\n this.updateRequestedOn = this.updateRequestedOn.bind(this)\n this.removeOrderItem = this.removeOrderItem.bind(this)\n this.updateOrderItemQuantity = this.updateOrderItemQuantity.bind(this)\n this.addItem = this.addItem.bind(this)\n this.state = {\n buyer_order: props.buyer_order || { buyer_order_items: [], requested_on: props.requested_on }\n }\n }\n\n createOrderAndItem(buyer_order_item_params, product_name, src) {\n const requested_on = this.state.buyer_order.requested_on\n PurchaseOrderService.create(this.props.buyer_id, this.props.seller.id, requested_on).then(\n (buyer_order) => {\n this.setState({ buyer_order: buyer_order })\n this.createOrUpdateItem(buyer_order.id, buyer_order_item_params, product_name, src)\n const newUrl = \"/admin/purchase_orders/\" + buyer_order.id + \"/browse\"\n window.history.replaceState({}, \"Catalog\", newUrl)\n }\n )\n }\n\n createOrUpdateItem(buyer_order_id, buyer_order_item_params, product_name, src) {\n buyer_order_item_params.buyer_order_id = buyer_order_id\n buyer_order_item_params.src = src\n PurchaseOrderItemService.create(buyer_order_item_params).then(\n (buyer_order_item) => {\n let buyer_order = this.state.buyer_order\n const index = _.findIndex(buyer_order.buyer_order_items, { id: buyer_order_item.id })\n if ( index === -1 ) {\n buyer_order.buyer_order_items.push(buyer_order_item)\n } else {\n buyer_order.buyer_order_items[index] = buyer_order_item\n }\n this.setState({buyer_order: buyer_order})\n toast('Added to cart: ' + product_name, { className: \"bg-success text-white\"})\n },\n (error) => { toast(error.message, { className: \"bg-danger text-white\" }) }\n )\n }\n\n addItem(buyer_order_item_params, name, src) {\n if (!this.state.buyer_order.id) {\n this.createOrderAndItem(buyer_order_item_params, name, src)\n } else {\n this.createOrUpdateItem(this.state.buyer_order.id, buyer_order_item_params, name, src)\n }\n }\n\n updateRequestedOn(requested_on) {\n if (!this.state.buyer_order.id) {\n let buyer_order = this.state.buyer_order\n buyer_order.requested_on = requested_on\n this.setState({ buyer_order: buyer_order})\n }\n let payload = { id: this.state.buyer_order.id, requested_on: requested_on }\n PurchaseOrderService.update(payload).then(\n () => {\n\n }\n )\n }\n\n removeOrderItem(order_item_id) {\n PurchaseOrderItemService.destroy(order_item_id).then(() => {\n this.removeItemFromBuyerOrder(order_item_id)\n })\n }\n\n removeItemFromBuyerOrder(buyer_order_item_id) {\n let buyer_order = this.state.buyer_order\n let item_to_remove = _.find(buyer_order.buyer_order_items, { id: buyer_order_item_id })\n const new_buyer_order_items = _.without(buyer_order.buyer_order_items, item_to_remove)\n buyer_order.buyer_order_items = new_buyer_order_items\n this.setState({ buyer_order: buyer_order })\n }\n\n updateOrderItemQuantity(buyer_order_item_id, quantity) {\n const buyer_order_item = {\n id: buyer_order_item_id,\n quantity: quantity\n }\n PurchaseOrderItemService.update(buyer_order_item).then(\n (new_purchase_order_item) => {\n toast(\"Quantity updated\", { className: \"bg-success text-white\" })\n let buyer_order = this.state.buyer_order\n let item = _.find(buyer_order.buyer_order_items, { id: buyer_order_item_id })\n item.quantity = new_purchase_order_item.quantity\n item.subtotal = new_purchase_order_item.subtotal\n this.setState({ buyer_order: buyer_order })\n },\n (error) => { toast(error.message, { className: \"bg-danger text-white\" }) }\n )\n }\n\n renderCart() {\n if (!this.props.seller.accepting_orders || !this.state.buyer_order.id) { return }\n return (\n \n )\n }\n\n render() {\n const fetcher = (page, batch, params) => {\n if ( this.props.private_catalog_id ) {\n return CatalogFetcher.queryCatalog(\n this.props.seller.id,\n this.props.private_catalog_id,\n page,\n batch,\n params\n )\n } else {\n return CatalogFetcher.queryAvailable(\n this.props.seller.id,\n page,\n batch,\n params\n )\n }\n }\n\n return (\n \n )\n }\n}\nexport default OrderCatalog","import React from \"react\"\nimport { AddToCart } from \"./AddToCart\"\nimport { ProductUnitPrice } from \"./ProductUnitPrice\"\nimport { ProductUnitDeposit } from \"./ProductUnitDeposit\"\nimport classNames from \"classnames\"\n\nexport default class Product extends React.Component {\n constructor(props) {\n super(props)\n this.state = { expanded: props.expanded }\n }\n\n toggle() {\n this.props.openGallery(this.props.index)\n return\n }\n\n showDiscountIndicator() {\n const product = this.props.product\n return product.discount_price && Number(product.discount_price) < Number(product.price)\n }\n\n renderProducerCity() {\n const product = this.props.product\n\n if (product.city && product.state) {\n return (\n
\n { product.city }, { product.state }\n
\n )\n } else {\n return (\n
\n Farther Afield\n
\n )\n }\n }\n\n renderProducerName() {\n if (!this.props.showProducer) { return }\n const product = this.props.product\n return (\n
\n { product.producer_name }\n
\n )\n }\n\n renderProductImage() {\n if (!this.props.showImage) { return }\n const product = this.props.product\n\n const imageContainerClassNames = classNames(\n 'product-image',\n 'list',\n 'image-container',\n { 'temporarily-unavailable': !!product.unavailable_type },\n product.unavailable_type,\n { 'discount': this.showDiscountIndicator() }\n )\n\n var image = this.props.product.product_photo.small_url\n return (\n
\n \n
\n )\n }\n\n renderNote() {\n if (!this.props.product.note) { return }\n\n return (\n
\n \n { this.props.product.note}\n
\n )\n }\n\n\n renderListProduct() {\n const product = this.props.product\n\n return (\n
\n
\n
\n
{ this.renderProductImage() }
\n
\n
\n
\n
\n { this.renderProducerName() }\n { this.renderProducerCity() }\n
\n
\n { product.name }\n
\n
\n {this.props.product.unit}\n
\n
\n \n
\n { this.renderNote() }\n
\n { product.description }\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n )\n }\n\n renderGridProduct() {\n var product = this.props.product\n var product_unit = this.props.product\n var image = this.props.product.product_photo.small_url\n\n const imageContainerClassNames = classNames(\n 'product-image',\n 'grid',\n 'image-container',\n { 'temporarily-unavailable': !!product.unavailable_type },\n product.unavailable_type,\n { 'discount': this.showDiscountIndicator() }\n )\n\n const productContainerClasses = classNames(\n 'product-card', 'grid',\n { 'unavailable': product_unit.unavailable_type == 'indefinite' }\n )\n\n return (\n
\n
\n
\n
\n \n
\n
\n
\n { this.renderProducerName() }\n { this.renderProducerCity() }\n
\n
\n {this.props.product.name}\n
\n
\n {this.props.product.unit}\n
\n
\n \n
\n \n { this.renderNote() }\n
\n
\n
\n \n
\n
\n
\n )\n }\n\n render() {\n if (this.props.type == \"list\") {\n return this.renderListProduct()\n } else {\n return this.renderGridProduct()\n }\n }\n}\n","import React from \"react\"\nimport Product from \"./Product\"\nimport ahoy from \"ahoy.js\";\nimport { SearchBar } from \"./SearchBar\"\nimport { ProductGallery } from \"./ProductGallery\"\nimport { DeliveryDatePicker } from \"./DeliveryDatePicker\"\nimport { ToastContainer } from 'react-toastify'\nimport { isTomorrow } from \"../../services/Utils\"\nimport { UncontrolledTooltip } from \"reactstrap\"\nimport classNames from \"classnames\"\nimport _ from \"lodash\"\n\nvar catalog_cache = {\n products: [],\n meta: null\n}\n\nexport class ProductCatalog extends React.Component {\n constructor(props) {\n super(props)\n }\n\n render () {\n return (\n
\n \n \n
\n )\n }\n}\n\nexport class Catalog extends React.Component {\n constructor(props) {\n super(props)\n\n this.addItemToCart = this.addItemToCart.bind(this)\n this.changeLayoutToList = this.changeLayoutToList.bind(this)\n this.changeLayoutToGrid = this.changeLayoutToGrid.bind(this)\n this.openGallery = this.openGallery.bind(this)\n this.changeGalleryIndex = this.changeGalleryIndex.bind(this)\n this.closeGallery = this.closeGallery.bind(this)\n this.requestProductDetail = this.requestProductDetail.bind(this)\n this.toggleLocalOnly = this.toggleLocalOnly.bind(this)\n\n this.setSort = this.setSort.bind(this)\n this.toggleFilters = this.toggleFilters.bind(this)\n this.setProducer = this.setProducer.bind(this)\n this.setRequestedOn = this.setRequestedOn.bind(this)\n\n this.toggleIsStocked = this.toggleIsStocked.bind(this)\n\n this.changeLayoutToListNoImages = this.changeLayoutToListNoImages.bind(this)\n this.search = this.search.bind(this)\n this.fetchProducts = _.debounce(this.fetchProducts, 500)\n\n this.grid = \"grid\"\n this.list = \"list\"\n this.listNoImg = \"list-no-img\"\n\n let isStocked = false\n\n if (isTomorrow(this.props.requestedOn)) {\n isStocked = true\n }\n\n this.state = {\n showGallery: false,\n layout: this.grid,\n pageCount: 1,\n currentPage: 1,\n batchSize: 24,\n requestedOn: this.props.requestedOn || '',\n filters: {\n search: '',\n isStocked: isStocked,\n sortBy: 'popularity',\n categories: [],\n collection: null,\n subcollection: null,\n collections: [],\n producers: (this.props.selectedProducerId ? [Number(this.props.selectedProducerId)] : []),\n localOnly: false,\n empty: true\n },\n productCount: this.props.preloaded_products.length,\n loadingResults: false,\n pagedProducts: {}\n }\n }\n\n initialProductRequest() {\n let params = this.buildParams()\n const page = 1\n\n this.props\n .fetcher(page, this.state.batchSize, params || {})\n .then(productBatch => {\n const productCount = productBatch.length\n if (productCount < this.state.batchSize) {\n this.setState({ pageCount: 1, productCount: productCount })\n } else {\n this.requestProductCount(params)\n }\n this.loadProducts(productBatch, page)\n })\n }\n\n addItemToCart(buyer_order_item_params, name, src) {\n ahoy.track(\"Add to Cart\", { order_item: buyer_order_item_params, filters: this.state.filters })\n this.props.addItem(buyer_order_item_params, name, src)\n }\n\n openGallery(index) {\n ahoy.track(\"Open Gallery\", { index: index, filters: this.state.filters })\n this.requestProductDetail(index)\n this.setState({showGallery: true, index: index})\n }\n\n changeGalleryIndex(index) {\n const currentPageProducts = this.state.pagedProducts[this.state.currentPage] || []\n const modulus = currentPageProducts.length\n const newIndex = ((index % modulus) + modulus) % modulus // JS positive modulus\n this.requestProductDetail(newIndex)\n this.setState({index: newIndex})\n }\n\n closeGallery() {\n this.setState({showGallery: false})\n }\n\n requestProductDetail(index) {\n const pagedProducts = this.state.pagedProducts\n const products = pagedProducts[this.state.currentPage] || []\n const product = products[index]\n this.props.fetcher(1, 10, { productSlug: product.product_slug }).then(\n (response) => {\n pagedProducts[this.state.currentPage][index].otherProducts = response\n this.setState({ pagedProducts: pagedProducts })\n }\n )\n }\n\n requestProductCount(searchParams) {\n searchParams.count = true\n this.props.fetcher(null, null, searchParams).then(\n (response) => {\n const newPageCount = Math.ceil(response.count / this.state.batchSize)\n this.setState({ pageCount: newPageCount, productCount: response.count })\n }\n )\n }\n\n buildParams() {\n let params = {}\n const filters = this.state.filters\n if ( this.props.buyer_id )\n params.buyerId = this.props.buyer_id\n params.text = filters.search\n params.categories = filters.categories\n params.collections = filters.collections\n params.producers = filters.producers\n params.localOnly = filters.localOnly\n params.isStocked = filters.isStocked\n params.requestedOn = filters.requestedOn\n params.sortBy = filters.sortBy\n\n return params\n }\n\n requestProducts(page) {\n let params = this.buildParams()\n page = page || 1\n\n this.props\n .fetcher(page, this.state.batchSize, params)\n .then(productBatch => {\n this.loadProducts(productBatch, page)\n })\n }\n\n componentDidMount() {\n this.loadProducts(this.props.preloaded_products, 1)\n if (this.props.startTerm) {\n this.search(this.props.startTerm)\n }\n }\n\n fetchProducts() {\n if (this.validSearch()) {\n this.setState({ pageCount: 0, currentPage: 1, pagedProducts: {}, loadingResults: true }, () => {\n this.initialProductRequest()\n })\n } else if (!this.state.filters.search.text) {\n this.setState({ pagedProducts: {}, currentPage: 1, pageCount: 1 }, () => { this.loadProducts(this.props.preloaded_products, 1) })\n }\n }\n\n // load an array of products\n loadProducts(addedProducts, page) {\n let pagedProducts = this.state.pagedProducts\n pagedProducts[page] = addedProducts\n this.setState({ pagedProducts: pagedProducts, loadingResults: false, currentPage: page })\n }\n\n changeSearchTerm(newSearchTerm) {\n let filters = this.state.filters\n const previousSearchTerm = filters.search\n filters.search = newSearchTerm\n this.setState({ filters: filters })\n if ( newSearchTerm.trim() == previousSearchTerm.trim() ){ return }\n // wait until the user pauses for more than 500 ms\n setTimeout(() => {\n this.search(newSearchTerm.trim())\n }, 500)\n }\n\n search(term) {\n let filters = this.state.filters\n if (term == '') {\n this.setState({ pagedProducts: {}, currentPage: 1, pageCount: 1 }, () => { this.loadProducts(this.props.preloaded_products, 1) })\n } else {\n filters.categories = []\n filters.collections = []\n filters.producers = []\n filters.collection = null\n filters.subcollection = null\n this.setState({ showFilters: false,\n loadingResults: true,\n filters: filters }, this.fetchProducts)\n }\n }\n\n validSearch() {\n return (\n this.state.filters.localOnly ||\n this.state.filters.isStocked ||\n this.state.filters.search.length > 2 ||\n this.state.filters.categories.length > 0 ||\n this.state.filters.collections.length > 0 ||\n this.state.filters.producers.length > 0\n )\n }\n\n changePage(event) {\n const desiredPage = event.target.value\n\n if (this.state.currentPage !== desiredPage) {\n if (!this.state.pagedProducts[desiredPage]) {\n this.requestProducts(desiredPage)\n } else {\n this.setState({ currentPage: desiredPage })\n }\n }\n var element = document.getElementById('products');\n var headerOffset = 90;\n var elementPosition = element.getBoundingClientRect().top;\n var offsetPosition = elementPosition + window.pageYOffset - headerOffset;\n\n window.scrollTo({top: offsetPosition, behavior: \"smooth\" })\n }\n\n toggleFilters() {\n this.setState({ showFilters: !this.state.showFilters })\n }\n\n changeFilters(filters) {\n this.setState({ filters: filters, loadingResults: true }, this.fetchProducts)\n }\n\n setCategory(category) {\n let filters = this.state.filters\n if (filters.categories.length === 1 && filters.categories[0] == category) {\n filters.categories = []\n } else {\n filters.categories = [category]\n }\n\n\n this.changeFilters(filters)\n }\n\n setCollection(collectionSlug) {\n let filters = this.state.filters\n if (this.state.filters.collection == collectionSlug) {\n filters.collection = null\n filters.subcollection = null\n filters.collections = []\n filters.search = ''\n } else {\n filters.collection = collectionSlug\n filters.subcollection = null\n filters.collections = [collectionSlug]\n filters.search = ''\n }\n this.changeFilters(filters)\n }\n\n setSubcollection(subcollection, collection) {\n let filters = this.state.filters\n filters.subcollection = subcollection\n if (collection)\n filters.collection = collection\n filters.search = ''\n filters.collections = [subcollection]\n this.changeFilters(filters)\n }\n\n setSort(event) {\n ahoy.track(\"Catalog Sort\", { sortBy: event.target.value })\n\n let filters = this.state.filters\n filters.sortBy = event.target.value\n\n this.changeFilters(filters)\n }\n\n setProducer(event) {\n let filters = this.state.filters\n\n filters.producers = event.target.value ? [new Number(event.target.value)] : []\n\n this.changeFilters(filters)\n }\n\n setRequestedOn(event) {\n this.setState({ requestedOn: event.currentTarget.value })\n this.props.updateRequestedOn(event.currentTarget.value)\n\n const newIsStocked = isTomorrow(event.currentTarget.value)\n let filters = this.state.filters\n filters.isStocked = newIsStocked\n this.changeFilters(filters)\n }\n\n toggleLocalOnly() {\n let filters = this.state.filters\n filters.localOnly = !filters.localOnly\n\n this.changeFilters(filters)\n }\n\n toggleIsStocked() {\n let filters = this.state.filters\n filters.isStocked = !filters.isStocked\n\n this.changeFilters(filters)\n }\n\n renderPageTabs() {\n var tabs = []\n\n const starting = this.state.currentPage < 5 ? 0 : this.state.currentPage - 3\n const len = Math.min(starting + 5, this.state.pageCount)\n\n if (starting > 0) {\n tabs.push(\n
\n \n First Page\n \n
\n )\n }\n\n for (var i = starting; i < len; i++) {\n const val = i + 1\n\n tabs.push(\n
\n \n {val}\n \n
\n )\n }\n\n if (len < this.state.pageCount) {\n tabs.push(\n
\n \n Last Page\n \n
\n )\n }\n\n return
{tabs}
\n }\n\n changeLayoutToList() {\n ahoy.track(\"Layout Change\", { language: \"JavaScript\", layout: 'list' });\n this.setState({ layout: this.list })\n }\n\n changeLayoutToGrid() {\n ahoy.track(\"Layout Change\", { language: \"JavaScript\", layout: 'grid' });\n this.setState({ layout: this.grid })\n }\n\n changeLayoutToListNoImages() {\n ahoy.track(\"Layout Change\", { language: \"JavaScript\", layout: 'list no images' });\n this.setState({ layout: this.listNoImg })\n }\n\n renderLayoutButtons() {\n var layout = this.state.layout\n\n const changeLayoutGridButtonClass = classNames({\n \"btn\": true,\n \"btn-sm\": true,\n \"mr-2\": true,\n \"btn-success\": layout === this.grid,\n \"btn-secondary\": layout !== this.grid\n })\n\n const changeLayoutListButtonClass = classNames({\n \"btn\": true,\n \"btn-sm\": true,\n \"mr-2\": true,\n \"btn-success\": layout === this.list,\n \"btn-secondary\": layout !== this.list\n })\n\n const changeLayoutListNoImagesButtonClass = classNames({\n \"btn\": true,\n \"btn-sm\": true,\n \"mr-2\": true,\n \"btn-success\": layout === this.listNoImg,\n \"btn-secondary\": layout !== this.listNoImg\n })\n\n return (\n
\n \n \n
\n \n \n \n
\n \n
\n \n )\n }\n\n renderProductList(pagedProducts) {\n let index = 0\n return pagedProducts.map(\n (product) => {\n return (\n \n )\n }\n )\n }\n\n renderNoResults() {\n const loadedPageCount = Object.keys(this.state.pagedProducts).length\n if (this.state.loadingResults || loadedPageCount !== 0) { return }\n return (\n
No Results
\n )\n }\n\n renderSearchNotifier() {\n if ( this.validSearch() && !this.state.loadingResults ) {\n const filters = this.state.filters\n\n const category_list = filters.categories.map(\n (id) => { return _.find(this.props.categories, { id: id }).name}\n )\n let collectionName;\n if ( this.state.filters.subcollection ) {\n var collection = _.find(this.props.collections, { slug: this.state.filters.collection })\n collectionName = _.find(collection.current_children, { slug: this.state.filters.subcollection }).name\n } else if ( this.state.filters.collection ) {\n collectionName = _.find(this.props.collections, { slug: this.state.filters.collection }).name\n }\n\n const producer_list = filters.producers.map(\n (id) => { return _.find(this.props.producers, { id: id }).name }\n )\n\n const terms = category_list.concat(producer_list)\n if (this.state.filters.search) {\n terms.push(this.state.filters.search)\n }\n if (collectionName) {\n terms.push(collectionName)\n }\n\n\n if (filters.localOnly) {\n terms.push(\"Local Only\")\n }\n if (filters.isStocked) {\n const today = new Date()\n const tomorrow = new Date(today)\n tomorrow.setDate(tomorrow.getDate() + 1)\n let day = tomorrow.toLocaleDateString('en-US', { weekday: 'long' });\n if ( day == 'Sunday' ) { day = 'Monday' }\n terms.push(`Delivers ${ day }`)\n }\n const productCount = this.state.productCount\n\n const message = terms.join('\", \"')\n const start = 1 + (this.state.currentPage - 1) * this.state.batchSize\n const currentEnd = Math.min(start + this.state.batchSize - 1, productCount)\n const count = `${start} to ${currentEnd}`\n\n let countMsg\n if (productCount == 0) {\n countMsg = 'There are no'\n } else if (this.state.currentPage == 1 && productCount == currentEnd) {\n countMsg = `Showing all ${productCount}`\n } else {\n countMsg = `Showing ${count} of ${productCount}`\n }\n\n return (\n
\n {`${countMsg} products matching \"${message}\"`}\n
\n )\n } else if (!this.validSearch() && this.state.filters.search != \"\") {\n return (
Please enter at least 3 characters
)\n } else {\n return (
)\n }\n }\n\n renderWaitSpinner() {\n if (this.state.loadingResults && this.validSearch() ) {\n return (\n
\n \n
\n )\n }\n }\n\n renderOrderDeadlineText() {\n return (\n
{this.props.seller.ordering_message}
\n )\n }\n\n renderSellerLogo() {\n const seller = this.props.seller\n let logoContent = (

{ seller.name }

)\n if (seller.logo_url) {\n logoContent = ()\n }\n return (\n
\n { logoContent }\n
\n )\n }\n\n renderCategoryToggles() {\n if (this.props.categories.length < 2) { return }\n return this.props.categories.map( (category) => {\n var classes = classNames({\n 'category-clicker': true,\n \"active\": this.state.filters.categories[0] == category.id\n })\n\n return (\n
this.setCategory(category.id) }>\n { category.name }\n
\n )\n })\n }\n\n renderCollections() {\n return (\n
\n
\n { this.renderCollectionToggles() }\n
\n
\n )\n }\n\n renderCollectionToggles() {\n if (this.props.collections.length < 2) { return }\n return this.props.collections.map( (collection) => {\n var collectionClasses = classNames({\n 'collection-clicker': true,\n \"active\": this.state.filters.collection == collection.slug\n })\n\n var children = []\n if ( collection.slug == this.state.filters.collection ) {\n children = collection.current_children.map( (child_collection) => {\n var subcollectionClasses = classNames({\n 'ml-3': true,\n 'subcollection-clicker': true,\n \"active\": this.state.filters.subcollection == child_collection.slug\n })\n return (\n
this.setSubcollection(child_collection.slug) }>\n { child_collection.name }\n
\n )\n })\n }\n\n return (\n
\n
this.setCollection(collection.slug) }>\n { collection.name }\n \n
\n { children }\n
\n )\n })\n }\n\n renderIsStocked() {\n if ( !this.state.filters.isStocked ) { return }\n\n return (\n
\n \n In Stock Items Only\n \n \n Only in stock items are available for delivery tomorrow\n \n
\n )\n }\n\n renderProducers() {\n const producerOptions = this.props.producers.map((producer) => {\n return \n })\n\n return (\n
\n \n \n
\n )\n }\n\n renderRequestFor() {\n const dates_on = Object.values(this.props.requested_on_options || {})\n const count_on = dates_on.filter((element) => element === true).length\n if ( count_on == 0 ) { return }\n\n return \n }\n\n renderDownload() {\n if ( !this.props.showPricing ) { return }\n\n return (\n \n )\n }\n\n renderLocalOnlyToggle() {\n return (\n
\n \n \n
\n )\n }\n\n renderSort() {\n if ( !this.validSearch()) { return }\n return (\n \n )\n }\n\n render() {\n const layout = this.state.layout\n const pagedProducts = this.state.pagedProducts[this.state.currentPage] || []\n\n var sidebarToggleClass = classNames({\n 'd-md-block py-md-3 pb-3': true,\n 'd-none': !this.state.showFilters\n })\n\n return (\n
\n \n\n
\n
\n { this.renderSellerLogo() }\n
\n
\n
\n { this.renderOrderDeadlineText() }\n
\n
\n
\n \n
\n
{this.props.cart}
\n
\n { this.renderSearchNotifier() }\n
\n
\n\n
\n \n\n
\n
\n
\n { this.renderNoResults() }\n
\n\n
\n \n
\n
\n
\n { this.renderLayoutButtons() }\n
\n
\n { this.renderSort() }\n
\n
\n
\n
\n { this.renderProductList(pagedProducts) }\n
\n { this.renderWaitSpinner() }\n { this.renderPageTabs() }\n
\n
\n
\n )\n }\n}\n","import React from \"react\"\nimport { asCurrency } from \"../../services/Utils\"\nimport Hammer from 'react-hammerjs';\nimport { AddToCart } from \"./AddToCart\"\nimport { ProductUnitPrice } from \"./ProductUnitPrice\"\n\nexport class ProductGallery extends React.Component {\n constructor(props) {\n super(props)\n\n this.handleSwipe = this.handleSwipe.bind(this)\n }\n\n componentDidMount() {\n window.addEventListener(\"keydown\", this.handleKeyPress.bind(this))\n }\n\n componentWillUnmount() {\n window.removeEventListener(\"keydown\", this.handleKeyPress.bind(this))\n }\n\n handleKeyPress(event) {\n const key = event.keyCode\n\n if (!this.props.visible) return\n\n if (key == 39)\n // right\n this.next()\n else if (key == 37)\n // left\n this.previous()\n else if (key == 27)\n // esc\n this.props.closeGallery()\n }\n\n handleSwipe(event) {\n if (event.direction == 2) { this.next() }\n else if ( event.direction == 4) { this.previous() }\n }\n\n next() {\n this.props.changeGalleryIndex(this.props.index + 1)\n }\n\n previous() {\n this.props.changeGalleryIndex(this.props.index - 1 )\n }\n\n render() {\n if (!this.props.visible || !this.props.product_unit) { return (
) }\n\n return (\n
\n
{ event.stopPropagation() } }>\n
\n
\n \n
\n
\n {this.renderDisplay()}\n
\n
\n )\n }\n\n renderIndividualUnitPrice(product_unit) {\n if ( !this.props.showPricing || !product_unit.individual_unit_name) { return }\n if ( product_unit.individual_unit_price == product_unit.price ) { return }\n return (\n
\n { asCurrency(product_unit.individual_unit_price) } / { product_unit.individual_unit_name }\n
\n )\n }\n\n renderProductUnits(other_product_units) {\n const otherUnits = other_product_units.map( (product_unit) => {\n if ( product_unit.id == this.props.product_unit.id ) { return }\n return (\n
\n
{ product_unit.unit }
\n
\n
\n
\n \n
\n
\n
\n )\n })\n if (otherUnits.filter(Boolean).length) {\n return (\n
\n
OTHER UNITS
\n { otherUnits }\n
\n )\n }\n }\n\n renderDisplay() {\n const product_unit = this.props.product_unit\n const rightarrow = (\n
\n \n
\n )\n\n const leftarrow = (\n
\n \n
\n )\n\n let city_state_tag\n if (product_unit.city && product_unit.state) {\n city_state_tag = (\n
\n {product_unit.city}, {product_unit.state}\n
\n )\n }\n\n var image = (product_unit.product_photo || {}).large_url\n return (\n
\n
\n { leftarrow }\n
\n \n \n \n
\n { rightarrow }\n
\n
\n
\n
\n
\n {product_unit.producer_name}\n
\n
{ city_state_tag }
\n
\n
\n { product_unit.name }\n
\n
\n { product_unit.unit }\n
\n
\n \n
\n { this.renderIndividualUnitPrice(product_unit) }\n
\n { product_unit.description}\n
\n
\n
\n \n
\n
\n
\n { this.renderProductUnits(product_unit.otherProducts || []) }\n
\n
\n
\n
\n )\n }\n}\n","import React from \"react\"\nimport { asCurrency } from \"../../services/Utils\"\n\nexport class ProductUnitDeposit extends React.Component {\n constructor(props) {\n super(props)\n }\n\n render() {\n const product_unit = this.props.product_unit\n if (Number(product_unit.deposit) == 0) { return '' }\n return (\n
\n \n { `+${ asCurrency(product_unit.deposit) } refundable deposit` }\n
\n )\n }\n}\n","import React from \"react\"\nimport { asCurrency } from \"../../services/Utils\"\nimport { UncontrolledTooltip } from \"reactstrap\"\n\nexport class ProductUnitPrice extends React.Component {\n constructor(props) {\n super(props)\n }\n\n showDiscountPrice() {\n\n const product_unit = this.props.product_unit\n return product_unit.discount_price && Number(product_unit.discount_price) < Number(product_unit.price)\n }\n\n renderDiscountUnitPrice() {\n const product_unit = this.props.product_unit\n if ( !this.showDiscountPrice() ) { return }\n const discountUnitPrice = asCurrency(product_unit.discount_unit_price)\n\n return ` ${ discountUnitPrice }`\n }\n\n renderDiscountPrice() {\n const product_unit = this.props.product_unit\n if ( !this.showDiscountPrice() ) { return }\n const discountPrice = asCurrency(product_unit.discount_price)\n\n return ` ${ discountPrice }`\n }\n\n renderCatchWeight() {\n const product_unit = this.props.product_unit\n const unit = product_unit.catch_weight_unit == 'pound' ? 'lb' : product_unit.catch_weight_unit\n const formattedUnitPrice = asCurrency(product_unit.catch_weight_unit_price)\n const formattedPrice = asCurrency(product_unit.discount_price ? product_unit.discount_price : product_unit.price)\n\n return (\n \n \n { formattedUnitPrice }\n \n { this.renderDiscountUnitPrice() }\n / { unit }\n \n \n { `Est. ${ formattedPrice } total. Actual size and price on final invoice.` }\n \n \n )\n }\n\n render() {\n if (!this.props.showPricing) { return '' }\n\n const product_unit = this.props.product_unit\n\n if (!product_unit.catch_weight_unit_price) {\n return (\n \n \n { asCurrency(product_unit.price) }\n \n { this.renderDiscountPrice() }\n \n )\n } else {\n return this.renderCatchWeight()\n }\n }\n}\n","import React from \"react\"\nimport { ProductCatalog } from \"./ProductCatalog\"\nimport { CatalogFetcher } from \"../../services/CatalogFetcher\"\n\nexport class PublicCatalog extends React.Component {\n constructor(props) {\n super(props)\n }\n\n render() {\n const fetcher = (page, batch, params) => {\n return CatalogFetcher.queryPublic(\n this.props.seller.slug,\n page,\n batch,\n params\n )\n }\n\n return (\n \n )\n }\n}\nexport default PublicCatalog","import React from \"react\"\n\n// a smart input for hnits of a product\n// Usage; \nexport class QuantityInput extends React.Component {\n constructor(props) {\n super(props)\n\n this.upperLimit = props.maximum || 100\n\n this.state = {\n value: props.initial || \"\"\n }\n }\n\n handleChange(event) {\n const newval = parseInt(event.target.value)\n\n if ((!isNaN(newval) && newval <= this.upperLimit) || newval === \"\") {\n this.setState({\n value: newval\n })\n\n if (this.props.onChange && newval > 0)\n this.props.onChange(this.props.unitId, newval)\n } else {\n this.setState({})\n }\n }\n\n reset() {\n this.setState({\n value: \"0\"\n })\n }\n\n render() {\n var options = []\n\n for (var i = this.props.minimum || 1; i <= this.upperLimit; i++) {\n options.push(\n \n )\n }\n\n return (\n \n {options}\n \n )\n }\n}\n","import React from \"react\"\nimport Fuse from 'fuse.js'\nimport ahoy from \"ahoy.js\";\n\nexport class SearchBar extends React.Component {\n constructor(props) {\n super(props)\n\n const options = {\n includeScore: true,\n threshold: 0.2,\n keys: [ { name: 'name', weight: 0.5 },\n { name: 'subname', weight: 0.5 } ]\n }\n const children = this.props.collections.flatMap((x) => {\n return x.current_children.map((y) => {\n return {slug: x.slug,\n name: x.name,\n subslug: y.slug,\n subname: y.name }\n })\n })\n this.pickCollection = this.pickCollection.bind(this)\n this.onChange = this.onChange.bind(this)\n\n const all = this.props.collections.concat(children)\n\n this.fuse = new Fuse(all, options)\n }\n\n pickCollection(parentSlug, slug) {\n if ( parentSlug ) { this.props.setCollection(parentSlug) }\n if ( slug ) { this.props.setSubcollection(slug, parentSlug) }\n const props = { language: \"JavaScript\", slug: slug, parentSlug: parentSlug, term: this.props.value }\n ahoy.track(\"Collection Search Click\", props);\n this.setState({ value: ''})\n }\n\n onChange(event) {\n const term = event.target.value\n this.props.onChange(term)\n }\n\n renderMatchingCollections() {\n const items = this.fuse.search(this.props.value).slice(0,5)\n\n const collections = items.flatMap((x) => x.item )\n if (collections.length == 0) { return (
) }\n\n return (\n
{\n collections.map((collection) => {\n return (\n \n )\n })}\n
\n )\n\n }\n\n\n render() {\n return (\n
\n
\n \n
\n { this.renderMatchingCollections() }\n
\n )\n }\n}\n","import React from \"react\"\nimport { UncontrolledTooltip } from \"reactstrap\"\nimport { formatDate } from \"../../services/Utils\"\n\nexport class Forecast extends React.Component {\n constructor(props) {\n super(props)\n }\n\n renderForecastUpArrow(forecast) {\n const arrowClass = forecast.in_qty > 0 ? 'fa fa-caret-up fa-2x text-success' : 'fa'\n const arrow = \n\n return (\n
\n { arrow }\n
\n )\n }\n\n renderForecastDownArrow(forecast) {\n const arrowClass = forecast.out_qty > 0 ? 'fa fa-caret-down fa-2x text-danger' : 'fa'\n const arrow = \n\n return (\n
\n { arrow }\n
\n )\n }\n\n // match with ForecastHelper#forecast_styling\n forecastStyling(forecast) {\n if (forecast.close_qty < 0) {\n return 'border border-danger text-danger font-weight-bold'\n } else if (forecast.is_sequence) {\n return 'bg-warning'\n } else if (forecast['issue?']) {\n return 'alert-danger'\n } else if (forecast.is_replenishment) {\n return 'border border-info small'\n } else {\n return 'text-muted small'\n }\n }\n\n renderForecast() {\n const multiplier = this.props.product_unit.split_multiplier || 1\n const forecasts = this.props.forecast.forecasts\n const forecast_columns = forecasts.map((forecast_day) => {\n const quantity = forecast_day.stocked_qty * multiplier\n let openOrder\n if (forecast_day.earliest_draft_po) {\n const title = `Draft PO: ${ formatDate(forecast_day.earliest_draft_po) }`\n const id = `tooltip-${ forecast_day.id }`\n openOrder =
\n { title }\n
\n } else {\n openOrder =
\n }\n\n return (\n \n { this.renderForecastUpArrow(forecast_day) }\n
\n { parseFloat(Number(quantity).toFixed(3)) }\n
\n { this.renderForecastDownArrow(forecast_day) }\n { openOrder }\n \n )\n })\n return (\n \n { forecast_columns }\n \n )\n }\n\n renderHeader() {\n const dateOptions = { timeZone: 'UTC', weekday: 'short', month: 'numeric', day: 'numeric' }\n const headers = this.props.forecast.forecasts.map((forecast_day) => {\n const date = forecast_day.on\n const formattedDate = new Date(date).toLocaleDateString(\"en-US\", dateOptions).replace(',','').replace(' ', '\\n')\n return (\n \n { formattedDate }\n \n )\n })\n return (\n \n { headers }\n \n )\n }\n\n render() {\n if (!this.props.forecast ||this.props.forecast.forecasts.length == 0) {\n return (\n
\n
\n \n No forecast available\n
\n \n
\n )\n }\n return (\n
\n \n \n { this.renderHeader() }\n \n \n { this.renderForecast() }\n \n
\n \n \n \n \n View Alternatives\n \n\n
\n )\n }\n}\nexport default Forecast","import React from \"react\"\nimport { stripZeros } from '../../services/Utils'\n\nexport class OrderInfo extends React.Component {\n constructor(props) {\n super(props)\n }\n\n renderStatusIcon(status) {\n if (status == 'draft') {\n return (\n \n \n \n )\n } else {\n return (\n \n \n \n \n )\n }\n }\n\n renderDate(date) {\n if (date) {\n const options = { timeZone: 'UTC', weekday: 'short', month: 'numeric', day: 'numeric' }\n const formattedDate = new Date(date).toLocaleDateString(\"en-US\", options).replace(',','')\n return (\n \n \n { formattedDate }\n \n )\n } else {\n return (\n \n \n Date Not Set\n \n )\n }\n\n }\n\n render() {\n const order = this.props.order\n return (\n \n #{ order.id }\n { this.renderStatusIcon(order.status) }\n { this.renderDate(order.fulfillment_expected_on) }\n { stripZeros(order.total_quantity) } \n \n )\n }\n}\nexport default OrderInfo","import React from \"react\"\nimport Select, { components } from 'react-select';\nimport { asCurrency } from \"../../services/Utils\"\nimport { debounce } from \"lodash\"\n\nconst Option = (innerProps) => {\n const option = innerProps.data\n let availableIcon = ''\n if ( !option.published ) {\n availableIcon = (\n \n \n Currently Unavailable\n \n )\n } else if ( option.unavailable_until_description ) {\n availableIcon = (\n \n \n { option.unavailable_until_description }\n \n )\n }\n\n const mutedUnavailable = option.published ? \"select-option\" : \"select-option text-muted\"\n let minimum, maximum\n if (option.quantity_minimum > 1) {\n minimum = {`${option.quantity_minimum} minimum`}\n }\n if (option.quantity_maximum) {\n maximum = {`${option.quantity_maximum} maximum`}\n }\n let city_state_tag\n if (option.city && option.state) {\n city_state_tag = (\n\n \n •\n {option.city}, {option.state}\n \n )\n }\n\n const strikethroughClass = option.discount_price ? 'text-muted small text-strike' : ''\n let discountPrice;\n if ( option.discount_price ) {\n discountPrice = { asCurrency(option.discount_price)}\n }\n const children = (\n
\n
\n
\n \n
\n
\n
\n {option.producer_name}\n { city_state_tag }\n
\n
\n
\n
{option.name}
\n
{ option.unit }{ minimum }{ maximum }
\n
\n
\n
{ availableIcon }
\n { asCurrency(option.price) }\n { discountPrice }\n
\n
\n
\n
\n
\n )\n return \n}\n\nconst Input = (innerProps) => {\n return \n}\n\nconst SingleValue = (innerProps) => {\n const option = innerProps.data\n let minimum\n\n if (!option) {\n return (Nothing
}/>)\n }\n\n if (option.quantity_minimum > 1) {\n minimum = {`${option.quantity_minimum} minimum`}\n }\n const children = (\n \n { option.producer_name }\n { option.name }\n ({ option.unit })\n { minimum }\n \n )\n return \n}\n\n\nexport class ProductUnitSelect extends React.Component {\n constructor(props) {\n super(props)\n\n this.searchInput = React.createRef()\n this.refocus = this.refocus.bind(this)\n this.onChange = this.onChange.bind(this)\n this.onInputChange = this.onInputChange.bind(this)\n this.search = debounce(this.search, 500)\n\n this.state = { inputValue: \"\", options: [] }\n }\n\n onChange (product_unit) {\n this.props.onProductUnitSelected(product_unit)\n }\n\n search() {\n if (!this.state.inputValue) { this.setState({ options: [] }); return }\n let params = {\n text: this.state.inputValue,\n categories: [],\n producers: []\n }\n if ( this.props.buyer_id )\n params.buyerId = this.props.buyer_id\n\n this.setState({ isLoading: true })\n this.props.fetcher(this.props.seller_id, 1, 25, params)\n .then((products) => { this.setState({ options: products, isLoading: false }) })\n }\n\n\n onInputChange(input) {\n this.setState({ inputValue: input }, this.search)\n }\n\n filterOption(option) {\n // Do no filtering, just return all options\n return true\n }\n\n noOptionsMessage(option) {\n return option.inputValue ? \"No options\" : \"Type to see product units...\"\n }\n\n refocus() {\n this.searchInput.current.focus()\n }\n\n render () {\n return (\n {false} }\n onInputChange={ this.onInputChange }\n filterOption={ this.filterOption }\n maxMenuHeightnumber={400}\n isLoading={ this.state.isLoading }\n isClearable={ true }\n options={ this.state.options }\n />\n );\n }\n}\nexport default ProductUnitSelect","import React from \"react\"\n\nexport class QuantitySelect extends React.Component {\n constructor(props) {\n super(props)\n\n this.onChange = this.onChange.bind(this)\n this.closeOnTab = this.closeOnTab.bind(this)\n this.refocus = this.refocus.bind(this)\n this.quantityInput = React.createRef()\n this.negativePattern = new RegExp(this.props.allowDecimal ? /^-\\d*\\.?\\d*$/ : /^-[0-9]+$/)\n this.positivePattern = new RegExp(this.props.allowDecimal ? /^\\d*\\.?\\d*$/ : /^[0-9]+$/)\n\n this.state = { showMenu: false }\n }\n\n checkNumeric(value) {\n const numericPattern = this.props.onlyNegativeQuantity ? this.negativePattern : this.positivePattern\n return numericPattern.test(value)\n }\n\n onChange(event) {\n this.changeTo(event.target.value)\n }\n\n changeTo(newValue, closeMenu = true) {\n const isNumeric = this.checkNumeric(newValue)\n if (isNumeric || newValue === '' || newValue === '-') {\n this.setState({ showMenu: false || !closeMenu})\n this.props.onChange(newValue)\n }\n }\n\n refocus() {\n this.quantityInput.current.select()\n this.setState({ showMenu: false })\n }\n\n renderQuantityButtons() {\n const mult = this.props.onlyNegativeQuantity ? -1 : 1\n return (\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n )\n }\n\n closeOnTab(event) {\n var code = event.keyCode || event.which\n if (code == '9') {\n this.setState({showMenu: false})\n }\n }\n\n render() {\n const showMenu = this.state.showMenu ? 'show' : 'hide'\n const quantityAsNumber = Number(this.props.value)\n let inputClasses = \"form-control text-center integer-2 px-1 rounded\"\n if ( quantityAsNumber == 0 ) {\n inputClasses += ' alert-danger'\n }\n\n return (\n
\n
\n
\n
\n \n \n \n
\n { this.renderQuantityButtons() }\n
\n
\n { this.setState({showMenu: true})}}\n onKeyDown={this.closeOnTab}\n onChange={this.onChange}\n aria-label=\"Text input with segmented dropdown button\" />\n
\n )\n }\n}\n","import { HTTP } from \"./Connection\"\n\nexport class BuyerOrderService {\n\n static create (seller_id, buyer_id) {\n return new Promise((resolve, reject) => {\n const order = { buyer_id: buyer_id, seller_id: seller_id }\n const payload = { buyer_order: order }\n const url = \"/api/buyer_orders\"\n\n HTTP.post(url, payload).then(resolve, reject)\n })\n }\n\n static update (buyer_order) {\n return new Promise((resolve, reject) => {\n const payload = { buyer_order: buyer_order }\n const url = \"/api/buyer_orders/\" + buyer_order.id\n\n HTTP.put(url, payload).then(resolve, reject)\n })\n }\n}\n","import { HTTP } from \"./Connection\"\n\nexport class InventoryForecastService {\n\n static query (buyer_order_id) {\n return new Promise((resolve, reject) => {\n const path = `/api/buyer_orders/${ buyer_order_id }/inventory_forecasts`\n HTTP.get(path).then(resolve, reject)\n })\n }\n}\n","import { HTTP } from \"./Connection\"\n\nexport class OrderItemMoveService {\n static create (sales_order_item_id, move_attributes) {\n return new Promise((resolve, reject) => {\n const path = \"/api/buyer_order_items/\" + sales_order_item_id + \"/order_item_moves\"\n const payload = { order_item_move: move_attributes }\n HTTP.post(path, payload).then(resolve, reject)\n })\n }\n}\n","import React from \"react\"\nimport { SalesOrderItemEdit } from \"./SalesOrderItemEdit\"\nimport { SalesOrderItemNew } from \"./SalesOrderItemNew\"\nimport { OrderInfo } from \"./OrderInfo\"\nimport { BuyerOrderService } from \"../../services/BuyerOrderService\"\nimport { InventoryForecastService } from \"../../services/InventoryForecastService\"\nimport { OrderItemMoveService } from \"../../services/OrderItemMoveService\"\nimport { ToastContainer } from 'react-toastify'\n\n\nimport { asCurrency } from \"../../services/Utils\"\nimport _ from \"lodash\"\n\nexport class SalesOrderEdit extends React.Component {\n constructor(props) {\n super(props)\n\n this.onItemCreate = this.onItemCreate.bind(this)\n this.onItemDestroy = this.onItemDestroy.bind(this)\n this.onItemUpdate = this.onItemUpdate.bind(this)\n this.onNewItemSubtotalUpdate = this.onNewItemSubtotalUpdate.bind(this)\n this.onChangeBuyerOrder = this.onChangeBuyerOrder.bind(this)\n this.changeOrder = this.changeOrder.bind(this)\n this.changeSortMethod = this.changeSortMethod.bind(this)\n this.save = _.debounce(this.save, 1000)\n this.toggleName = this.toggleName.bind(this)\n this.toggleForecast = this.toggleForecast.bind(this)\n\n let buyer_order = props.buyer_order\n buyer_order.discount = asCurrency(buyer_order.discount)\n\n this.state = {\n forecasts: {},\n showForecast: false,\n open_orders: this.props.open_orders,\n sortMethod: buyer_order.status == 'draft' ? 'time-added' : 'name',\n buyer_order: buyer_order,\n newItemSubtotal: 0\n }\n }\n\n save() {\n const buyer_order = this.state.buyer_order\n\n const scrubbed_buyer_order = {\n discount: buyer_order.discount.replace('$', ''),\n id: buyer_order.id,\n name: buyer_order.name,\n note_from_seller: buyer_order.note_from_seller,\n note_from_buyer: buyer_order.note_from_buyer\n }\n\n BuyerOrderService.update(scrubbed_buyer_order).then((buyer_order) => {\n if (buyer_order) { this.setState({buyer_order: buyer_order}) }\n },\n (error) => { toast(error.message, { className: \"bg-danger text-white\" }) }\n )\n }\n\n changeSortMethod(value) {\n this.setState({ sortMethod: value })\n }\n\n changeOrder(order_item_id, move_type, new_order_id, notes, reason) {\n let move_attributes = { move_type: move_type, notes: notes, reason: reason }\n if (new_order_id) {\n move_attributes.to_order_id = new_order_id\n }\n OrderItemMoveService.create(order_item_id, move_attributes).then((response) => {\n const to_order = response.to_order\n let open_orders = this.state.open_orders\n let indexToReplace = _.findIndex(open_orders, { id: to_order.id })\n if (indexToReplace == -1) {\n open_orders.push(to_order)\n } else {\n open_orders[indexToReplace] = to_order\n }\n this.setState({ open_orders: open_orders })\n if ( move_type == 'move' ) {\n this.onItemDestroy(order_item_id)\n } else if ( move_type == 'backorder ') {\n\n let buyer_order = this.state.buyer_order\n let item_to_replace = _.find(buyer_order.buyer_order_items, { id: order_item_id })\n item_to_replace.quantity = 0\n\n this.setState({ buyerOrder: buyer_order, showAdvanced: false})\n }\n })\n }\n\n onChangeBuyerOrder(event) {\n let buyer_order = this.state.buyer_order\n buyer_order[event.target.name] = event.target.value\n this.setState({ buyer_order: buyer_order }, this.save)\n }\n\n onItemCreate(buyer_order_item) {\n let buyer_order = this.state.buyer_order\n buyer_order.buyer_order_items.push(buyer_order_item)\n this.setState({ buyer_order: buyer_order, newItemSubtotal: 0 })\n }\n\n onItemDestroy(order_item_id) {\n let buyer_order = this.state.buyer_order\n let item_to_remove = _.find(buyer_order.buyer_order_items, { id: order_item_id })\n const new_buyer_order_items = _.without(buyer_order.buyer_order_items, item_to_remove)\n buyer_order.buyer_order_items = new_buyer_order_items\n this.setState({ buyer_order: buyer_order })\n }\n\n onItemUpdate(new_buyer_order_item) {\n let buyer_order = this.state.buyer_order\n let indexToReplace = _.findIndex(buyer_order.buyer_order_items, { id: new_buyer_order_item.id })\n buyer_order.buyer_order_items[indexToReplace] = new_buyer_order_item\n this.setState({ buyer_order: buyer_order })\n }\n\n onNewItemSubtotalUpdate(newItemSubtotal) {\n this.setState({ newItemSubtotal: newItemSubtotal })\n }\n\n toggleName() {\n this.setState({ showName: !this.state.showName })\n }\n\n toggleForecast() {\n if ( this.state.showForecast ) {\n this.setState({ showForecast: false })\n } else {\n this.setState({ loadingForecast: true }, () => {\n InventoryForecastService.query(this.props.buyer_order.id).then((result) => {\n this.setState({forecasts: result, loadingForecast: false, showForecast: true})\n })\n })\n }\n }\n\n calculateTotalDeposit() {\n const buyer_order = this.state.buyer_order\n const buyer_order_items = buyer_order.buyer_order_items\n const deposit_subtotals = buyer_order_items.map((buyer_order_item) => Number(buyer_order_item.deposit_subtotal))\n return deposit_subtotals.reduce((a,b) => a + b, 0)\n }\n\n calculateTotal() {\n const buyer_order = this.state.buyer_order\n const buyer_order_items = buyer_order.buyer_order_items\n const subtotals = buyer_order_items.map((buyer_order_item) => Number(buyer_order_item.subtotal))\n\n const deposit_subtotal = this.calculateTotalDeposit()\n const buyer_order_items_total = subtotals.reduce((a,b) => a + b, 0)\n\n return \"\" + (buyer_order_items_total + deposit_subtotal - buyer_order.overpayment_credit - Number(buyer_order.discount.replace('$', '')))\n }\n\n renderItemRows() {\n const productUnitCounts = _.countBy(this.state.buyer_order.buyer_order_items, (order_item) => {\n return order_item.product_unit_id\n })\n\n const items = _.filter(this.state.buyer_order.buyer_order_items, { 'add_after_subtotal': false })\n if (items.length === 0) {\n return (\n
\n
\n There are no items in this order\n
\n
\n )\n } else {\n let sortedItems;\n if ( this.state.sortMethod == 'time-added') {\n sortedItems = _.sortBy(items, (item) => { return item.created_at })\n } else {\n sortedItems = _.sortBy(items, (item) => { return item.product_unit.product_name })\n }\n return (\n sortedItems.map((order_item) => {\n var forecast_product_unit_id = order_item.product_unit.split_product_unit_id\n forecast_product_unit_id = forecast_product_unit_id || order_item.product_unit_id\n return (\n \n )\n })\n )\n }\n }\n\n renderAfterSubtotalRows() {\n const items = _.filter(this.state.buyer_order.buyer_order_items, { 'add_after_subtotal': true })\n return (\n items.map((order_item) => {\n return (\n \n )\n })\n )\n }\n\n renderSubtotalRow() {\n const after_items = _.filter(this.state.buyer_order.buyer_order_items, { 'add_after_subtotal': true })\n if (after_items.length == 0 && this.calculateTotalDeposit() == 0) { return }\n\n const items = _.filter(this.state.buyer_order.buyer_order_items, { 'add_after_subtotal': false })\n const subtotal = _.sumBy(items, (item) => Number(item.subtotal) )\n return (\n
\n
\n
Subtotal
\n
{ asCurrency(subtotal) }
\n
\n
\n )\n }\n\n renderOverpaymentRow() {\n const buyer_order = this.state.buyer_order\n if (buyer_order.overpayment_credit == 0) { return }\n return (\n \n )\n }\n\n renderDiscountRow() {\n if ( this.state.buyer_order.discount == '$0.00' ) { return }\n return (\n
\n
\n Discount\n \n
\n
\n )\n }\n\n renderDepositRow() {\n const total = this.calculateTotalDeposit()\n if ( total == 0 ) { return }\n return (\n
\n
\n
\n
Deposit
\n
{ asCurrency(total) }
\n
\n
\n
\n )\n }\n\n renderTotalRow() {\n const total = this.calculateTotal()\n return (\n
\n
\n
\n
\n Total\n
\n
\n { asCurrency(total) }\n
\n
\n
\n
\n )\n }\n\n renderName() {\n if (this.state.buyer_order.name.endsWith('.xml')) {\n return (
From filename: { this.state.buyer_order.name }
)\n }\n let purchaseOrderName\n let buttonText = \"Set\"\n if (this.state.showName) {\n buttonText = \"Done\"\n purchaseOrderName = (\n \n )\n } else if (this.state.buyer_order.name) {\n buttonText = \"Change\"\n purchaseOrderName = (\n { this.state.buyer_order.name }\n )\n }\n return (\n
\n
\n Purchase Order ID for Invoice: \n
\n
\n { purchaseOrderName }\n
\n
\n \n { buttonText }\n \n
\n
\n )\n }\n\n renderButton() {\n const warningClass = this.props.contactCount === 0 ? ' badge-warning' : ''\n if (this.state.buyer_order.credit) {\n return (\n
\n \n \n
\n \n
\n
\n )\n } else {\n return (\n
\n \n \n
\n \n
\n
\n )\n }\n }\n\n renderSubmitButton() {\n const buyer_order = this.state.buyer_order\n if (buyer_order.status != \"draft\" || (buyer_order.buyer_order_items.length == 0 && this.calculateTotal() == 0)) { return }\n return (\n
\n \n \n \n \n \n { this.renderButton() }\n \n
\n )\n }\n\n renderForecastButton(){\n if ( this.props.isPurchaseOrder ) { return }\n\n const forecastActive = this.state.showForecast ? ' active' : ''\n const icon = this.state.loadingForecast ? 'fa fa-spinner fa-pulse' : 'fa fa-chart-bar'\n return (\n \n \n \n )\n }\n\n renderSortButtons() {\n const timeActive = this.state.sortMethod == 'time-added' ? ' active' : ''\n const nameActive = this.state.sortMethod == 'name' ? ' active' : ''\n return (\n \n \n \n \n \n \n \n \n )\n }\n\n renderOrderButtons() {\n if (!this.state.open_orders) { return }\n if (this.state.open_orders.length == 0) {\n return \n } else if (this.state.open_orders.length == 1 ) {\n const path = '/admin/sales_orders/' + this.state.open_orders[0].id + '/edit'\n return (\n \n Also open:\n \n \n )\n } else {\n const orderLinks = this.state.open_orders.map((order) => {\n const path = '/admin/sales_orders/' + order.id + '/edit'\n return (\n \n \n \n )\n })\n return (\n
\n \n
\n { orderLinks }\n
\n
\n )\n }\n }\n\n render() {\n return (\n
\n \n
\n
\n \n
\n { /*
*/ }\n
Qty
\n
\n
\n Item\n { this.renderSortButtons() }\n { this.renderForecastButton() }\n
\n
\n { this.renderOrderButtons() }\n
\n
\n
\n
Unit Price
\n
Subtotal
\n
\n
\n
\n { this.renderItemRows() }\n { this.renderSubtotalRow() }\n { this.renderDepositRow() }\n { this.renderDiscountRow() }\n { this.renderOverpaymentRow() }\n { this.renderAfterSubtotalRows() }\n { this.renderTotalRow() }\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n { this.renderName() }\n { this.renderSubmitButton() }\n \n
\n )\n }\n}\nexport default SalesOrderEdit","import React from \"react\"\nimport { asCurrency, formatDate } from \"../../services/Utils\"\nimport { ChangeOrderService } from \"../../services/ChangeOrderService\"\n\n\nimport { OrderInfo } from \"./OrderInfo\"\nimport { Forecast } from \"./Forecast\"\nimport { SalesOrderItemService } from \"../../services/SalesOrderItemService\"\nimport { QuantitySelect } from \"./QuantitySelect\"\nimport classNames from \"classnames\"\nimport { debounce } from \"lodash\"\nimport { UncontrolledTooltip } from \"reactstrap\"\nimport { toast } from \"react-toastify\"\n\nexport class SalesOrderItemEdit extends React.Component {\n constructor(props) {\n super(props)\n\n this.onChangeQuantity = this.onChangeQuantity.bind(this)\n this.onDelete = this.onDelete.bind(this)\n this.changeOrder = this.changeOrder.bind(this)\n this.onMoveRadioChanged = this.onMoveRadioChanged.bind(this)\n\n this.toggleAdvanced = this.toggleAdvanced.bind(this)\n this.changeSalesOrderItem = this.changeSalesOrderItem.bind(this)\n this.changePriceOverride = this.changePriceOverride.bind(this)\n this.changeSubtotalOverride = this.changeSubtotalOverride.bind(this)\n\n this.copyInternalNote = this.copyInternalNote.bind(this)\n this.save = debounce(this.save, 1000)\n\n this.state = {\n moveRadio: 'backorder-inventory',\n moveType: 'backorder',\n sales_order_item: props.sales_order_item,\n status: 'waiting'\n }\n }\n\n changeOrder(event) {\n let sales_order_item = this.state.sales_order_item\n const existingOrderId = Number(event.currentTarget.name)\n const notes = sales_order_item.note_from_seller\n const moveType = this.state.moveType\n const reason = this.state.reason\n if (moveType == 'backorder') {\n let errorMessages = []\n if ( sales_order_item.quantity == 0 )\n errorMessages.push('the line item requires a quantity')\n if (!notes)\n errorMessages.push('add a note from seller')\n if ( errorMessages.length != 0 ) {\n const message = errorMessages.join(', ')\n this.setState({ errorMessage: `To backorder please ${ message }`})\n return\n }\n sales_order_item.quantity = 0\n }\n this.props.changeOrder(sales_order_item.id, moveType, existingOrderId, notes, reason)\n this.setState({ sales_order_item: sales_order_item, showAdvanced: false})\n }\n\n copyInternalNote(event) {\n let sales_order_item = this.state.sales_order_item\n sales_order_item.internal_seller_note = event.target.value\n this.setState({sales_order_item: sales_order_item}, this.save)\n }\n\n onMoveRadioChanged(event) {\n const newMoveRadio = event.target.value\n let newStateValues = { moveRadio: newMoveRadio }\n if (newMoveRadio == 'move' ) {\n newStateValues.moveType = 'move'\n newStateValues.reason = undefined\n } else if (newMoveRadio == 'backorder-inventory' ) {\n newStateValues.moveType = 'backorder'\n newStateValues.reason = 'inventory'\n } else if (newMoveRadio == 'backorder-deadline' ) {\n newStateValues.moveType = 'backorder'\n newStateValues.reason = 'deadline'\n } else if (newMoveRadio == 'backorder-other' ) {\n newStateValues.moveType = 'backorder'\n newStateValues.reason = 'deadline'\n }\n this.setState(newStateValues)\n }\n\n onDelete() {\n const sales_order_item = this.props.sales_order_item\n\n return SalesOrderItemService.destroy(sales_order_item.id).then(\n (new_sales_order_item) => { this.props.deletedSalesOrderItem(sales_order_item.id) },\n (error) => {\n this.setState({ status: 'failed' })\n toast(error.message, { className: \"bg-danger text-white\" })\n }\n )\n }\n\n onChangeQuantity(newQuantity) {\n let sales_order_item = this.state.sales_order_item\n if (newQuantity) { sales_order_item.quantity = newQuantity }\n const nextStatus = newQuantity == '' ? 'waiting' : 'sending'\n sales_order_item.quantity = newQuantity\n this.setState({ sales_order_item: sales_order_item, status: 'sending' }, this.save)\n }\n\n save() {\n let sales_order_item = this.state.sales_order_item\n return SalesOrderItemService.update(sales_order_item).then((new_sales_order_item) => {\n sales_order_item.calculated_subtotal = new_sales_order_item.calculated_subtotal\n sales_order_item.effective_unit_price = new_sales_order_item.effective_unit_price\n sales_order_item.deposit_average = new_sales_order_item.deposit_average\n sales_order_item.deposit_subtotal = new_sales_order_item.deposit_subtotal\n sales_order_item.original_subtotal = new_sales_order_item.original_subtotal\n sales_order_item.subtotal = new_sales_order_item.subtotal\n\n this.setState({ sales_order_item: sales_order_item, status: 'waiting' })\n this.props.updatedSalesOrderItem(new_sales_order_item)\n },\n (error) => {\n this.setState({ status: 'failed' })\n toast(error.message, { className: \"bg-danger text-white\" })\n }\n )\n }\n\n toggleAdvanced() {\n this.setState({ showAdvanced: !this.state.showAdvanced })\n }\n\n changePriceOverride(event) {\n let sales_order_item = this.state.sales_order_item\n sales_order_item[event.target.name] = event.target.value\n sales_order_item['subtotal_override'] = null\n this.setState({ sales_order_item: sales_order_item, status: 'sending' }, this.save)\n }\n\n changeSubtotalOverride(event) {\n let sales_order_item = this.state.sales_order_item\n sales_order_item[event.target.name] = event.target.value\n sales_order_item['price_override'] = null\n this.setState({ sales_order_item: sales_order_item, status: 'sending' }, this.save)\n }\n\n changeSalesOrderItem(event) {\n let sales_order_item = this.state.sales_order_item\n sales_order_item[event.target.name] = event.target.value\n this.setState({ sales_order_item: sales_order_item, status: 'sending' }, this.save)\n }\n\n renderDeleteButton() {\n if (!this.state.showAdvanced) { return }\n return (\n
\n \n \n \n
\n )\n }\n\n renderSticky(lineId, iconLetter, tooltipText) {\n const id = `tooltip-${ lineId }-${ iconLetter }`\n return (\n
\n \n \n { iconLetter }\n \n \n { tooltipText }\n \n
\n )\n }\n\n renderNoteInput() {\n let internalNote\n if (!this.props.isPurchaseOrder) {\n internalNote = (\n
\n { this.renderSticky(this.state.sales_order_item.id, '', 'Internal Note')}\n
\n
\n { this.renderReasonDropdown() }\n \n
\n
\n
\n )\n }\n\n return (\n
\n
\n { this.renderSticky(this.state.sales_order_item.id, 'S', 'Note from seller') }\n
\n \n
\n
\n
\n { this.renderSticky(this.state.sales_order_item.id, 'B', 'Note from buyer')}\n
\n \n
\n
\n { internalNote }\n
\n )\n }\n\n renderMove() {\n const open_orders = this.props.open_orders\n if ( open_orders == undefined ) { return }\n const sales_order_item = this.state.sales_order_item\n\n const draftOrderButtons = open_orders.map((open_order) => {\n return (\n \n \n \n )\n })\n\n return (\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n { this.state.errorMessage }\n \n
\n
\n \n { draftOrderButtons }\n
\n )\n }\n\n renderCatchWeightDescription() {\n const sales_order_item = this.state.sales_order_item\n if (!sales_order_item.actual_unit_price) { return }\n const catch_weight = sales_order_item.actual_quantity\n const unit = sales_order_item.product_unit.catch_weight_unit\n const item_unit = (unit == 'pound' ? 'lbs' : unit)\n const denominatorUnit = (unit == 'pound' ? 'lb' : unit)\n const rate = asCurrency(sales_order_item.actual_unit_price)\n\n const warningClass = classNames({\n \"text-danger\": !sales_order_item.actual_quantity\n })\n\n return (\n
\n \n { `Actual: ${catch_weight || 'TBD'} ${item_unit} × ${rate} / ${denominatorUnit}` }\n \n
\n )\n }\n\n renderAdvancedEdit() {\n if (!this.state.showAdvanced) { return }\n return (\n
\n { this.renderNoteInput() }\n { this.renderMove() }\n
\n )\n }\n\n renderSellerNote() {\n if (!this.state.sales_order_item.note_from_seller || this.state.showAdvanced) { return }\n return (\n
\n { this.renderSticky(this.state.sales_order_item.id, 'S', 'Note from seller')}\n { this.state.sales_order_item.note_from_seller }\n
\n )\n }\n\n renderReasonDropdown() {\n\n if ( !this.props.commonInternalNotes ) { return }\n\n const reasonButtons = this.props.commonInternalNotes.map((reason) => {\n return (\n \n )\n })\n\n return (\n
\n
\n \n \n
\n { reasonButtons }\n
\n
\n
\n )\n }\n\n renderBuyerNote() {\n if (!this.state.sales_order_item.note_from_buyer || this.state.showAdvanced) { return }\n return (\n
\n { this.renderSticky(this.state.sales_order_item.id, 'B', 'Note from buyer')}\n { this.state.sales_order_item.note_from_buyer }\n
\n )\n }\n\n renderInternalSellerNote() {\n const sales_order_item = this.state.sales_order_item\n if (this.props.isPurchaseOrder || !sales_order_item.internal_seller_note || this.state.showAdvanced) { return }\n return (\n
\n { this.renderSticky(this.state.sales_order_item.id, '', 'Internal Seller Note')}\n { sales_order_item.internal_seller_note }\n
\n )\n }\n\n renderSubtotalOverride() {\n if (!this.state.showAdvanced) { return }\n const subtotal_override = this.state.sales_order_item.subtotal_override || ''\n const price_override = this.state.sales_order_item.price_override || ''\n return (\n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n
\n )\n }\n\n renderDepositOverride() {\n if (!this.state.showAdvanced) { return }\n const deposit_override = this.state.sales_order_item.deposit_override || ''\n return (\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n )\n }\n\n renderSubtotal() {\n const sales_order_item = this.state.sales_order_item\n let icon\n if ( sales_order_item.subtotal_override) {\n icon = \n }\n return (\n
\n { icon }{ asCurrency(sales_order_item.subtotal) }\n
\n )\n }\n\n renderUnitPrice() {\n const sales_order_item = this.state.sales_order_item\n let icon\n if (sales_order_item.price_override) {\n icon = \n }\n return (\n
\n { icon }{ asCurrency(sales_order_item.effective_unit_price) }\n
\n )\n }\n\n renderOriginalEffectivePrice() {\n const sales_order_item = this.state.sales_order_item\n if ( !sales_order_item.original_effective_price ) { return }\n\n return (\n
\n { asCurrency(sales_order_item.original_effective_price) }\n
\n )\n }\n\n renderDeposit() {\n const sales_order_item = this.state.sales_order_item\n if ( sales_order_item.deposit_average == 0 ) { return }\n\n return (\n
\n \n { asCurrency(sales_order_item.deposit_average) }\n
\n )\n }\n\n renderDepositSubtotal() {\n const sales_order_item = this.state.sales_order_item\n if ( Number(sales_order_item.deposit_subtotal) == 0 && !sales_order_item.deposit_override) { return }\n const overridden = !!sales_order_item.deposit_override\n let icon\n if (overridden) {\n icon = \n }\n return (\n
\n { icon }\n \n { asCurrency(sales_order_item.deposit_subtotal) }\n
\n )\n }\n\n renderOriginalSubtotal() {\n const sales_order_item = this.state.sales_order_item\n if ( !sales_order_item.original_subtotal ) { return }\n\n return (\n
\n { asCurrency(sales_order_item.original_subtotal) }\n
\n )\n }\n\n renderCatchWeightInput() {\n if (!this.state.showAdvanced) { return }\n if (!this.state.sales_order_item.actual_unit_price) { return }\n return (\n
\n \n
\n )\n }\n\n renderQuantity() {\n const sales_order_item = this.state.sales_order_item\n return (\n
\n \n { this.renderCatchWeightInput() }\n
\n )\n }\n\n renderDepositDescription() {\n if ( this.state.sales_order_item.deposit_average == 0 ) { return }\n\n let message\n if ( this.state.sales_order_item.deposit_average > 0 ) {\n message = 'This item has a refundable deposit'\n } else {\n message = 'Refundable deposit'\n }\n\n return (\n
\n \n { message }\n
\n )\n }\n\n renderProducerName() {\n if (!this.props.showProducerName) { return }\n\n const product_unit = this.props.sales_order_item.product_unit\n return (\n
{ product_unit.producer_name }
\n )\n }\n\n renderForecast() {\n if (this.props.showForecast) {\n return (\n \n )\n }\n }\n\n renderBackorder() {\n if (this.props.sales_order_item.src == 'checkout_item') {\n return (\n
\n Checkout Alternative\n
\n )\n }\n }\n renderSrc() {\n if (this.props.sales_order_item.src) {\n const color = this.props.sales_order_item.quantity == 0 ? 'badge-success' : 'badge-info'\n return (\n
\n Customer Backorder\n
\n )\n }\n }\n\n renderUnavailable() {\n const product_unit = this.props.sales_order_item.product_unit\n\n if (product_unit.unavailable_until) {\n var color = product_unit.unavailable_type == 'preorder' ? 'badge-success' : 'badge-warning'\n return (\n
\n \n \n { formatDate(product_unit.unavailable_until) }: {product_unit.unavailable_until_description }\n \n
\n )\n } else if (!product_unit.is_published) {\n return (\n
\n \n \n Currently Unavailable\n \n
\n )\n }\n }\n\n render() {\n const sales_order_item = this.props.sales_order_item\n const product_unit = sales_order_item.product_unit\n const buttonClass = this.state.showAdvanced ? 'btn-dark' : 'btn-outline-secondary'\n\n const status = this.state.status\n const rowClass = classNames({\n \"order-row\": true,\n \"py-2\": true,\n \"save-failed\": status === \"failed\",\n \"save-pending\": status === \"sending\",\n \"save-success\": status === \"success\"\n })\n\n let minimum\n if (product_unit.quantity_minimum > 1) {\n minimum = {`${product_unit.quantity_minimum} minimum`}\n }\n let maximum\n if (product_unit.quantity_maximum > 1) {\n maximum = {`${product_unit.quantity_maximum} maximum`}\n }\n let split\n if (product_unit.split_multiplier) {\n split = \n }\n\n let orderProductUnitCount\n if (this.props.orderProductUnitCount > 1) {\n const id = `order-multiple-${sales_order_item.id}`\n orderProductUnitCount = (\n \n { this.props.orderProductUnitCount }\n \n This product unit is on { this.props.orderProductUnitCount } line items in this order\n \n \n )\n }\n\n return (\n
\n
\n \n
\n
\n
\n { this.renderQuantity() }\n
\n { this.renderDeleteButton() }\n
\n
\n
\n
\n \n
\n
\n { this.renderProducerName() }\n
{ product_unit.product_name }
\n
{ product_unit.unit }{minimum}{maximum}{orderProductUnitCount}{split}
\n { this.renderCatchWeightDescription() }\n { this.renderDepositDescription() }\n { this.renderBackorder() }\n { this.renderUnavailable() }\n { this.renderSellerNote() }\n { this.renderBuyerNote() }\n { this.renderInternalSellerNote() }\n\n { this.renderForecast() }\n
\n
\n { this.renderAdvancedEdit() }\n
\n
\n
\n
\n { this.renderUnitPrice() }\n { this.renderOriginalEffectivePrice() }\n { this.renderDeposit() }\n
\n
\n { this.renderSubtotal() }\n { this.renderOriginalSubtotal() }\n { this.renderDepositSubtotal() }\n
\n
\n { this.renderSubtotalOverride() }\n { this.renderDepositOverride() }\n
\n
\n )\n }\n}\nexport default SalesOrderItemEdit","import React from \"react\"\nimport { asCurrency } from \"../../services/Utils\"\nimport { SalesOrderItemService } from \"../../services/SalesOrderItemService\"\nimport { QuantitySelect } from \"./QuantitySelect\"\nimport { ProductUnitSelect } from \"./ProductUnitSelect\"\nimport { CatalogFetcher } from \"../../services/CatalogFetcher\"\n\nexport class SalesOrderItemNew extends React.Component {\n constructor(props) {\n super(props)\n\n this.toggle = this.toggle.bind(this)\n this.onCreate = this.onCreate.bind(this)\n this.productUnitSelect = React.createRef()\n this.addButton = React.createRef()\n this.quantitySelect = React.createRef()\n this.onChangeQuantity = this.onChangeQuantity.bind(this)\n this.onProductUnitSelected = this.onProductUnitSelected.bind(this)\n this.notifyParentOfSubtotalChange = this.notifyParentOfSubtotalChange.bind(this)\n\n const initialQuantity = this.props.sales_order.credit ? -1 : 1\n this.state = {\n sales_order_item: { quantity: initialQuantity, buyer_order_id: this.props.sales_order.id }\n }\n }\n\n\n onCreate() {\n let sales_order_item = this.state.sales_order_item\n sales_order_item.src = 'sales_order_item_new'\n SalesOrderItemService.create(sales_order_item).then((new_sales_order_item) => {\n this.props.createdSalesOrderItem(new_sales_order_item)\n const initialQuantity = this.props.sales_order.credit ? -1 : 1\n this.setState({\n sales_order_item: { quantity: initialQuantity, buyer_order_id: this.props.sales_order.id },\n product_unit: null\n }, () => { this.quantitySelect.current.refocus() })\n })\n }\n\n toggle(event) {\n this.setState({ showUnavailable: !this.state.showUnavailable })\n }\n\n notifyParentOfSubtotalChange() {\n this.props.onSubtotalUpdate(this.calculateSubtotal())\n }\n\n onChangeQuantity(newValue) {\n let sales_order_item = this.state.sales_order_item\n sales_order_item.quantity = newValue\n this.setState({ sales_order_item: sales_order_item }, this.notifyParentOfSubtotalChange)\n }\n\n onProductUnitSelected(product_unit) {\n let sales_order_item = this.state.sales_order_item\n if (!product_unit) {\n delete sales_order_item['product_unit_id']\n this.setState({product_unit: undefined, sales_order_item: sales_order_item})\n return\n }\n sales_order_item.product_unit_id = product_unit.id\n\n if (!this.props.sales_order.credit && product_unit.quantity_minimum > sales_order_item.quantity) {\n sales_order_item.quantity = product_unit.quantity_minimum\n }\n this.setState({ product_unit: product_unit, sales_order_item: sales_order_item },\n () => { this.notifyParentOfSubtotalChange(); this.addButton.current.focus(); }\n )\n }\n\n renderQuantity() {\n const product_unit = this.state.product_unit || { quantity_minimum: 1 }\n return (\n \n )\n }\n\n renderUnitPrice() {\n const product_unit = this.state.product_unit\n if (!product_unit) { return }\n return (\n { asCurrency(product_unit.price) }\n )\n }\n\n calculateSubtotal() {\n const product_unit = this.state.product_unit\n if (!product_unit) { return 0 }\n return (this.state.sales_order_item.quantity * product_unit.price)\n }\n\n renderSubtotal() {\n const product_unit = this.state.product_unit\n if (!product_unit) { return }\n return (\n { asCurrency(\"\" + this.calculateSubtotal()) }\n )\n }\n\n render() {\n const product_unit = this.state.product_unit\n let rowClass = \"order-row list-group-item py-2 align-items-end\"\n let buttonClass\n if (product_unit) {\n buttonClass = \"btn-primary\"\n rowClass += ' bg-warning'\n } else {\n buttonClass = \"btn-primary disabled\"\n }\n return (\n
\n
\n
\n \n
\n
\n { this.renderQuantity() }\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n \n { product_unit ? 'Add Item To Order' : 'Search to Add Item'}\n \n \n
\n
\n
\n )\n }\n}\nexport default SalesOrderItemNew","import { Application } from \"@hotwired/stimulus\"\n\nconst application = Application.start()\n\n// Configure Stimulus development experience\napplication.debug = false\nwindow.Stimulus = application\n\nexport { application }\n","import { Controller } from '@hotwired/stimulus';\nimport { ajax } from '@rails/ujs'; // Ensure Rails UJS is installed and imported\n\nexport default class extends Controller {\n connect() {\n $(this.element).popover({\n delay: { show: 300, hide: 50 },\n trigger: 'manual',\n html: true\n });\n\n this.hoverState = null;\n this.timeout = null;\n\n this.element.addEventListener('mouseenter', this.showPopover.bind(this));\n this.element.addEventListener('mouseleave', this.hidePopover.bind(this));\n this.element.addEventListener('touchstart', this.showPopover.bind(this));\n this.element.addEventListener('touchleave', this.hidePopover.bind(this));\n\n // Bind Bootstrap's popover show event\n $(this.element).on('show.bs.popover', this.fetchPopoverContent.bind(this));\n }\n\n showPopover() {\n clearTimeout(this.timeout);\n this.hoverState = 'in';\n\n this.timeout = setTimeout(() => {\n if (this.hoverState === 'in') {\n $(this.element).popover('show');\n\n const popoverElement = document.querySelector('.popover');\n if (popoverElement) {\n popoverElement.addEventListener('mouseenter', this.cancelHidePopover.bind(this));\n popoverElement.addEventListener('mouseleave', this.startHidePopover.bind(this));\n }\n }\n }, 300); // Match the show delay\n }\n\n hidePopover() {\n clearTimeout(this.timeout);\n this.hoverState = 'out';\n\n this.timeout = setTimeout(() => {\n if (this.hoverState === 'out') {\n $(this.element).popover('hide');\n }\n }, 50); // Match the hide delay\n }\n\n cancelHidePopover() {\n clearTimeout(this.timeout);\n }\n\n startHidePopover() {\n this.hidePopover();\n }\n\n fetchPopoverContent() {\n const id = this.element.dataset.id;\n\n ajax({\n url: `/admin/product_units/${id}/order_items`,\n type: 'GET',\n dataType: 'script'\n });\n }\n\n disconnect() {\n $(this.element).popover('dispose');\n this.element.removeEventListener('mouseenter', this.showPopover.bind(this));\n this.element.removeEventListener('mouseleave', this.hidePopover.bind(this));\n $(this.element).off('show.bs.popover');\n }\n}","import { Controller } from '@hotwired/stimulus';\nimport \"bootstrap\"; // Ensure Bootstrap is imported\n\nexport default class extends Controller {\n connect() {\n var element = this.element\n $(element).popover();\n }\n\n disconnect() {\n // Clean up popovers when the controller is disconnected\n $(this.element).popover('dispose');\n }\n}","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class extends Controller {\n connect() {\n this.element.addEventListener(\"click\", this.clone.bind(this));\n }\n\n disconnect() {\n this.element.removeEventListener(\"click\", this.clone.bind(this));\n }\n\n clone() {\n const targetForm = this.element.closest('form');\n const cloneFrom = document.querySelector(this.element.dataset.clonerCloneFrom);\n if (targetForm && cloneFrom) {\n const clonedElement = cloneFrom.cloneNode(true);\n targetForm.append(clonedElement);\n }\n }\n}","// This file is auto-generated by ./bin/rails stimulus:manifest:update\n// Run that command whenever you add a new controller or create them with\n// ./bin/rails generate stimulus controllerName\n\nimport { application } from \"./application\"\n\nimport ProductUnitActivityPopoverController from \"./product_unit_activity_popover_controller\"\napplication.register(\"product-unit-activity-popover\", ProductUnitActivityPopoverController)\n\nimport SimplePopoverController from \"./simple_popover_controller\"\napplication.register(\"simple-popover\", SimplePopoverController)\n\nimport ClonerController from \"./cloner_controller\"\napplication.register(\"cloner\", ClonerController)\n","import \"core-js/stable\";\nimport 'regenerator-runtime/runtime'\n\nimport DataTable from 'datatables.net-bs4';\nimport 'datatables.net-bs4/css/dataTables.bootstrap4.css';\nimport 'datatables.net-fixedheader-dt';\nimport 'datatables.net-fixedheader-dt/css/fixedHeader.dataTables.css';\n$.fn.DataTable = DataTable;\n\nrequire(\"../src/datatables_init.js\")\n\nwindow.$ = window.jQuery = require('jquery');\n\nrequire(\"@rails/ujs\").start()\nglobal.Rails = Rails;\n\nimport 'bootstrap'\nrequire(\"../src/bootstrap_init.js\")\n\nimport Sortable from 'sortablejs'\nglobal.Sortable = Sortable;\n\nimport \"@hotwired/turbo-rails\"\n\nimport LocalTime from \"local-time\"\nLocalTime.start()\n\nimport \"chartkick/chart.js\"\nimport { Chart } from \"chart.js\"\nimport ChartDataLabels from 'chartjs-plugin-datalabels';\nChart.register(ChartDataLabels)\nChart.defaults.set('plugins.datalabels', {\n backgroundColor: 'rgba(0, 0, 0, 0)',\n font: { size: 0 }\n});\n\nrequire(\"../app/application.js\")\nrequire(\"../app/stripe_seller_add_card.js\")\nrequire(\"../app/stripe_seller_add_bank_account.js\")\nrequire(\"../app/stripe_buyer_setup_intent.js\")\n\nimport \"../controllers\"\nrequire(\"../css/application.scss\")\n\nimport '@selectize/selectize/dist/js/selectize.min.js'\nimport '@selectize/selectize/dist/css/selectize.bootstrap4.css'\n\nrequire(\"../src/chosen_init.js\")\n\nimport 'timepicker/jquery.timepicker'\nimport 'timepicker/jquery.timepicker.css'\n\nimport flatpickr from \"flatpickr\"\nimport 'flatpickr/dist/flatpickr.min.css'\nimport mapboxgl from \"mapbox-gl\"\nglobal.mapboxgl = mapboxgl\nimport 'mapbox-gl/dist/mapbox-gl.css';\n\nrequire(\"jquery-ui/ui/widgets/sortable\")\nrequire(\"jquery-ui-touch-punch/jquery.ui.touch-punch.min.js\")\n\nrequire(\"../src/ahoy.js\")\nrequire('jquery-sparkline/jquery.sparkline.min.js')\nrequire(\"../src/timeout_poll.js\")\nrequire(\"../src/date_range_picker.js\")\nrequire(\"../src/flatpickr.js\")\nrequire(\"../src/mapbox.js\")\nrequire(\"../src/market_sheet.js\")\nrequire(\"../src/deposits.js\")\nrequire(\"../src/selectall.js\")\nrequire(\"../src/sorting.js\")\nrequire(\"../src/table_to_csv.js\")\n\n// Support component names relative to this directory:\nvar componentRequireContext = require.context(\"../components\", true)\nvar ReactRailsUJS = require(\"react_ujs\")\nReactRailsUJS.useContext(componentRequireContext)\nReactRailsUJS.handleEvent('turbo:load', ReactRailsUJS.handleMount);\nReactRailsUJS.handleEvent('turbo:before-render', ReactRailsUJS.handleUnmount);\n\n","import { HTTP } from \"./Connection\"\n\nexport class CatalogFetcher {\n static queryPublic(sellerId, page, batchSize, params) {\n const base = \"/api/seller/\" + sellerId + '/public_products?'\n return CatalogFetcher.query(base, page, batchSize, params)\n }\n\n static queryAll(sellerId, page, batchSize, params) {\n const base = \"/api/sellers/\" + sellerId + \"/products/with_unavailable?\"\n return CatalogFetcher.query(base, page, batchSize, params)\n }\n\n static queryCatalog(sellerId, catalogId, page, batchSize, params) {\n params.catalogId = catalogId\n const base = \"/api/sellers/\" + sellerId + \"/products/?\"\n return CatalogFetcher.query(base, page, batchSize, params)\n }\n\n static queryAvailable(sellerId, page, batchSize, params) {\n const base = \"/api/sellers/\" + sellerId + \"/products/?\"\n return CatalogFetcher.query(base, page, batchSize, params)\n }\n\n static query(base, page, batchSize, params) {\n let buyer = \"\"\n let privateCatalog = \"\"\n let categoriesSearch = \"\"\n let collectionsSearch = \"\"\n let producersSearch = \"\"\n let textSearch = \"\"\n let productSlug = \"\"\n let count = \"\"\n let localOnly = \"\"\n let isStocked = \"\"\n let sortBy = \"\"\n let isFeatured = \"\"\n\n if ( params.categories && params.categories.length > 0 )\n categoriesSearch = \"&categories=\" + params.categories.join(\"|\")\n if ( params.producers && params.producers.length > 0 )\n producersSearch = \"&producers=\" + params.producers.join(\"|\")\n if ( params.collections && params.collections.length > 0 )\n collectionsSearch = \"&collections=\" + params.collections.join(\"|\")\n if ( params.count )\n count = \"&count=true\"\n if ( params.localOnly )\n localOnly = \"&local_only=true\"\n if ( params.buyerId )\n buyer = \"&buyer_id=\" + params.buyerId\n if ( params.catalogId )\n privateCatalog = \"&private_catalog_id=\" + params.catalogId\n if ( params.isStocked )\n isStocked = \"&is_stocked=true\"\n if ( params.isFeatured )\n isFeatured = \"&featured=true\"\n if ( params.productSlug )\n productSlug = \"&product_slug=\" + encodeURIComponent(params.productSlug)\n if ( params.text )\n textSearch = textSearch + \"&text=\" + encodeURIComponent(params.text)\n if ( params.sortBy )\n sortBy = sortBy + \"&sort_by=\" + params.sortBy\n\n return HTTP.get(\n base +\n \"page=\" +\n page +\n \"&per_page=\" +\n batchSize +\n categoriesSearch +\n collectionsSearch +\n privateCatalog +\n buyer +\n producersSearch +\n localOnly +\n isStocked +\n isFeatured +\n textSearch +\n productSlug +\n sortBy +\n count\n )\n }\n}\n","export class HTTP {\n static handleResponse(status, success, failure) {\n if (status >= 200 && status < 300) {\n success()\n } else if (\n (status >= 300 && status < 400) ||\n status == 401 ||\n status == 403\n ) {\n window.location.href = \"/users/sign_in?return_to=/app/\"\n } else {\n failure()\n }\n }\n\n static get(url) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest()\n xhr.open(\"GET\", url, true)\n xhr.onload = function() {\n var status = xhr.status\n HTTP.handleResponse(\n status,\n () => {\n resolve(JSON.parse(xhr.responseText))\n },\n () => {\n reject(JSON.parse(xhr.responseText))\n }\n )\n }\n xhr.send()\n })\n }\n\n static post(url, message) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest()\n xhr.open(\"POST\", url, true)\n xhr.setRequestHeader(\"Content-Type\", \"application/json\")\n\n xhr.onload = function() {\n let status = xhr.status\n\n HTTP.handleResponse(\n status,\n () => {\n resolve(JSON.parse(xhr.responseText))\n },\n () => {\n reject(JSON.parse(xhr.responseText))\n }\n )\n }\n\n xhr.send(JSON.stringify(message))\n })\n }\n\n static delete(url, message) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest()\n xhr.open(\"DELETE\", url, true)\n xhr.setRequestHeader(\"Content-Type\", \"application/json\")\n\n xhr.onload = function() {\n let status = xhr.status\n\n HTTP.handleResponse(\n status,\n () => {\n resolve(JSON.parse(xhr.responseText || null))\n },\n () => {\n reject(JSON.parse(xhr.responseText))\n }\n )\n }\n\n xhr.send()\n })\n }\n\n static put(url, message) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest()\n xhr.open(\"PUT\", url, true)\n xhr.setRequestHeader(\"Content-Type\", \"application/json\")\n\n xhr.onload = function() {\n let status = xhr.status\n HTTP.handleResponse(\n status,\n () => {\n resolve(JSON.parse(xhr.responseText || null))\n },\n () => {\n reject(JSON.parse(xhr.responseText))\n }\n )\n }\n\n xhr.send(JSON.stringify(message))\n })\n }\n}\n","import { HTTP } from \"./Connection\"\n\nexport class PurchaseOrderItemService {\n\n static update (purchase_order_item) {\n return new Promise((resolve, reject) => {\n const id = purchase_order_item.id\n HTTP.put(\"/api/purchase_order_items/\" + id, purchase_order_item).then(resolve, reject)\n })\n }\n\n static destroy (id) {\n return new Promise((resolve, reject) => {\n HTTP.delete(\"/api/purchase_order_items/\" + id).then(resolve, reject)\n })\n }\n\n static create (purchase_order_item) {\n return new Promise((resolve, reject) => {\n const url = \"/api/purchase_order_items\"\n HTTP.post(url, purchase_order_item).then(resolve, reject)\n })\n }\n}\n","import { HTTP } from \"./Connection\"\n\nexport class PurchaseOrderService {\n\n static create (buyer_id, seller_id, requested_on) {\n return new Promise((resolve, reject) => {\n const purchase_order = { purchase_order: { seller_id: seller_id,\n buyer_id: buyer_id,\n requested_on: requested_on } }\n const url = \"/api/purchase_orders\"\n\n HTTP.post(url, purchase_order).then(resolve, reject)\n })\n }\n\n static update (purchase_order) {\n return new Promise((resolve, reject) => {\n const payload = { purchase_order: purchase_order }\n const url = \"/api/purchase_orders/\" + purchase_order.id\n\n HTTP.put(url, payload).then(resolve, reject)\n })\n }\n}\n","import { HTTP } from \"./Connection\"\n\nexport class SalesOrderItemService {\n\n static update (sales_order_item) {\n return new Promise((resolve, reject) => {\n const id = sales_order_item.id\n HTTP.put(\"/api/buyer_order_items/\" + id, sales_order_item).then(resolve, reject)\n })\n }\n\n static destroy (id) {\n return new Promise((resolve, reject) => {\n HTTP.delete(\"/api/buyer_order_items/\" + id).then(resolve, reject)\n })\n }\n\n static create (sales_order_item) {\n return new Promise((resolve, reject) => {\n const url = \"/api/buyer_order_items\"\n HTTP.post(url, sales_order_item).then(resolve, reject)\n })\n }\n}\n","const { parseISO, format } = require('date-fns');\n\nexport function asCurrency(price) {\n const numericPrice = Number(price)\n const asCurrency = numericPrice.toLocaleString('en-US', { style: 'currency', currency: 'USD' })\n if (numericPrice < 0)\n return \"(\" + asCurrency.substr(1) + \")\"\n else\n return asCurrency\n}\n\nexport function isTomorrow(dateString) {\n const tomorrowDate = new Date();\n tomorrowDate.setDate(tomorrowDate.getDate() + 1)\n return dateString == tomorrowDate.toLocaleDateString('en-CA', { timeZone: \"America/New_York\" })\n}\n\nexport function isToday(dateString) {\n const tomorrowDate = new Date();\n tomorrowDate.setDate(tomorrowDate.getDate())\n return dateString == tomorrowDate.toLocaleDateString('en-CA', { timeZone: \"America/New_York\" })\n}\n\nexport function stripZeros(numberString) {\n const numericNumber = Number(numberString)\n return parseFloat(numericNumber.toFixed(4));\n}\n\nexport function formatDate(dateString) {\n const date = parseISO(dateString);\n const formattedDate = format(date, 'EEE M/d');\n return formattedDate;\n}","import ahoy from 'ahoy.js';\n\n// override defaults\nahoy.configure({\n visitsUrl: \"/ahoyyy/visits\",\n eventsUrl: \"/ahoyyy/events\"\n})\n\ndocument.addEventListener(\"turbo:load\", function(){\n ahoy.trackClicks(\".dataTable th\");\n});\n","document.addEventListener(\"turbo:load\", function(){\n $('[data-toggle=\"tooltip\"]').tooltip()\n $('.modal.start-open').modal('show')\n});\n\ndocument.addEventListener(\"turbo:before-cache\", function() {\n $('.tooltip.show').remove()\n});\n","document.addEventListener(\"turbo:load\", function(){\n $(function () {\n $(\".chosen-select:not([multiple]\").selectize({ onDropdownOpen: function () {\n this.clear();\n }, selectOnTab: false, allowEmptyOption: true });\n $('.chosen-select[multiple=\"multiple\"]').selectize({ plugins: ['remove_button'], selectOnTab: false, allowEmptyOption: true });\n });\n\n $(\"#existing-order-checker\").selectize({\n onDropdownOpen: function () { this.clear() },\n selectOnTab: false,\n allowEmptyOption: true,\n onChange: function(value) {\n if (value) {\n var path = this.$input.data('path')\n $.get(path, {'buyer_order[buyer_id]':value}, null, 'script' );\n }\n }\n });\n $(\"#chooseAllBuyerCategories\").on('click', function() {\n var options = Object.values($('#buyer_category_id')[0].selectize.options)\n options.sort((a, b) => { return a.$order - b.$order; });\n var optionsArray = options.map(function(obj) { return obj.value })\n var selectized = $('#buyer_category_id')[0].selectize\n selectized.setValue(optionsArray)\n })\n\n $(\"#chooseNoBuyerCategories\").on('click', function() {\n $('#buyer_category_id')[0].selectize.setValue([])\n })\n\n $(\"#chooseAllBuyers\").on('click', function() {\n var options = Object.values($('#buyer_id')[0].selectize.options)\n options.sort((a, b) => { return a.$order - b.$order; });\n var optionsArray = options.map(function(obj) { return obj.value })\n var selectized = $('#buyer_id')[0].selectize\n selectized.setValue(optionsArray)\n })\n\n $(\"#chooseNoBuyers\").on('click', function() {\n $('#buyer_id')[0].selectize.setValue([])\n })\n\n $(\"#chooseAllProducers\").on('click', function() {\n var options = Object.values($('#producer_id')[0].selectize.options)\n options.sort((a, b) => { return a.$order - b.$order; });\n var optionsArray = options.map(function(obj) { return obj.value })\n var selectized = $('#producer_id')[0].selectize\n selectized.setValue(optionsArray)\n })\n\n $(\"#chooseNoProducers\").on('click', function() {\n $('#producer_id')[0].selectize.setValue([])\n })\n $(\"#chooseAllCategories\").on('click', function() {\n var options = Object.values($('#category_id')[0].selectize.options)\n options.sort((a, b) => { return a.$order - b.$order; });\n var optionsArray = options.map(function(obj) { return obj.value })\n var selectized = $('#category_id')[0].selectize\n selectized.setValue(optionsArray)\n })\n $(\"#chooseNoCategories\").on('click', function() {\n $('#category_id')[0].selectize.setValue([])\n })\n\n $(\"#chooseNoSellers\").on('click', function() {\n $('#seller_id')[0].selectize.setValue([])\n })\n $(\"#chooseAllSellers\").on('click', function() {\n var options = Object.values($('#seller_id')[0].selectize.options)\n options.sort((a, b) => { return a.$order - b.$order; });\n var optionsArray = options.map(function(obj) { return obj.value })\n var selectized = $('#seller_id')[0].selectize\n selectized.setValue(optionsArray)\n })\n\n $(\"#chooseMktSellers\").on('click', function(event) {\n var ids = event.target.dataset.ids.split(',')\n var selectized = $('#seller_id')[0].selectize\n\n for (var i = 0; i < ids.length; i++) {\n selectized.addItem(ids[i]);\n }\n })\n});\n\ndocument.addEventListener(\"turbo:before-cache\", function(){\n $('.selectized').each(function () {\n this.selectize.destroy();\n var selectedOption = this.querySelector(\"option[selected]\");\n // destroying removes the selected value, so we have to manually reset it\n if (selectedOption) {\n this.value = selectedOption.value;\n } else if (!this.multiple) {\n this.value = this.options[0].value;\n }\n });\n});\n","document.addEventListener(\"turbo:load\", function(){\n var datatable = $('table.datatable-init').DataTable({ stateSave: true })\n $('#outside-filter-input').on('keyup', function() {\n datatable.api().search($(this).val()).draw();\n });\n\n document.addEventListener(\"turbo:before-cache\", function() {\n datatable.api().destroy()\n })\n});\n","document.addEventListener(\"turbo:load\", function(){\n $(document).on('change', '#range-name-select', function(event) {\n if (event.target.value == 'custom_dates') {\n $(this).closest('.range-name-picker').find('.collapse').collapse('show');\n } else {\n $(this).closest('.range-name-picker').find('.collapse').collapse('hide');\n }\n })\n});","document.addEventListener('turbo:load', () => {\n const inputs = document.querySelectorAll('#deposits-list input[type=checkbox]');\n\n for (let i = 0; i < inputs.length; i++) {\n const input = inputs[i];\n\n input.addEventListener('change', (event) => {\n const totalElement = document.querySelector('#deposit-total')\n const total = parseFloat(totalElement.innerHTML.replace(/[^0-9.-]+/g,\"\"))\n let change = Number(event.target.getAttribute('data-value'))\n\n if (!event.target.checked) { change = -change }\n const newTotal = total + change\n\n const formatted = newTotal.toLocaleString('en-US', { style: 'currency', currency: 'USD' })\n totalElement.innerHTML = formatted\n });\n }\n})\n","document.addEventListener('turbo:load', () => {\n var flatpickr_options = {\n altInput: true,\n altFormat: \"D M j Y\",\n dateFormat: \"Ymd\"\n }\n flatpickr('.flatpickr-init', flatpickr_options)\n})\n\ndocument.addEventListener('turbo:load', () => {\n var flatpickr_options = {\n enableTime: true,\n altInput: true,\n altFormat: \"D M j Y @ h:i K\",\n dateFormat: \"Z\"\n }\n flatpickr('.flatpickr-init-show-time', flatpickr_options)\n})\n\ndocument.addEventListener('turbo:load', () => {\n var flatpickr_options = {\n multiple: true\n }\n flatpickr('.flatpickr-init-multiple', flatpickr_options)\n})\n\ndocument.addEventListener('turbo:load', () => {\n var flatpickr_options = {\n enableTime: true,\n altInput: true,\n altFormat: \"D M j Y @ h:i K\",\n dateFormat: \"YmdHiS\"\n }\n flatpickr('.flatpickr-init-new-show-time', flatpickr_options)\n})\n\ndocument.addEventListener('turbo:load', () => {\n var flatpickr_options = {\n inline: true,\n onChange: function(selectedDates, dateStr, instance) {\n var form = document.querySelector('#expected-on-form');\n Rails.fire(form, \"submit\")\n },\n onDayCreate: function(dObj, dStr, fp, dayElem) {\n var highlightDays = JSON.parse(fp.element.dataset.schedule || null)\n if (highlightDays.indexOf(dayElem.dateObj.toISOString().slice(0,10)) !== -1) {\n dayElem.className += \" route-available\";\n }\n }\n }\n flatpickr('.expected-on-picker-init', flatpickr_options)\n})\n\ndocument.addEventListener('turbo:load', () => {\n var flatpickr_options = {\n minDate: 'today',\n inline: true,\n onChange: function(selectedDates, dateStr, instance) {\n var input = instance._input;\n var form = $(input).closest('form')[0];\n Rails.fire(form, \"submit\")\n }\n }\n flatpickr('.new-po-picker-init', flatpickr_options)\n})\n\ndocument.addEventListener('turbo:load', () => {\n var flatpickr_options = {\n inline: true,\n dateFormat: \"Ymd\",\n onChange: function(selectedDates, dateStr, instance) {\n var input = instance._input;\n var form = $(input).closest('form')[0];\n Rails.fire(form, \"submit\")\n }\n }\n flatpickr('.submit-on-date-picked', flatpickr_options)\n})\n\ndocument.addEventListener('turbo:load', () => {\n $('#main').on('show.bs.dropdown', '.available-on-dropdown', function () {\n var flatpickr_options = {\n inline: true,\n minDate: 'today',\n dateFormat: \"Ymd\"\n }\n flatpickr('.available-on-picker-init', flatpickr_options)\n })\n})\n\ndocument.addEventListener('turbo:load', () => {\n $('#main').on('show.bs.dropdown', '#expires-on-edit-dropdown', function () {\n var flatpickr_options = {\n inline: true,\n altInput: true,\n altFormat: \"D M j Y\",\n dateFormat: \"Ymd\"\n }\n flatpickr('.expires-on-picker-init', flatpickr_options)\n })\n})\n\ndocument.addEventListener('turbo:load', function() {\n $('#order-receiving').on('click', 'button.add-item', function(event) {\n var element = $(this).closest('.receiving-order-item').find('.flatpickr-init2')\n\n if (element.hasClass('flatpickr-input'))\n return\n\n var flatpickr_options = {\n altInput: true,\n minDate: 'today',\n altFormat: \"D M j Y\",\n dateFormat: \"Ymd\"\n }\n\n flatpickr('#order-receiving .flatpickr-init2:not(.flatpickr-input)', flatpickr_options)\n })\n\n var flatpickr_options = {\n altInput: true,\n minDate: 'today',\n altFormat: \"D M j Y\",\n dateFormat: \"Ymd\"\n }\n\n flatpickr('#order-receiving .flatpickr-init2', flatpickr_options)\n\n})\n\ndocument.addEventListener(\"turbo:before-cache\", function() {\n $('.flatpickr-calendar').remove()\n $(\"input.flatpickr-input[type='hidden']\").each(function() {\n $(this).attr('type', 'text')\n $(this).removeClass('flatpickr-input')\n $(this).next('input').remove()\n })\n})\n","document.addEventListener(\"turbo:load\", function(){\n mapboxElement = document.getElementById('mapbox-map');\n if (!mapboxElement) { return }\n\n mapboxgl.accessToken = mapboxElement.dataset.token\n var map = new mapboxgl.Map({\n container: 'mapbox-map',\n style: 'mapbox://styles/mapbox/streets-v12',\n bounds: JSON.parse(mapboxElement.dataset.bounds)\n });\n\n var routes = JSON.parse(mapboxElement.dataset.routeMarkers);\n\n routes.forEach(function(route, index) {\n route.markers.forEach(function(marker) {\n // create a HTML element for each feature\n var el = document.createElement('div');\n el.className = 'marker';\n if ( !marker.coordinates ) { alert( `${ marker.name } has no address`); return }\n // make a marker for each feature and add it to the map\n new mapboxgl.Marker({ color: route.color})\n .setLngLat(marker.coordinates)\n .setPopup(new mapboxgl.Popup({ offset: 25 }) // add popups\n .setHTML(`
${ marker.name }
${ route.name }
`))\n .addTo(map);\n })\n });\n})\n\ndocument.addEventListener(\"turbo:load\", function(){\n mapboxElement = document.getElementById('mapbox-directions');\n if (!mapboxElement) { return }\n\n mapboxgl.accessToken = mapboxElement.dataset.token\n\n var routes = JSON.parse(mapboxElement.dataset.routes)\n\n var map = new mapboxgl.Map({\n container: mapboxElement.id,\n style: 'mapbox://styles/mapbox/streets-v12',\n bounds: JSON.parse(mapboxElement.dataset.bounds)\n });\n\n map.loadImage('https://cdn-icons-png.flaticon.com/128/17470/17470552.png', (error, image) => {\n if (error) throw error;\n map.addImage('arrow', image);\n })\n\n map.on('load', () => {\n routes.forEach(function(solution_route, index) {\n var stops = solution_route.stops;\n\n for (let i = 0; i < stops.length; i += 24) {\n const limited_stops = stops.slice(Math.max(0, i-1), i + 24);\n var coordinates = limited_stops.map(n => n.coordinates )\n const url = `https://api.mapbox.com/directions/v5/mapbox/driving/${coordinates.join(';')}?geometries=geojson&access_token=${mapboxgl.accessToken}`;\n fetch(url)\n .then(response => response.json())\n .then(data => {\n const route = data.routes[0].geometry;\n const sourceName = `route-${ index }-${ i }`\n // Step 5: Add Route to the Map\n map.addSource(sourceName, {\n type: 'geojson',\n data: {\n type: 'Feature',\n properties: {},\n geometry: route\n }\n });\n\n map.addLayer({\n id: `route-line-${ index }-${ i }`,\n type: 'line',\n source: sourceName,\n layout: {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n paint: {\n 'line-color': solution_route.color,\n 'line-width': 8\n }\n });\n\n map.addLayer({\n id: `route-arrows-${ index }-${ i }'`,\n type: 'symbol',\n source: sourceName,\n layout: {\n 'symbol-placement': 'line',\n 'symbol-spacing': 100, // Adjust spacing between arrows\n 'icon-image': 'arrow',\n 'icon-allow-overlap': true,\n 'icon-ignore-placement': true,\n 'icon-size': 0.15 // Adjust arrow size\n }\n });\n // Step 6: Add Markers for Each Coordinate\n for (let index = stops.length; index > 0; index -= 1) {\n const stop = stops[index-1]\n const el = document.createElement('div');\n el.className = 'map-pin';\n if (stop.type == 'end') { el.className = 'map-pin map-end' }\n if (stop.type == 'start') { el.className = 'map-pin map-start' }\n const numberEl = document.createElement('div');\n numberEl.className = 'map-pin-number';\n numberEl.textContent = index + 1; // Display the index as a label\n el.appendChild(numberEl);\n\n new mapboxgl.Marker(el)\n .setLngLat(stop.coordinates)\n .setPopup(new mapboxgl.Popup({ offset: 25 })\n .setHTML(`
${ stop.name }
${ stop.eta }
`))\n .addTo(map);\n\n }\n })\n }\n })\n })\n})\n","$(document).on('click', '.collapse-open-all', function (e) {\n document.querySelectorAll('.collapse').forEach(\n (col) => { $(col).toggleClass('show') }\n )\n})\n","document.addEventListener('turbo:load', () => {\n // add multiple select / deselect functionality\n const checkAlls = document.querySelectorAll('.selectall');\n checkAlls.forEach((checkAll) => {\n checkAll.addEventListener('change', () => {\n const checkboxes = checkAll.closest('form').querySelectorAll('.case');\n checkboxes.forEach(checkbox => checkbox.checked = checkAll.checked);\n checkboxes.forEach(checkbox => checkbox.dispatchEvent(new Event('change')));\n })\n });\n\n $(\".selectall-new\").on('click', function() {\n var checkAll = $(this).prop('checked');\n if (checkAll) {\n $(this).closest(\".selectall-container\").find(\".case\").prop(\"checked\", true);\n } else {\n $(this).closest(\".selectall-container\").find(\".case\").prop(\"checked\", false);\n }\n });\n\n $('button[data-collect=\"true\"]').on('click', function() {\n var editMultipleForm = $(this).closest(\"form\")\n editMultipleForm[0].querySelectorAll('.selectall-container input[name=\"ids[]\"]').forEach(\n function(existingInput) { existingInput.remove() }\n )\n $(this).closest(\".selectall-container\").find('.case:checked').each(\n function() {\n var value = $(this).val()\n var newInput = ''\n editMultipleForm.prepend(newInput)\n }\n )\n });\n\n $('button[data-toggle=\"reroute-multiple-modal\"]').on('click', function(event) {\n var contentSection = $('#update-multiple-routes .content')\n\n contentSection.html('')\n $(this).data().orderIds.forEach(\n function(id) {\n var newInput = ''\n contentSection.prepend(newInput)\n }\n )\n $(this).data().addresses.forEach(\n function(address) {\n var newInput = ''\n contentSection.prepend(newInput)\n }\n )\n text = '
' + $(this).data().orderIds.length + ' orders
'\n contentSection.prepend(text)\n $('#reroute-multiple-modal').modal()\n });\n\n // if all checkbox are selected, check the selectall checkbox and vice versa\n $(\".case\").click(function(){\n if ($(this).closest(\"form\").find(\".case\").length == $(this).closest(\"form\").find(\".case:checked\").length) {\n $(this).closest(\"form\").find(\".selectall\").prop(\"checked\", true);\n } else {\n $(this).closest(\"form\").find(\".selectall\").prop(\"checked\", false);\n }\n });\n})\n","document.addEventListener('turbo:load', () => {\n if ( !document.getElementById('edit-dashboard') ) { return }\n\n const left = document.getElementById('left-column')\n const center = document.getElementById('center-column')\n const right = document.getElementById('right-column')\n const unused = document.getElementById('unused-column')\n\n const movedDashboard = function (evt) {\n const payload = {\n dashboard: evt.item.dataset.name,\n column: evt.to.dataset.column || '',\n position: evt.newIndex\n }\n\n const data = new URLSearchParams(payload).toString()\n Rails.ajax({\n url: \"/admin/dashboard\",\n type: \"PATCH\",\n data: data\n })\n\t}\n\n new Sortable(left, {\n group: 'shared',\n animation: 150,\n emptyInsertThreshold: 20,\n ghostClass: 'list-group-item-primary',\n onEnd: movedDashboard\n });\n\n new Sortable(center, {\n group: 'shared',\n animation: 150,\n emptyInsertThreshold: 20,\n ghostClass:'list-group-item-primary',\n onEnd: movedDashboard\n });\n\n new Sortable(right, {\n group: 'shared',\n animation: 150,\n emptyInsertThreshold: 20,\n ghostClass: 'list-group-item-primary',\n onEnd: movedDashboard\n });\n\n new Sortable(unused, {\n group: 'shared',\n filter: '.no-drag',\n animation: 150,\n emptyInsertThreshold: 20,\n ghostClass: 'list-group-item-primary',\n onEnd: movedDashboard\n });\n\n})\n","// Quick and simple export target #table_id into a csv\nfunction download_table_as_csv(table_id, separator = ',') {\n // Select rows from table_id\n var rows = document.querySelectorAll(table_id + ' tr');\n // Construct csv\n var csv = [];\n for (var i = 0; i < rows.length; i++) {\n var row = [], cols = rows[i].querySelectorAll('td, th');\n for (var j = 0; j < cols.length; j++) {\n // Clean innertext to remove multiple spaces and jumpline (break csv)\n var data = cols[j].innerText.replace(/(\\r\\n|\\n|\\r)/gm, '').replace(/(\\s\\s)/gm, ' ')\n // Escape double-quote with double-double-quote (see https://stackoverflow.com/questions/17808511/properly-escape-a-double-quote-in-csv)\n data = data.replace(/\"/g, '\"\"');\n // Push escaped string\n row.push('\"' + data + '\"');\n }\n csv.push(row.join(separator));\n }\n var csv_string = csv.join('\\n');\n // Download it\n var filename = 'export_' + table_id + '_' + new Date().toLocaleDateString() + '.csv';\n var link = document.createElement('a');\n link.style.display = 'none';\n link.setAttribute('target', '_blank');\n link.setAttribute('href', 'data:text/csv;charset=utf-8,' + encodeURIComponent(csv_string));\n link.setAttribute('download', filename);\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n}\n\ndocument.addEventListener('turbo:load', () => {\n $('body').on('click', '.download-table', (event) => {\n const tableId = event.target.dataset.target;\n download_table_as_csv(tableId)\n })\n})\n","var findAndCreateTimeout = function() {\n var timeoutRequestElement = document.querySelector('.timeout-request')\n if (!timeoutRequestElement) { return }\n\n var pollPath = timeoutRequestElement.dataset.path\n var useTurbo = timeoutRequestElement.dataset.useTurbo\n\n var requestAsync = function() { Rails.ajax({url: pollPath, type: 'GET'}) }\n var requestTurbo = function() { Turbo.visit(pollPath) }\n var request = useTurbo ? requestTurbo : requestAsync\n\n var msDelay = Number(timeoutRequestElement.dataset.msDelay)\n setTimeout(request, msDelay)\n}\n\ndocument.addEventListener('turbo:load', findAndCreateTimeout)\n"],"names":["map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","e","Error","code","keys","Object","resolve","module","exports","document","addEventListener","$","remove","dropdown","on","this","find","append","modal","window","location","reload","each","formatted","date","seconds","Math","floor","Date","interval","timeSince","data","html","val","trigger","toggleClass","event","target","value","closest","collapse","shiftPressedTimes","shiftTimer","key","clearTimeout","setTimeout","toLowerCase","preventDefault","once","form","laid_in_cost","Number","toFixed","isNaN","Rails","fire","popover","product_unit_id","as_of_date","ajax","url","dataType","type","options","delay","show","hide","self","timeout","hoverState","open","item_id","ClipboardJS","input","icon","removeClass","addClass","change","click","text","siblings","prop","dataset","add","quantityInput","currentQty","max","submit","checked","is","current_value","estimate_value","estimate","updatePaymentTotal","newTotal","expectedTotal","updateRemainingBalance","totalApplied","newValue","sumApplied","remaining","totalRemaining","toSet","min","pk","stripe","Stripe","cardOptions","iconStyle","style","base","fontSize","fontWeight","fontFamily","color","backgroundColor","cardElement","elements","create","mount","cardButton","getElementById","clientSecret","secret","ev","radioButton","querySelector","payload","cardholderName","payment_method","card","billing_details","name","setup_future_usage","slideUp","confirmCardPayment","then","result","error","message","slideDown","setupIntentElement","published_key","fields","billingDetails","billingName","async","confirmSetup","confirmParams","return_url","returnTo","textContent","routing_number","account_number","account_holder_name","account_holder_type","createToken","country","currency","token","hidePostalCode","borderRadius","confirmCardSetup","PurchaseOrderEdit","React","constructor","props","super","onItemCreate","bind","onItemDestroy","onItemUpdate","onNewItemSubtotalUpdate","onChangePurchaseOrder","save","_","toggleName","state","purchase_order","newItemSubtotal","scrubbed_purchase_order","note_from_buyer","PurchaseOrderService","toast","className","setState","showName","calculateTotalDeposit","buyer_order_items","purchase_order_item","deposit_subtotal","reduce","a","b","buyer_order_item","existing","new_buyer_order_items","push","item_to_remove","new_buyer_order_item","indexToReplace","calculateTotal","total","discount","renderItemRows","items","length","item","product_unit","product_name","order_item","PurchaseOrderItemEdit","showCatchWeight","updatedPurchaseOrderItem","deletedPurchaseOrderItem","renderDiscountRow","clasName","asCurrency","renderSubtotalRow","subtotal","renderDepositRow","renderTotalRow","renderName","purchaseOrderName","buttonText","onChange","onClick","renderSubmitButton","status","href","render","PurchaseOrderItemNew","createdPurchaseOrderItem","onSubtotalUpdate","position","autoClose","bodyClassName","hideProgressBar","newestOnTop","closeOnClick","pauseOnHover","onChangeQuantity","onDelete","changePurchaseOrderItem","debounce","PurchaseOrderItemService","newQuantity","quantity","new_purchase_order_item","toggleAdvanced","showAdvanced","renderDeleteButton","renderCatchWeightDescription","actual_unit_price","catch_weight","actual_quantity","unit","catch_weight_unit","item_unit","denominatorUnit","rate","warningClass","classNames","renderNote","note_from_seller","renderDepositDescription","deposit_average","renderDeposit","renderDepositSubtotal","renderSubtotal","renderQuantity","QuantitySelect","minimum","quantity_minimum","maximum","quantity_maximum","initial","renderCatchWeightInput","placeholder","renderUnavailable","is_published","unavailable_until_description","rowClass","src","product_photo","small_url","height","producer_name","effective_unit_price","quantitySelect","addButton","onCreate","onProductUnitSelected","notifyParentOfSubtotalChange","buyer_order_id","current","refocus","calculateSubtotal","focus","ref","renderUnitPrice","price","buttonClass","disabled","ProductUnitSelect","published","seller_id","fetcher","CatalogFetcher","unavailable_type","AddToCart","addToCartBackorder","addToCart","renderQuantityInput","showPricing","cartEnabled","QuantityInput","unitId","dontCare","buyer_order_item_params","addItem","backorder","renderAddToCart","colorClass","addToCartFunction","renderAvailability","renderQtyAndButton","Cart","visible","toggle","seeOrder","path","seller_browsing","buyer_order","removeItem","order_item_id","confirm","removeOrderItem","updateOrderItemQuantity","buyer_order_item_id","renderProducts","CartItem","showProducer","editQuantity","orderTotal","x","itemCount","body","edit","confirmEdit","renderNotAvailable","renderBackordered","renderOriginalSubtotal","original_subtotal","width","DeliveryDatePicker","chooseDate","toggleDatePicker","showDatePicker","formatDate","date_string","isTomorrow","toLocaleDateString","weekday","month","day","renderButtons","available_days","renderActiveButton","renderDisabledButton","monthName","string_date","slice","isToday","active","requested_on","renderDropdown","OrderCatalog","createOrUpdateItem","createOrderAndItem","updateRequestedOn","buyer_id","seller","newUrl","history","replaceState","index","findIndex","removeItemFromBuyerOrder","without","renderCart","accepting_orders","ProductCatalog","page","batch","params","private_catalog_id","producers","categories","collections","requested_on_options","preloaded_products","requestedOn","cart","startTerm","selectedProducerId","Product","expanded","openGallery","showDiscountIndicator","product","discount_price","renderProducerCity","city","renderProducerName","renderProductImage","showImage","imageContainerClassNames","image","note","renderListProduct","ProductUnitPrice","description","renderGridProduct","productContainerClasses","ProductUnitDeposit","Catalog","addItemToCart","changeLayoutToList","changeLayoutToGrid","changeGalleryIndex","closeGallery","requestProductDetail","toggleLocalOnly","setSort","toggleFilters","setProducer","setRequestedOn","toggleIsStocked","changeLayoutToListNoImages","search","fetchProducts","grid","list","listNoImg","isStocked","showGallery","layout","pageCount","currentPage","batchSize","filters","sortBy","collection","subcollection","localOnly","empty","productCount","loadingResults","pagedProducts","initialProductRequest","buildParams","productBatch","requestProductCount","loadProducts","ahoy","modulus","newIndex","productSlug","product_slug","response","otherProducts","searchParams","count","newPageCount","ceil","buyerId","requestProducts","componentDidMount","validSearch","addedProducts","changeSearchTerm","newSearchTerm","previousSearchTerm","trim","term","showFilters","changePage","desiredPage","offsetPosition","getBoundingClientRect","top","pageYOffset","scrollTo","behavior","changeFilters","setCategory","category","setCollection","collectionSlug","setSubcollection","currentTarget","newIsStocked","renderPageTabs","tabs","starting","len","i","language","renderLayoutButtons","changeLayoutGridButtonClass","changeLayoutListButtonClass","changeLayoutListNoImagesButtonClass","role","renderProductList","renderNoResults","loadedPageCount","renderSearchNotifier","category_list","collectionName","slug","current_children","producer_list","terms","concat","today","tomorrow","setDate","getDate","join","start","currentEnd","countMsg","renderWaitSpinner","renderOrderDeadlineText","ordering_message","renderSellerLogo","logoContent","logo_url","renderCategoryToggles","classes","renderCollections","renderCollectionToggles","collectionClasses","children","child_collection","subcollectionClasses","renderIsStocked","placement","renderProducers","producerOptions","producer","city_state","htmlFor","renderRequestFor","values","filter","element","renderDownload","renderLocalOnlyToggle","renderSort","selected","sidebarToggleClass","ProductGallery","SearchBar","handleSwipe","handleKeyPress","componentWillUnmount","removeEventListener","keyCode","next","previous","direction","stopPropagation","renderDisplay","renderIndividualUnitPrice","individual_unit_name","individual_unit_price","renderProductUnits","other_product_units","otherUnits","show_unit","Boolean","rightarrow","leftarrow","city_state_tag","large_url","onSwipe","deposit","showDiscountPrice","renderDiscountUnitPrice","discount_unit_price","renderDiscountPrice","renderCatchWeight","formattedUnitPrice","catch_weight_unit_price","formattedPrice","PublicCatalog","upperLimit","handleChange","newval","parseInt","reset","flatMap","y","subslug","subname","pickCollection","all","fuse","Fuse","includeScore","threshold","weight","parentSlug","renderMatchingCollections","autoComplete","Forecast","renderForecastUpArrow","forecast","arrowClass","in_qty","arrow","renderForecastDownArrow","out_qty","forecastStyling","close_qty","is_sequence","is_replenishment","renderForecast","multiplier","split_multiplier","forecast_columns","forecasts","forecast_day","stocked_qty","openOrder","earliest_draft_po","title","parseFloat","renderHeader","dateOptions","timeZone","headers","formattedDate","replace","OrderInfo","renderStatusIcon","renderDate","order","fulfillment_expected_on","stripZeros","total_quantity","Option","innerProps","option","availableIcon","mutedUnavailable","strikethroughClass","discountPrice","c","Input","SingleValue","searchInput","onInputChange","inputValue","isLoading","products","filterOption","noOptionsMessage","components","isOptionSelected","maxMenuHeightnumber","isClearable","closeOnTab","negativePattern","RegExp","allowDecimal","positivePattern","showMenu","checkNumeric","onlyNegativeQuantity","test","changeTo","closeMenu","select","renderQuantityButtons","mult","which","quantityAsNumber","inputClasses","onKeyDown","BuyerOrderService","static","Promise","reject","HTTP","InventoryForecastService","OrderItemMoveService","sales_order_item_id","move_attributes","order_item_move","SalesOrderEdit","onChangeBuyerOrder","changeOrder","changeSortMethod","toggleForecast","showForecast","open_orders","sortMethod","scrubbed_buyer_order","update","move_type","new_order_id","notes","reason","to_order_id","to_order","buyerOrder","loadingForecast","query","subtotals","overpayment_credit","productUnitCounts","sortedItems","created_at","forecast_product_unit_id","split_product_unit_id","SalesOrderItemEdit","isPurchaseOrder","credit","sales_order_item","showProducerName","updatedSalesOrderItem","String","commonInternalNotes","orderProductUnitCount","deletedSalesOrderItem","renderAfterSubtotalRows","renderOverpaymentRow","payment_id","endsWith","renderButton","contactCount","action","acceptCharset","method","csrf_token","renderForecastButton","forecastActive","renderSortButtons","timeActive","nameActive","renderOrderButtons","orderLinks","SalesOrderItemNew","sales_order","createdSalesOrderItem","onMoveRadioChanged","changeSalesOrderItem","changePriceOverride","changeSubtotalOverride","copyInternalNote","moveRadio","moveType","existingOrderId","errorMessages","errorMessage","internal_seller_note","newMoveRadio","newStateValues","undefined","SalesOrderItemService","new_sales_order_item","calculated_subtotal","renderSticky","lineId","iconLetter","tooltipText","renderNoteInput","internalNote","renderReasonDropdown","renderMove","draftOrderButtons","open_order","renderAdvancedEdit","renderSellerNote","reasonButtons","renderBuyerNote","renderInternalSellerNote","renderSubtotalOverride","subtotal_override","price_override","maxWidth","renderDepositOverride","deposit_override","renderOriginalEffectivePrice","original_effective_price","renderBackorder","renderSrc","unavailable_until","split","productUnitSelect","initialQuantity","showUnavailable","application","Application","debug","Stimulus","Controller","connect","showPopover","hidePopover","fetchPopoverContent","popoverElement","cancelHidePopover","startHidePopover","disconnect","off","clone","targetForm","cloneFrom","clonerCloneFrom","clonedElement","cloneNode","register","ProductUnitActivityPopoverController","SimplePopoverController","ClonerController","fn","DataTable","require","global","Sortable","LocalTime","Chart","ChartDataLabels","font","size","mapboxgl","componentRequireContext","ReactRailsUJS","useContext","handleEvent","handleMount","handleUnmount","sellerId","catalogId","buyer","privateCatalog","categoriesSearch","collectionsSearch","producersSearch","textSearch","isFeatured","encodeURIComponent","success","failure","xhr","XMLHttpRequest","onload","handleResponse","JSON","parse","responseText","send","setRequestHeader","stringify","parseISO","format","numericPrice","toLocaleString","substr","dateString","tomorrowDate","numberString","numericNumber","visitsUrl","eventsUrl","tooltip","selectize","onDropdownOpen","clear","selectOnTab","allowEmptyOption","plugins","$input","get","sort","$order","optionsArray","obj","setValue","ids","selectized","destroy","selectedOption","multiple","datatable","stateSave","api","draw","inputs","querySelectorAll","totalElement","innerHTML","getAttribute","flatpickr","altInput","altFormat","dateFormat","enableTime","inline","selectedDates","dateStr","instance","onDayCreate","dObj","dStr","fp","dayElem","schedule","indexOf","dateObj","toISOString","minDate","_input","hasClass","attr","mapboxElement","accessToken","Map","container","bounds","routeMarkers","forEach","route","markers","marker","createElement","coordinates","Marker","setLngLat","setPopup","Popup","offset","setHTML","addTo","alert","routes","loadImage","addImage","solution_route","stops","n","fetch","json","geometry","sourceName","addSource","properties","addLayer","source","paint","stop","el","numberEl","appendChild","eta","col","checkAll","checkboxes","checkbox","dispatchEvent","Event","editMultipleForm","existingInput","newInput","prepend","contentSection","orderIds","addresses","address","left","center","right","unused","movedDashboard","evt","dashboard","column","to","URLSearchParams","toString","group","animation","emptyInsertThreshold","ghostClass","onEnd","table_id","separator","rows","csv","row","cols","j","innerText","csv_string","filename","link","display","setAttribute","removeChild","download_table_as_csv","timeoutRequestElement","pollPath","request","useTurbo","Turbo","visit","msDelay"],"sourceRoot":""}