PageSourceSearch

https://tyc.org/public/dist/sc-common.628889f40a86.js

js tyc.org collected 2026-10-07 16:05:33 UTC 12,174 bytes, 1 lines download raw bytes

1!function(){var e="object"==typeof module&&"object"==typeof exports&&void 0!==module.exports&&"object"==typeof process,ServClientCommon={};if(e){var t=require("fs"),r=require("path"),n=require("vm"),i=r.join(__dirname,"ServClientCommon");t.readdirSync(i).filter(e=>e.endsWith(".js")).sort().forEach(function(e){var o=t.readFileSync(r.join(i,e),"utf8");n.runInThisContext("(function(ServClientCommon) {\n"+o+"\n})",{filename:r.join("ServClientCommon",e)})(ServClientCommon)}),module.exports=ServClientCommon}else Object.assign(ServClientCommon,{isCreditNormalAccountType:e=>["revenue","liability","equity"].includes(e),return_payment_reference:e=>{var{payment_method:t,check_number:r,bill_payment_id:n,voided:i}=e,o=String(t||"").toLowerCase(),a="";if("check"==o&&r)a="#"+String(Number(r)||0).padStart(4,"0");else if(n){a=({check:"CHK",ach:"ACH",wire:"WIRE",credit_card:"CC",cash:"CASH",other:"OTH"}[o]||"PMT")+"-"+n}return a&&i&&(a+=" (VOID)"),a},return_reconciliation_row_description:e=>{var t=e.get("billPaymentObject");if(t){var r={check:"Check payment",ach:"ACH payment",wire:"Wire payment",credit_card:"Credit card payment",cash:"Cash payment",other:"Payment"}[String(t.get("payment_method")||"").toLowerCase()]||"Payment",n=t.get("vendor_name")||t.get("check_payee_name")||"";return n?r+" to "+n:r}return e.get("description")||""},return_gl_reference:e=>{if(!e)return"";return({payout_paid:"DEP",payout_failed:"DEP",bank_deposit_finalized:"DEP",manual:"JE",manual_credit_or_debit:"JE",vendor_manual_credit_or_debit:"JE"}[String(e.get("type")||"")]||"TXN")+"-"+e.id},return_reconciliation_row_reference:e=>{var t=e.get("billPaymentObject");if(t){var r={payment_method:t.get("payment_method"),check_number:t.get("check_number"),bill_payment_id:t.id,voided:"bill_payment_voided"==e.get("type")},n=ServClientCommon.return_payment_reference(r);if(n)return n}return ServClientCommon.return_gl_reference(e)},return_reconciliation_row_amount:e=>{var{transactionObject:t,coa_id:r}=e,n=t.get("chartJSON")||{};return(n[r+"_debit"]||0)-(n[r+"_credit"]||0)},normalizeAccountBalance:(e,t,r)=>("number"!=typeof e&&(e=0),"number"!=typeof t&&(t=0),ServClientCommon.isCreditNormalAccountType(r)?t-e:e-t)}),Object.assign(ServClientCommon,{cloneAclWithoutPublicAccess:e=>{var t=new Parse.ACL;if(t.setPublicReadAccess(!1),t.setPublicWriteAccess(!1),!e)return t;var r=e.toJSON();for(var n in r)if("*"!==n){var i=r[n]||{};if(0===n.indexOf("role:")){var o=n.substring(5);(i.read||i.write)&&t.setRoleReadAccess(o,!0),i.write&&t.setRoleWriteAccess(o,!0)}else(i.read||i.write)&&t.setReadAccess(n,!0),i.write&&t.setWriteAccess(n,!0)}return t}}),Object.assign(ServClientCommon,{mco_map:()=>({ovg:{name:"Oak View Group",consolidated_billing:!0,club_ids:["oqddJiCyvV","0pv2wMQp1O","6RsxH6ZFGb","te7DTa7Qdz","Fq0b79y5ga","0OIc9hATkR","hME3b1OARI","ITDfnvLsAZ"]},evergreen:{name:"Evergreen",consolidated_billing:!0,club_ids:["aMaW7TFg3N","BqzPdVONyQ","EwxaA66BKD","GaytEyO3lM"]},intown:{name:"Intown Golf Club",consolidated_billing:!0,parent_club_id:"AgxloA7xBk",club_ids:["AgxloA7xBk","CNas1eAMq5","e5izU4T2Rn","gTCP3n5hGe","ZD4KBrnnxu","IeQYJercMB","BuY9anwnFy","NbYAuwtTzE"]}}),is_club_in_mco:(e,t)=>{var r=ServClientCommon.mco_map()[t];return!!e&&!!r&&r.club_ids.includes(e)},isOVG:e=>ServClientCommon.is_club_in_mco(e,"ovg"),isEvergreen:e=>ServClientCommon.is_club_in_mco(e,"evergreen"),isIntown:e=>ServClientCommon.is_club_in_mco(e,"intown"),is_intown_parent_club:e=>!!e&&e===ServClientCommon.mco_map().intown.parent_club_id,is_mco_parent_club:e=>!!e&&Object.keys(ServClientCommon.mco_map()).some(t=>ServClientCommon.mco_map()[t].parent_club_id===e),isHoustonYC:e=>!!e&&["2VIitLY03J","JALDVo7aSc"].includes(e),usesClassesLikeDepartments:e=>{if(ServClientCommon.isIntown(e))return!0;return!!e&&["2VIitLY03J","JALDVo7aSc","lrmjE2yiwk","kve0seQrWn","MnO4x71VMF","BuY9anwnFy"].includes(e)},allowGiftCardsOnCheckout:e=>!!e&&["ecNpKgrusD","Gbx7UiqFxH"].includes(e),return_mco_parent_id_for_club:e=>{if(!e)return null;if(ServClientCommon.is_mco_parent_club(e.id))return e.id;let t=e.get("mco_parent_club");return t?t.id:null},clubs_share_mco_parent:e=>
1{let{clubObject:t,other_club_object:r}=e;if(!t||!r)return!1;if(t.id==r.id)return!0;let n=ServClientCommon.return_mco_parent_id_for_club(t),i=ServClientCommon.return_mco_parent_id_for_club(r);return!(!n||!i)&&n==i},return_equivalent_tier_id_for_club:e=>{let{source_tier_id:t,target_club_id:r,equivalent_groups:n}=e;if(!t||!r||!n||0==n.length)return t;for(let e=0;e<n.length;e++){let i=n[e];if("add_on"==i.get("type"))continue;let o=i.get("tierObjects")||[];if(!o.some(e=>e&&e.id==t))continue;let a=o.find(e=>{if(!e)return!1;let t=e.get("clubObject");return t&&t.id==r});if(a)return a.id}return t},return_equivalent_add_on_id_for_club:e=>{let{source_add_on_id:t,target_club_id:r,equivalent_groups:n}=e;if(!t||!r||!n||0==n.length)return t;for(let e=0;e<n.length;e++){let i=n[e];if("add_on"!=i.get("type"))continue;let o=i.get("addOnObjects")||[];if(!o.some(e=>e&&e.id==t))continue;let a=o.find(e=>{if(!e)return!1;let t=e.get("clubObject");return t&&t.id==r});if(a)return a.id}return t},return_equivalent_add_on_ids_for_club:e=>{let{source_add_on_ids:t,target_club_id:r,equivalent_groups:n}=e;return t&&0!=t.length?t.map(e=>{let t={source_add_on_id:e,target_club_id:r,equivalent_groups:n};return ServClientCommon.return_equivalent_add_on_id_for_club(t)}):t||[]},is_mco_with_consolidated_billing:e=>{var t=ServClientCommon.mco_map();return!!e&&Object.keys(t).some(r=>t[r].consolidated_billing&&t[r].club_ids.includes(e))},legacy_reciprocity_enabled:e=>["3kdD9Tfz6v","jLQdCnpujU","CHJgkyegkX","tmYzZDKwuJ","27nCuw9Ayf","0eWtEeeghk","MHYZyj6GYb","Y3NuNsjnUC","ydFhcuf7UP","n1MXuAPaNM","eiolu33wCv","OIWjdCBf3R","DYhMSWiCal","vguS1FSGV2","DifmxRdrET","mbGvy19CAc","1SPBuJOgpe"].includes(e)||!1}),Object.assign(ServClientCommon,{is_inventory_v2:e=>!!e&&(!!e.get("ap_enabled")||!0===e.get("inventory_v2")),return_inventory_accounting_method:(e,t)=>{if(!ServClientCommon.is_inventory_v2(t))return t&&t.get("ignore_inv_cogs")?{method:"cost_only",legacy:!0}:{method:"perpetual",legacy:!0};var r=e?e.get("inventory_accounting_method"):null;return r?{method:r,legacy:!1}:{method:"cost_only",legacy:!1}},inventory_accounting_methods:()=>["perpetual","periodic","cost_only"],ap_permission_definitions:()=>[{key:"all",name:"All permissions",text:"Grants every accounts payable permission below."},{key:"submit_vendor_invoice",name:"Submit vendor invoices",text:"Send a draft vendor invoice for approval."},{key:"confirm_vendor_invoice",name:"Approve vendor invoices",text:"Approve vendor invoices awaiting approval."},{key:"void_vendor_invoice",name:"Void vendor invoices",text:"Void a confirmed vendor invoice."},{key:"submit_purchase_order",name:"Open purchase orders",text:"Move a draft purchase order to open so it can be received."},{key:"submit_goods_receipt",name:"Receive goods",text:"Record goods received against a purchase order or vendor invoice."},{key:"void_goods_receipt",name:"Void goods receipts",text:"Void a received goods receipt."},{key:"pay_vendor_invoice",name:"Pay vendor invoices",text:"Record and confirm bill payments to vendors."},{key:"manage_vendors",name:"Manage vendors",text:"Create and edit vendors and vendor credits."}],ap_permissions_enforced:e=>ServClientCommon.is_inventory_v2(e),return_ap_permission_error:e=>{var t=ServClientCommon.ap_permission_definitions().find(t=>t.key===e);return"You do not have permission to "+(t?t.name.toLowerCase():e)+"."},has_ap_permission:e=>{var{permissions:t,key:r}=e;if(!t)return!1;if(t.admin||t.finance)return!0;var n=t.ap_permissions||{};return!0===n.all||!0===n[r]},stock_rules:()=>["unlimited","track_product","track_options","track_components"],inventory_product_types:()=>["standard","food_and_beverage","banquet_item"],is_inventory_product_type:e=>-1!==ServClientCommon.inventory_product_types().indexOf(e),return_stock_rule_for_product:e=>{if(!e)return null;if(!0===e.get("unlimited_stock"))return"unlimited";var t=e.get("stock_rule");return"track_options"===t||"track_components"===t?t:"track_product"},is_inventory_stock_rule:e=>"track_product"===e||"track_options"===e,is_inventory_item:e=>{if(!e)return!1;let t=e.get("type");return t||e.get("bookable")||(t="standard"),!!ServClientCommon.is_inventory_product_type(t)&&ServClientCommon.is_inventory_stock_rule(ServClientCommon.return_stock_rule_for_product(e))},return_allowed_methods_for_stock_rule:e=>"track_product"===e?["perpetual","periodic","cost_only"]:"track_options"===e?["perpetual","cost_only"]:"unlimited"===e?["cost_only"]:[],cost_code_distribution_rules:()=>["value","quantity","none"],cost_code_target_scopes:()=>["inventory","all"],system_cost_codes:()=>[{system_key:"shipping",name:"Shipping",distribution_rule:"value",target_rule:"inventory"},{system_key:"tax",name:"Tax",distribution_rule:"value",target_rule:"all"},{system_key:"discount",name:"Discount",distribution_rule:"value",target_rule:"all"},{system_key:"fee",name:"Fee",distribution_rule:"value",target_rule:"inventory"},{system_key:"other",name:"Other",distribution_rule:"value",target_rule:"inventory"}],return_invoice_line_type:e=>e.line_type||("product"==e.kind?"product":null),is_inventory_product_line:e=>!(!e||!e.product||e.product.placeholder)&&(!1!==e.product.receives_stock&&"product"==ServClientCommon.return_invoice_line_type(e)),return_distribution_rule_for_other_row:e=>e.distribution_rule?e.distribution_rule:!1===e.blended?"none":"value",return_split_cents:(e,t)=>{var r=t.map(()=>0),n=t.reduce((e,t)=>
1e+t,0);if(!e||n<=0)return r;var i=e<0?-1:1,o=Math.abs(e),a=[],_=0;t.forEach((e,t)=>{var i=o*e/n,c=Math.floor(i);r[t]=c,_+=c,a.push({index:t,remainder:i-c})}),a.sort((e,t)=>t.remainder-e.remainder);for(var c=o-_,s=0;s<c;s++)r[a[s].index]+=1;return r.map(e=>e*i)},return_allocated_cents_by_line_id:(e,t)=>{var r=function(e){return Math.round(100*(Number(e)||0))},n=(e||[]).filter(e=>!(!e||e.product&&e.product.is_option)),i={},o=[];return(t||[]).forEach((e,t)=>{if(e){var a=ServClientCommon.return_distribution_rule_for_other_row(e);if("none"!==a){var _=r(e.total);if(_){var c=e.target_scope||"all",s=Array.isArray(e.target_line_ids)?e.target_line_ids:[],u=[];if(n.forEach(e=>{if(("lines"!==c||-1!==s.indexOf(e.line_id))&&("inventory"!==c||ServClientCommon.is_inventory_product_line(e))){var t="quantity"===a?Number(e.qty)||0:r(e.total);t<=0||u.push({line:e,weight:t})}}),0!==u.length){var d=ServClientCommon.return_split_cents(_,u.map(e=>e.weight));u.forEach((e,t)=>{var r=e.line.line_id;i[r]=(i[r]||0)+d[t]})}else{var l="quantity"===a?"a quantity":"a total";o.push({other_index:t,message:"No items with "+l+" to spread this cost across."})}}}}}),{allocated_cents_by_line_id:i,errors:o}}}),Object.assign(ServClientCommon,{product_type_labels:()=>({standard:"Standard",food_and_beverage:"Food & beverage",bookable:"Reservable item",facility:"Facility item",banquet_item:"Banquet item",banquet:"Banquet event",banquet_deposit:"Banquet deposit",banquet_prepayment:"Banquet prepayment",banquet_service_fee:"Banquet service fee",membership_add_on:"Membership add-on",membership_category:"Dues",membership_minimum:"Minimum",membership_application_fees:"Membership application fee",invoice_late_fee:"Membership late fee",prepaid_minimum:"Prepaid minimum",gift_card:"Gift card",guest_fee:"Guest fee",entry_fee:"Entry fee",class_pass:"Class pass",custom_field_response:"Custom field response",package:"Package",surcharge:"Surcharge",extra_service_charge:"Extra service charge",processing_passed_on:"Processing passed on",donation:"Donation"}),return_product_type_label:e=>{if(!e)return"Standard";var t=ServClientCommon.product_type_labels()[e];return t||e.replaceAll("_"," ").replace(/\b\w/g,e=>e.toUpperCase())},return_product_type_label_for_product:e=>{if(!e)return"";if("bookable"==e.get("type")){if(e.get("court"))return"Court";if(e.get("lodging"))return"Lodging"}return ServClientCommon.return_product_type_label(e.get("type"))}}),Object.assign(ServClientCommon,{nice_display_name:e=>{if(!e)return"";let t=e.get("displayName");return t?-1!=t.indexOf("Clubspot Support -")?"Clubspot Support":t:""}}),window.ServClientCommon=ServClientCommon}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.